[libvirt] [PATCH v3 4/5] blockcommit: track job type in xml

Eric Blake eblake at redhat.com
Thu Jun 12 15:40:17 UTC 2014


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140612/1964fcc2/attachment-0001.sig>


More information about the libvir-list mailing list