On 06/11/2014 10:27 AM, Eric Blake wrote:
A future patch is going to wire up qemu active block commit jobs;
but as they have similar events and are canceled/pivoted in the
same way as block copy jobs, it is easiest to track all bookkeeping
for the commit job by reusing the <mirror> element. This patch
adds domain XML to track which job was responsible for creating a
mirroring situation, and adds a job='copy' attribute to all
existing uses of <mirror>. Along the way, it also massages the
qemu monitor backend to read the new field in order to generate
the correct type of libvirt job (even though it requires a
future patch to actually cause a qemu event that can be reported
as an active commit).
On IRC, Adam Litke pointed out that we have an issue on the event we
generate:
+++ b/src/qemu/qemu_process.c
@@ -1020,26 +1020,30 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
disk = qemuProcessFindDomainDiskByAlias(vm, diskAlias);
if (disk) {
+ if (type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT &&
+ disk->mirrorJob == VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT)
+ type = disk->mirrorJob;
path = virDomainDiskGetSource(disk);
event = virDomainEventBlockJobNewFromObj(vm, path, type, status);
for an original chain 'base <- snap', we are generating the 'ready'
event with a disk name of 'snap', but the 'complete' event with a disk
name of 'base'. Ideally, we WANT to generate both events tied to the
same disk name (even better would be generating the events tied to the
name 'vda' which is unchanging, rather than the disk source name, but I
have to think about whether there are backward-compatibility concerns
before making such a change).
I'll investigate what it will take to get that naming improvement into
the events that we generate.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org