libvirt/docs/schemas/domainsnapshot.rng
Eric Blake 6766ff10dd snapshot: track current snapshot across restarts
Audit all changes to the qemu vm->current_snapshot, and make them
update the saved xml file for both the previous and the new
snapshot, so that there is always at most one snapshot with
<active>1</active> in the xml, and that snapshot is used as the
current snapshot even across libvirtd restarts.

This patch does not fix the case of virDomainSnapshotDelete(,CHILDREN)
where one of the children is the current snapshot; that will be later.

* src/conf/domain_conf.h (_virDomainSnapshotDef): Alter member
type and name.
* src/conf/domain_conf.c (virDomainSnapshotDefParseString)
(virDomainSnapshotDefFormat): Update clients.
* docs/schemas/domainsnapshot.rng: Tighten rng.
* src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Reload current
snapshot.
(qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot)
(qemuDomainSnapshotDiscard): Track current snapshot.
2011-08-25 15:11:03 -06:00

57 lines
1.3 KiB
Plaintext

<!-- A Relax NG schema for the libvirt domain snapshot properties XML format -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<ref name='domainsnapshot'/>
</start>
<define name='domainsnapshot'>
<element name='domainsnapshot'>
<interleave>
<optional>
<element name='name'>
<text/>
</element>
</optional>
<optional>
<element name='description'>
<text/>
</element>
</optional>
<optional>
<element name='state'>
<text/>
</element>
</optional>
<optional>
<element name='creationTime'>
<text/>
</element>
</optional>
<optional>
<element name='active'>
<choice>
<value>0</value>
<value>1</value>
</choice>
</element>
</optional>
<optional>
<element name='domain'>
<element name='uuid'>
<text/>
</element>
</element>
</optional>
<optional>
<element name='parent'>
<element name='name'>
<text/>
</element>
</element>
</optional>
</interleave>
</element>
</define>
</grammar>