libvirt/docs/schemas/domainbackup.rng
Peter Krempa 7e5b993d3b backup: Allow configuring incremental backup per-disk individually
The semantics of the backup operation don't strictly require that all
disks being backed up are part of the same incremental part (when a disk
was checkpointed/backed up separately or in a different VM), or even
they may not have a previous checkpoint at all (e.g. when the disk
was freshly hotplugged to the vm).

In such cases we can still create a common checkpoint for all of them
and backup differences according to configuration.

This patch adds a per-disk configuration of the checkpoint to do the
incremental backup from via the 'incremental' attribute and allows
perform full backups via the 'backupmode' attribute.

Note that no changes to the qemu driver are necessary to take advantage
of this as we already obey the per-disk 'incremental' field.

https://bugzilla.redhat.com/show_bug.cgi?id=1829829

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2020-07-08 08:40:30 +02:00

301 lines
8.7 KiB
XML

<?xml version="1.0"?>
<!-- A Relax NG schema for the libvirt domain backup properties XML format -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<ref name='domainbackup'/>
</start>
<include href='domaincommon.rng'/>
<define name='backupEncryption'>
<element name='encryption'>
<attribute name='format'>
<choice>
<value>luks</value>
</choice>
</attribute>
<interleave>
<ref name='secret'/>
<optional>
<element name='cipher'>
<ref name='keycipher'/>
</element>
<element name='ivgen'>
<ref name='keyivgen'/>
</element>
</optional>
</interleave>
</element>
</define>
<define name='domainbackup'>
<element name='domainbackup'>
<interleave>
<optional>
<element name='incremental'>
<text/>
</element>
</optional>
<choice>
<group>
<optional>
<attribute name='mode'>
<value>push</value>
</attribute>
</optional>
<ref name='backupDisksPush'/>
</group>
<group>
<attribute name='mode'>
<value>pull</value>
</attribute>
<interleave>
<element name='server'>
<optional>
<attribute name='tls'>
<choice>
<value>yes</value>
<value>no</value>
</choice>
</attribute>
</optional>
<choice>
<group>
<optional>
<attribute name='transport'>
<value>tcp</value>
</attribute>
</optional>
<attribute name='name'>
<choice>
<ref name='dnsName'/>
<ref name='ipAddr'/>
</choice>
</attribute>
<optional>
<attribute name='port'>
<ref name='unsignedInt'/>
</attribute>
</optional>
</group>
<group>
<attribute name='transport'>
<value>unix</value>
</attribute>
<attribute name='socket'>
<ref name='absFilePath'/>
</attribute>
</group>
</choice>
</element>
<ref name='backupDisksPull'/>
</interleave>
</group>
</choice>
</interleave>
</element>
</define>
<define name='backupDiskMode'>
<optional>
<choice>
<attribute name='backupmode'>
<value>full</value>
</attribute>
<group>
<optional>
<attribute name='backupmode'>
<value>incremental</value>
</attribute>
</optional>
<optional>
<attribute name='incremental'/>
</optional>
</group>
</choice>
</optional>
</define>
<define name='backupPushDriver'>
<optional>
<element name='driver'>
<attribute name='type'>
<ref name='storageFormat'/>
</attribute>
</element>
</optional>
</define>
<define name='backupPullDriver'>
<optional>
<element name='driver'>
<attribute name='type'>
<value>qcow2</value>
</attribute>
</element>
</optional>
</define>
<define name='backupAttr'>
<optional>
<attribute name='backup'>
<choice>
<value>yes</value>
</choice>
</attribute>
</optional>
</define>
<define name='backupDisksPush'>
<optional>
<element name='disks'>
<oneOrMore>
<element name='disk'>
<attribute name='name'>
<ref name='diskTarget'/>
</attribute>
<ref name='backupDiskMode'/>
<choice>
<group>
<attribute name='backup'>
<value>no</value>
</attribute>
</group>
<group>
<ref name='backupAttr'/>
<attribute name='type'>
<value>file</value>
</attribute>
<interleave>
<optional>
<element name='target'>
<attribute name='file'>
<ref name='absFilePath'/>
</attribute>
<interleave>
<zeroOrMore>
<ref name='devSeclabel'/>
</zeroOrMore>
<optional>
<ref name='backupEncryption'/>
</optional>
</interleave>
</element>
</optional>
<ref name='backupPushDriver'/>
</interleave>
</group>
<group>
<ref name='backupAttr'/>
<attribute name='type'>
<value>block</value>
</attribute>
<interleave>
<optional>
<element name='target'>
<attribute name='dev'>
<ref name='absFilePath'/>
</attribute>
<interleave>
<zeroOrMore>
<ref name='devSeclabel'/>
</zeroOrMore>
<optional>
<ref name='backupEncryption'/>
</optional>
</interleave>
</element>
</optional>
<ref name='backupPushDriver'/>
</interleave>
</group>
</choice>
</element>
</oneOrMore>
</element>
</optional>
</define>
<define name='backupDisksPull'>
<optional>
<element name='disks'>
<oneOrMore>
<element name='disk'>
<attribute name='name'>
<ref name='diskTarget'/>
</attribute>
<ref name='backupDiskMode'/>
<optional>
<attribute name='exportname'>
<text/>
</attribute>
</optional>
<optional>
<attribute name='exportbitmap'>
<text/>
</attribute>
</optional>
<choice>
<group>
<attribute name='backup'>
<value>no</value>
</attribute>
</group>
<group>
<optional>
<ref name='backupAttr'/>
<attribute name='type'>
<value>file</value>
</attribute>
</optional>
<optional>
<interleave>
<element name='scratch'>
<attribute name='file'>
<ref name='absFilePath'/>
</attribute>
<interleave>
<zeroOrMore>
<ref name='devSeclabel'/>
</zeroOrMore>
<optional>
<ref name='backupEncryption'/>
</optional>
</interleave>
</element>
<ref name='backupPullDriver'/>
</interleave>
</optional>
</group>
<group>
<ref name='backupAttr'/>
<attribute name='type'>
<value>block</value>
</attribute>
<interleave>
<element name='scratch'>
<attribute name='dev'>
<ref name='absFilePath'/>
</attribute>
<interleave>
<zeroOrMore>
<ref name='devSeclabel'/>
</zeroOrMore>
<optional>
<ref name='backupEncryption'/>
</optional>
</interleave>
</element>
<ref name='backupPullDriver'/>
</interleave>
</group>
</choice>
</element>
</oneOrMore>
</element>
</optional>
</define>
</grammar>