7c6fc39 conf: alter disk mirror xml output

Authored and Committed by ericb 9 years ago
    conf: alter disk mirror xml output
    
    Now that we track a disk mirror as a virStorageSource, we might
    as well update the XML to theoretically allow any type of
    mirroring destination (not just a local file).  A later patch
    will also be reusing <mirror> to track the block commit of the
    top layer of a chain, which is another case where libvirt needs
    to update the backing chain after the job is finally pivoted,
    and since backing chains can have network backing files as the
    destination to commit into, it makes more sense to display that
    in the XML.
    
    This patch changes output-only XML; it was already documented
    that <mirror> does not affect a domain definition at this point
    (because qemu doesn't provide persistent bitmaps yet).  Any
    application that was starting a block copy job with older libvirt
    and then relying on the domain XML to determine if it was
    complete will no longer be able to access the file= and format=
    attributes of mirror that were previously used.  However, this is
    not going to be a problem in practice: the only time a block copy
    job works is on a transient domain, and any app that is managing
    a transient domain probably already does enough of its own
    bookkeeping to know which file it is mirroring into without
    having to re-read it from the libvirt XML.  The one thing that
    was likely to be used in a mirroring job was the ready=
    attribute, which is unchanged.  Meanwhile, I made sure the schema
    and parser still accept the old format, even if we no longer
    output it, so that upgrading from an older version of libvirt is
    seamless.
    
    * docs/schemas/domaincommon.rng (diskMirror): Alter definition.
    * src/conf/domain_conf.c (virDomainDiskDefParseXML): Parse two
    styles of mirror elements.
    (virDomainDiskDefFormat): Output new style.
    * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror-old.xml: New
    file, copied from...
    * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: ...here
    before modernizing.
    * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old*: New
    files.
    * tests/qemuxml2xmltest.c (mymain): Test both styles.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    
        
file modified
+14 -6
file modified
+21 -8
file modified
+53 -16
file modified
+1 -0