mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-09 15:00:07 +00:00
d85842cfd7
Prepare for new checkpoint APIs by describing the XML that will represent a checkpoint. The checkpoint XML is modeled heavily after virDomainSnapshotPtr. See the docs for more details. Add testsuite coverage for some minimal uses of the XML (bare minimum, the sample from html, and a full dumpxml, and some counter-examples that should fail schema validation). Although use of the REDEFINE flag will require the <domain> subelement to be present, it is easier for most of the tests to provide counterpart output produced with the NO_DOMAIN flag (particularly since synthesizing a valid <domain> during testing is not trivial). Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
95 lines
2.5 KiB
XML
95 lines
2.5 KiB
XML
<?xml version='1.0'?>
|
|
<!-- A Relax NG schema for the libvirt domain checkpoint properties XML format -->
|
|
<grammar xmlns='http://relaxng.org/ns/structure/1.0' datatypeLibrary='http://www.w3.org/2001/XMLSchema-datatypes'>
|
|
<start>
|
|
<ref name='domaincheckpoint'/>
|
|
</start>
|
|
|
|
<include href='domaincommon.rng'/>
|
|
|
|
<define name='domaincheckpoint'>
|
|
<element name='domaincheckpoint'>
|
|
<interleave>
|
|
<optional>
|
|
<element name='name'>
|
|
<ref name='checkpointName'/>
|
|
</element>
|
|
</optional>
|
|
<optional>
|
|
<element name='description'>
|
|
<text/>
|
|
</element>
|
|
</optional>
|
|
<optional>
|
|
<element name='creationTime'>
|
|
<ref name='unsignedLong'/>
|
|
</element>
|
|
</optional>
|
|
<optional>
|
|
<element name='disks'>
|
|
<oneOrMore>
|
|
<ref name='diskcheckpoint'/>
|
|
</oneOrMore>
|
|
</element>
|
|
</optional>
|
|
<optional>
|
|
<!-- Nested grammar ensures that any of our overrides of
|
|
storagecommon/domaincommon defines do not conflict
|
|
with any domain.rng overrides. -->
|
|
<grammar>
|
|
<include href='domain.rng'/>
|
|
</grammar>
|
|
</optional>
|
|
<optional>
|
|
<element name='parent'>
|
|
<element name='name'>
|
|
<ref name='checkpointName'/>
|
|
</element>
|
|
</element>
|
|
</optional>
|
|
</interleave>
|
|
</element>
|
|
</define>
|
|
|
|
<define name='diskcheckpoint'>
|
|
<element name='disk'>
|
|
<attribute name='name'>
|
|
<choice>
|
|
<ref name='diskTarget'/>
|
|
<ref name='absFilePath'/>
|
|
</choice>
|
|
</attribute>
|
|
<choice>
|
|
<attribute name='checkpoint'>
|
|
<value>no</value>
|
|
</attribute>
|
|
<group>
|
|
<optional>
|
|
<attribute name='checkpoint'>
|
|
<value>bitmap</value>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name='bitmap'>
|
|
<text/>
|
|
</attribute>
|
|
</optional>
|
|
<optional>
|
|
<attribute name='size'>
|
|
<ref name='unsignedLong'/>
|
|
</attribute>
|
|
</optional>
|
|
</group>
|
|
</choice>
|
|
</element>
|
|
</define>
|
|
|
|
<define name='checkpointName'>
|
|
<data type='string'>
|
|
<!-- Notably: no leading '.' and no embedded '/' or newline -->
|
|
<param name='pattern'>[a-zA-Z0-9_\-][a-zA-Z0-9_\-.]*</param>
|
|
</data>
|
|
</define>
|
|
|
|
</grammar>
|