]> xenbits.xensource.com Git - libvirt.git/commit
blockcommit: track job type in xml
authorEric Blake <eblake@redhat.com>
Tue, 29 Jul 2014 03:46:44 +0000 (21:46 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 30 Jul 2014 12:32:38 +0000 (06:32 -0600)
commit232a31bea3bfde7118bbb0c6594949b62b9bd2a0
tree072c72d097e4458952ae88e14b2fa719dc201b38
parent251d75a86324b8de09a88c9289229ca88cf58892
blockcommit: track job type in xml

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).  It also prepares to update persistent XML
to match changes made to live XML when a copy completes.

* docs/schemas/domaincommon.rng: Enhance schema.
* docs/formatdomain.html.in: Document it.
* src/conf/domain_conf.h (_virDomainDiskDef): Add a field.
* src/conf/domain_conf.c (virDomainBlockJobType): String conversion.
(virDomainDiskDefParseXML): Parse job type.
(virDomainDiskDefFormat): Output job type.
* src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Distinguish
active from regular commit.
* src/qemu/qemu_driver.c (qemuDomainBlockCopy): Set job type.
(qemuDomainBlockPivot, qemuDomainBlockJobImpl): Clean up job type
on completion.
* tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml:
Update tests.
* tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-disk-active-commit.xml: New
file.
* tests/qemuxml2xmltest.c (mymain): Drive new test.

Signed-off-by: Eric Blake <eblake@redhat.com>
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
src/conf/domain_conf.h
src/qemu/qemu_driver.c
src/qemu/qemu_process.c
tests/qemuxml2argvdata/qemuxml2argv-disk-active-commit.xml [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml
tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml
tests/qemuxml2xmltest.c