]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: Update state of block job to READY only if it actually is ready
authorPeter Krempa <pkrempa@redhat.com>
Wed, 15 Jul 2015 13:11:02 +0000 (15:11 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 21 Jul 2015 13:32:59 +0000 (15:32 +0200)
commiteae59247c59aa02147b2b4a50177e8e877fdb218
treec5ed036d6a3b250c455fae1152422f532104c7dd
parent44b18323e5e29206b51fc2488f3c00ec20a6a107
qemu: Update state of block job to READY only if it actually is ready

Few parts of the code looked at the current progress of and assumed that
a two phase blockjob is in the _READY state as soon as the progress
reached 100% (info.cur == info.end). In current versions of qemu this
assumption is invalid and qemu exposes a new flag 'ready' in the
query-block-jobs output that is set to true if the job is actually
finished.

This patch adds internal data handling for reading the 'ready' flag and
acting appropriately as long as the flag is present.

While this still doesn't fix the virsh client problem with two phase
block jobs and the --pivot option, it at least improves the error
message:

$ virsh blockcommit  --wait --verbose vm vda  --base vda[1] --active --pivot
Block commit: [100 %]error: failed to pivot job for disk vda
error: internal error: unable to execute QEMU command 'block-job-complete': The active block job for device 'drive-virtio-disk0' cannot be completed

to

$ virsh blockcommit  --wait --verbose VM vda  --base vda[1] --active --pivot
Block commit: [100 %]error: failed to pivot job for disk vda
error: block copy still active: disk 'vda' not ready for pivot yet
src/qemu/qemu_driver.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_json.c