37588b2 blockcopy: add a way to parse disk source

Authored and Committed by ericb 9 years ago
    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>
    
        
file modified
+77 -30
file modified
+4 -0
file modified
+1 -0