mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 01:34:11 +03:00
5b30b08d66
In order to distinguish disk snapshots from system checkpoints, a new state value that is only valid for snapshots is helpful. * include/libvirt/libvirt.h.in (VIR_DOMAIN_LAST): New placeholder. * src/conf/domain_conf.h (virDomainSnapshotState): New enum mapping. (VIR_DOMAIN_DISK_SNAPSHOT): New internal enum value. * src/conf/domain_conf.c (virDomainState): Use placeholder. (virDomainSnapshotState): Extend mapping by one for use in snapshot. (virDomainSnapshotDefParseString, virDomainSnapshotDefFormat): Handle new state. (virDomainObjSetState, virDomainStateReasonToString) (virDomainStateReasonFromString): Avoid compiler warnings. * tools/virsh.c (vshDomainState, vshDomainStateReasonToString): Likewise. * src/libvirt_private.syms (domain_conf.h): Export new functions. * docs/schemas/domainsnapshot.rng: Tighten state definition. * docs/formatsnapshot.html.in: Document it. * tests/domainsnapshotxml2xmlout/disk_snapshot.xml: New test.
76 lines
1.8 KiB
XML
76 lines
1.8 KiB
XML
<?xml version="1.0"?>
|
|
<!-- 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>
|
|
|
|
<include href='domaincommon.rng'/>
|
|
|
|
<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'>
|
|
<ref name='state'/>
|
|
</element>
|
|
</optional>
|
|
<optional>
|
|
<element name='creationTime'>
|
|
<text/>
|
|
</element>
|
|
</optional>
|
|
<optional>
|
|
<element name='active'>
|
|
<choice>
|
|
<value>0</value>
|
|
<value>1</value>
|
|
</choice>
|
|
</element>
|
|
</optional>
|
|
<optional>
|
|
<choice>
|
|
<element name='domain'>
|
|
<element name='uuid'>
|
|
<ref name="UUID"/>
|
|
</element>
|
|
</element>
|
|
<ref name='domain'/>
|
|
</choice>
|
|
</optional>
|
|
<optional>
|
|
<element name='parent'>
|
|
<element name='name'>
|
|
<text/>
|
|
</element>
|
|
</element>
|
|
</optional>
|
|
</interleave>
|
|
</element>
|
|
</define>
|
|
|
|
<define name='state'>
|
|
<choice>
|
|
<value>nostate</value>
|
|
<value>running</value>
|
|
<value>blocked</value>
|
|
<value>paused</value>
|
|
<value>shutdown</value>
|
|
<value>shutoff</value>
|
|
<value>crashed</value>
|
|
<value>disk-snapshot</value>
|
|
</choice>
|
|
</define>
|
|
|
|
</grammar>
|