Commit Graph

271 Commits

Author SHA1 Message Date
Dietmar Maurer
ccb5c001d6 qemu_img_format: use 'raw' for lvm
With host_device we get the following error:

qemu-img: error while writing sector 0: Bad file descriptor
2013-05-07 10:15:57 +02:00
Alexandre Derumier
f6ab3bdbf9 drive-mirror : die if stats are empty.
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>
2013-05-06 11:29:41 +02:00
Dietmar Maurer
4fca015325 set long timeout for query-block-jobs
Like we do for other block job query commands. Seems those commands
can hangs for some time.
2013-05-06 09:25:39 +02:00
Dietmar Maurer
719893a944 has_features: also return a list of allowed nodes
This is useful if a feature is restricted to a limited set of nodes.
2013-05-06 08:56:17 +02:00
Alexandre Derumier
cfad42afd4 add qemu_drive_mirror
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-05-03 08:37:03 +02:00
Dietmar Maurer
4e4f83fea0 copy_vm: use exclusive lock for running VM
Because we can only run one block job to copy data.
2013-04-30 07:40:43 +02:00
Alexandre Derumier
15b1fc9395 don't send qmp balloon commands if vm is started with a state file
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-04-30 07:01:58 +02:00
Alexandre Derumier
bdf3f36209 parse_drive : return correct format
Currently format is always empty, we need to parse file extension

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-04-30 06:55:33 +02:00
Alexandre Derumier
5133de429e add qemu_img_convert
also work with snapshot as source for qcow2,rbd,sheepdog.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-04-29 09:30:58 +02:00
Dietmar Maurer
6116f72902 implement shared file locks
and add a first prototype for copy_vm
2013-04-29 09:30:15 +02:00
Dietmar Maurer
35c5fdefce move assertion so that we have all checks at the same place. 2013-04-22 07:10:58 +02:00
Dietmar Maurer
75e7e997e7 set template flag earlier 2013-04-22 07:08:51 +02:00
Dietmar Maurer
0402a80b77 do not allow template creation if there are snapshots. 2013-04-22 07:05:54 +02:00
Alexandre Derumier
bbd560974a template_create : add template:1 option.
Also allow template create of non base-xxx renamable storage

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-04-22 06:59:18 +02:00
Dietmar Maurer
03da3f0d46 fix bug 377: make qm rescan work properly 2013-04-19 10:45:46 +02:00
Alexandre Derumier
96d695c08a is_template : return 1 if template option == 1
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-04-19 06:56:30 +02:00
Alexandre Derumier
68eda3abc4 add template config option
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-04-19 06:56:03 +02:00
Dietmar Maurer
013d52755f allow sparse restore for sheepdog and rbd 2013-04-18 06:14:50 +02:00
Dietmar Maurer
92f0fedcce parse_net: fix warning about uninitialized value 2013-03-22 06:23:22 +01:00
Alexandre Derumier
1f219ef546 virtio disk hot-unplug: drive_del after device_del
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>
2013-03-07 08:37:49 +01:00
Alexandre Derumier
750886f87a nic hot-unplug: delete netdev after device removal
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>
2013-03-07 08:37:23 +01:00
Alexandre Derumier
ef86170e9f bugfix #340 : don't set cache=none to cdrom
Cdrom devices don't works with cache=none and no reason to force cache mode on cdrom

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-27 09:21:31 +01:00
Dietmar Maurer
eac6899d96 default cpu type is kvm64 now 2013-02-25 07:01:51 +01:00
Alexandre Derumier
11490cf228 set cache=none if option is not defined
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-25 06:11:37 +01:00
Alexandre Derumier
0ecf8463da usb-tablet : always use uhci controller
- 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>
2013-02-22 11:53:52 +01:00
Alexandre Derumier
24f0d39a6c uhci controller : use new -device syntax
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>
2013-02-22 11:52:23 +01:00
Dietmar Maurer
fcc573ab24 Revert "enable usb2 controller by default"
This reverts commit 42869ac07d.
2013-02-22 10:08:10 +01:00
Dietmar Maurer
2dbe827e38 disable hotplug by default
This reverts commit 6c52b6794e

Testing revealed that this has too many side effect, so we do not want
to change that for the 2.3 release.
2013-02-22 09:52:45 +01:00
Dietmar Maurer
6c52b6794e hotplug/unplug devices by default 2013-02-19 10:47:17 +01:00
Alexandre Derumier
73aa03b87f qemu_netdevadd : convert to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-19 10:32:01 +01:00
Alexandre Derumier
89c1e0f438 qemu_netdevdel : convert to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-19 10:31:51 +01:00
Alexandre Derumier
d695b5b725 qemu_deviceadd : convert to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-19 10:31:43 +01:00
Alexandre Derumier
5a77d8c105 qemu_devicedel : convert to qmp
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-19 10:31:28 +01:00
Alexandre Derumier
cd6ecb89eb hotplug/unplug tablet on config update
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-19 06:42:53 +01:00
Alexandre Derumier
42869ac07d enable usb2 controller by default
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-19 06:41:05 +01:00
Alexandre Derumier
a6f0e83b93 template_create : check has_feature template
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-18 06:19:14 +01:00
Dietmar Maurer
8b43bc11db add missing newline 2013-02-15 11:08:28 +01:00
Dietmar Maurer
9cd0784249 template_create: check for 'clone' feature 2013-02-15 08:44:12 +01:00
Dietmar Maurer
3e2bbcdc0e is_template: always return a defined value
use 0 instead of undef
2013-02-15 08:12:33 +01:00
Alexandre Derumier
4d8c851bcc vmstatus : return template if vm is a template
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 08:09:36 +01:00
Dietmar Maurer
5295b23dfb move template checks up one level
To avoid multiple/repeated calls to load_config().
2013-02-15 08:04:30 +01:00
Alexandre Derumier
f78fe36ece forbid snapshot create if current it's a template
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 07:57:01 +01:00
Alexandre Derumier
3dcb98d52b forbid vm_start if current config is a template.
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>
2013-02-15 07:52:28 +01:00
Alexandre Derumier
90b0c6b34a forbid rollback if current config is a template.
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>
2013-02-15 07:52:09 +01:00
Alexandre Derumier
66aa07141f forbid snapshot delete if it's a template
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-15 07:51:46 +01:00
Alexandre Derumier
624361b34a add is_template sub
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>
2013-02-15 07:51:09 +01:00
Alexandre Derumier
04a69bb4fe add template_create
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>
2013-02-15 07:50:32 +01:00
Dietmar Maurer
ef1c835d19 do not set cache=none for .raw files
use qemu default instead (writeback)
2013-02-14 08:19:39 +01:00
Alexandre Derumier
abebe2f16c qemu 1.4 fix : rename stats-polling-interval to guest-stats-polling-interval
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2013-02-13 10:00:41 +01:00
Dietmar Maurer
ebb5555800 fix tar restore: correctly check if VM config already exists 2013-01-28 09:54:00 +01:00