If drive have bad sectors, the block job die.
we need to die if stats are empty to avoid this:
transferred: 21440086016 bytes remaining: 34668544 bytes total: 21474754560 bytes progression: 99.84 %
Use of uninitialized value $transferred in subtraction (-) at /usr/share/perl5/PVE/QemuServer.pm line 4611.
Use of uninitialized value $total in subtraction (-) at /usr/share/perl5/PVE/QemuServer.pm line 4611.
Use of uninitialized value $transferred in multiplication (*) at /usr/share/perl5/PVE/QemuServer.pm line 4612.
Use of uninitialized value $total in division (/) at /usr/share/perl5/PVE/QemuServer.pm line 4612.
clone failed: mirroring error: Illegal division by zero at /usr/share/perl5/PVE/QemuServer.pm line 4612.
Maybe it should be improved by catching qmp events, but doesn't seem to work for now
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
we need to remove drive after device has correctly by remove.
With this patch:
Windows : if drive is locked/"mounted", the hot-unplug fail and disk is accessible (100% safe)
Linux: without hotplug module : the hot-unplug fail and disk is accessible (100% safe)
Linux : with hotplug module : the hot-unplug work, but no verification is done is the drive is mounted
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Currently we delete netdev before acpi hot-unplug.
if guest don't support hotplug, this break network.
We need to remove netdev after the device had be correctly unplug.(we check that device has been correctly removed)
So, If guest don't support hotplug, It's simply thrown a unplug error message without breaking the network
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
- usb-tablet on ehci is buggy
- convert to -device syntax
info usb before
----------------
Device 0.2, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
info usb after
--------------
Device 0.2, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
we need an id to allow hotplug
info pci before
---------------
Bus 0, device 1, function 2:
USB controller: PCI device 8086:7020
IRQ 11.
BAR4: I/O at 0xc040 [0xc05f].
id ""
info pci after
--------------
Bus 0, device 1, function 2:
USB controller: PCI device 8086:7020
IRQ 11.
BAR4: I/O at 0xc040 [0xc05f].
id "uhci"
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
if files (raw,qcow2) are a template, we forbid vm_start.
note : the readonly protection do already the job, but we need a clear message for users
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
if a qcow2 current is a template, we can't rollback to a previous snapshot.
(note that file readonly protection do already the job, but we need a clear error message for user)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
return 1 if vm is a full template (all disks are base image)
return 2 if vm is a semi-tempalte (mix of base and non-base image)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
qm template <vmid> [-disk virtio0]
convert a full vm to a template (or only a disk if specify)
we orignal disk to /base (file) or base- (lvm,rbd,sheepdog,nexenta)
we create a snapshot @base if storage need it for clone
we protect the volume or snapshot
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>