]> git.ipfire.org Git - thirdparty/libvirt.git/commit
snapshot: add <disks> to snapshot xml
authorEric Blake <eblake@redhat.com>
Thu, 18 Aug 2011 23:33:36 +0000 (17:33 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 5 Sep 2011 13:03:04 +0000 (07:03 -0600)
commitd6f6b2d194c5771600e08400e8849e2b96f9ecc9
tree2198d3f3491feb9856910eeb560dfc6cc5fb2257
parent5b30b08d665af2869a94cf34c032d6a42da4578f
snapshot: add <disks> to snapshot xml

Adds an optional element to <domainsnapshot>, which will be used
to give user control over external snapshot filenames on input,
and specify generated filenames on output.

For now, no driver accepts this element; that will come later.

<domainsnapshot>
  ...
  <disks>
    <disk name='vda' snapshot='no'/>
    <disk name='vdb' snapshot='internal'/>
    <disk name='vdc' snapshot='external'>
      <driver type='qcow2'/>
      <source file='/path/to/new'/>
    </disk>
  </disks>
  <domain>
    ...
    <devices>
      <disk ...>
        <driver name='qemu' type='raw'/>
        <target dev='vdc'/>
        <source file='/path/to/old'/>
      </disk>
    </devices>
  </domain>
</domainsnapshot>

* src/conf/domain_conf.h (_virDomainSnapshotDiskDef): New type.
(_virDomainSnapshotDef): Add new elements.
(virDomainSnapshotAlignDisks): New prototype.
* src/conf/domain_conf.c (virDomainSnapshotDiskDefClear)
(virDomainSnapshotDiskDefParseXML, disksorter)
(virDomainSnapshotAlignDisks): New functions.
(virDomainSnapshotDefParseString): Parse new fields.
(virDomainSnapshotDefFree): Clean them up.
(virDomainSnapshotDefFormat): Output them.
* src/libvirt_private.syms (domain_conf.h): Export new function.
* docs/schemas/domainsnapshot.rng (domainsnapshot, disksnapshot):
Add more xml.
* docs/formatsnapshot.html.in: Document it.
* tests/domainsnapshotxml2xmlin/disk_snapshot.xml: New test.
* tests/domainsnapshotxml2xmlout/disk_snapshot.xml: Update.
docs/formatsnapshot.html.in
docs/schemas/domainsnapshot.rng
src/conf/domain_conf.c
src/conf/domain_conf.h
src/libvirt_private.syms
tests/domainsnapshotxml2xmlin/disk_snapshot.xml [new file with mode: 0644]
tests/domainsnapshotxml2xmlout/disk_snapshot.xml