[pve-devel] [PATCH qemu-server v5 0/3] Add qm importdisk command
Emmanuel Kasper
e.kasper at proxmox.com
Mon May 22 10:34:44 CEST 2017
this version (v5) changes:
* QemuServer.pm
* rename choose_dst_disk_format to resolve_dst_disk_format
( as the end user chooses, but the computer resolve)
* fix a uninitialized value warning when format was unspecified
when called without $srv_volname being set
* ImportDisk.pm
* remove data dumper
* use file_size_info from Storage.pm module
* always call choose_dst_disk_format
* fix comment
* remove $dst hash ref
* remove unnecessary vm_is_volid_owner()
* merge create_unused_ and create_active_ in my $create_drive
* check if requested drive_name is valid before allocating disk image
* check if requested drive_name is available once we locked (should not happpen but ...)
* extract optional params early to avoid lots of hash dereferencing later on
* qm.pm
* use the right format for storage command line parameter
* add extra parameters checks:
* vm should not be locked
* source file must be a regular file
* storage must be valid
v4 changes:
* add optional switch -format to select between raw|qcow2|vmdk, like qm move_disk.
For this the code handling target format in clone_disk was factored out in a
separate sub that we reuse
* fix overwriting of vm.conf when importdisk and ovfdisk were combined
(was bitten by autovivification)
* rename command and package from diskimport to importdisk, because we
mostly have listsnapshots, move_disk, etc ... (verb + name)
* useful nitpicks from Thomas about code formatting
v3 ceanges:
* when command lines parameters are mandatory, do not hide them behind switches
Emmanuel Kasper (3):
Refactor the resolution of target disk format in own sub
Add ImportDisk module to import external disk images into a VM
Add new qm option 'diskimport' to import external disk images
PVE/CLI/qm.pm | 51 ++++++++++++++++++++++++++
PVE/QemuServer.pm | 33 +++++++++++------
PVE/QemuServer/ImportDisk.pm | 87 ++++++++++++++++++++++++++++++++++++++++++++
PVE/QemuServer/Makefile | 1 +
4 files changed, 161 insertions(+), 11 deletions(-)
create mode 100755 PVE/QemuServer/ImportDisk.pm
--
2.11.0
More information about the pve-devel
mailing list