]> xenbits.xensource.com Git - libvirt.git/commit
blockcopy: add a way to parse disk source
authorEric Blake <eblake@redhat.com>
Mon, 25 Aug 2014 18:58:49 +0000 (12:58 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 8 Sep 2014 21:50:39 +0000 (15:50 -0600)
commit37588b259677f597254aab83855d00b66a62c53f
tree96e92ea6facc45f9fb0fde0fa072cbe32cf6915b
parentefe5061f5a61d04b1bf21fcac2919a2325f54150
blockcopy: add a way to parse disk source

The new blockcopy API wants to reuse only a subset of the disk
hotplug parser - namely, we only care about the embedded
virStorageSourcePtr inside a <disk> XML.  Strange as it may
seem, it was easier to just parse an entire disk definition,
then throw away everything but the embedded source, than it
was to disentangle the source parsing code from the rest of
the overall disk parsing function.  All that I needed was a
couple of tweaks and a new internal flag that determines
whether the normally-mandatory target element can be
gracefully skipped, since everything else was already optional.

* src/conf/domain_conf.h (virDomainDiskSourceParse): New
prototype.
* src/conf/domain_conf.c (VIR_DOMAIN_XML_INTERNAL_DISK_SOURCE):
New flag.
(virDomainDiskDefParseXML): Honor flag to make target optional.
(virDomainDiskSourceParse): New function.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms