• E
    snapshot: allow full domain xml in snapshot · f609cb85
    Eric Blake 提交于
    Just like VM saved state images (virsh save), snapshots MUST
    track the inactive domain xml to detect any ABI incompatibilities.
    
    The indentation is not perfect, but functionality comes before form.
    
    Later patches will actually supply a full domain; for now, this
    wires up the storage to support one, but doesn't ever generate one
    in dumpxml output.
    
    Happily, libvirt.c was already rejecting use of VIR_DOMAIN_XML_SECURE
    from read-only connections, even though before this patch, there was
    no information to be secured by the use of that flag.
    
    And while we're at it, mark the libvirt snapshot metadata files
    as internal-use only.
    
    * src/libvirt.c (virDomainSnapshotGetXMLDesc): Document flag.
    * src/conf/domain_conf.h (_virDomainSnapshotDef): Add member.
    (virDomainSnapshotDefParseString, virDomainSnapshotDefFormat):
    Update signature.
    * src/conf/domain_conf.c (virDomainSnapshotDefFree): Clean up.
    (virDomainSnapshotDefParseString): Optionally parse domain.
    (virDomainSnapshotDefFormat): Output full domain.
    * src/esx/esx_driver.c (esxDomainSnapshotCreateXML)
    (esxDomainSnapshotGetXMLDesc): Update callers.
    * src/vbox/vbox_tmpl.c (vboxDomainSnapshotCreateXML)
    (vboxDomainSnapshotGetXMLDesc): Likewise.
    * src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML)
    (qemuDomainSnapshotLoad, qemuDomainSnapshotGetXMLDesc)
    (qemuDomainSnapshotWriteMetadata): Likewise.
    * docs/formatsnapshot.html.in: Rework doc example.
    Based on a patch by Philipp Hahn.
    f609cb85
domain_conf.c 386.1 KB