libvirt/docs/schemas/storagevol.rng
Pavel Hrdina 3e1d2c93a3 storage: add support for QCOW2 cluster_size option
The default value hard-coded in QEMU (64KiB) is not always the ideal.
Having a possibility to set the cluster_size by user may in specific
use-cases improve performance for QCOW2 images.

QEMU internally has some limits, the value has to be between 512B and
2048KiB and must by power of two, except when the image has Extended L2
Entries the minimal value has to be 16KiB.

Since qemu-img ensures the value is correct and the limit is not always
the same libvirt will not duplicate any of these checks as the error
message from qemu-img is good enough:

    Cluster size must be a power of two between 512 and 2048k

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/154

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-05-21 14:00:43 +02:00

239 lines
5.4 KiB
XML

<?xml version="1.0"?>
<!-- A Relax NG schema for the libvirt storage volume XML format -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<include href="basictypes.rng"/>
<start>
<ref name="vol"/>
</start>
<include href="storagecommon.rng"/>
<define name="vol">
<element name="volume">
<optional>
<attribute name="type">
<choice>
<value>file</value>
<value>block</value>
<value>dir</value>
<value>network</value>
<value>netdir</value>
</choice>
</attribute>
</optional>
<interleave>
<element name="name">
<ref name="volName"/>
</element>
<optional>
<element name="key">
<text/>
</element>
</optional>
<optional>
<ref name="source"/>
</optional>
<ref name="sizing"/>
<ref name="target"/>
<optional>
<ref name="backingStore"/>
</optional>
</interleave>
</element>
</define>
<define name="sizing">
<interleave>
<optional>
<element name="capacity">
<ref name="scaledInteger"/>
</element>
</optional>
<optional>
<element name="allocation">
<ref name="scaledInteger"/>
</element>
</optional>
<optional>
<element name="physical">
<ref name="scaledInteger"/>
</element>
</optional>
</interleave>
</define>
<define name="timestamps">
<optional>
<element name="timestamps">
<interleave>
<optional>
<element name="atime">
<ref name="timestamp"/>
</element>
</optional>
<optional>
<element name="btime">
<ref name="timestamp"/>
</element>
</optional>
<optional>
<element name="ctime">
<ref name="timestamp"/>
</element>
</optional>
<optional>
<element name="mtime">
<ref name="timestamp"/>
</element>
</optional>
</interleave>
</element>
</optional>
</define>
<define name="timestamp">
<data type="string">
<param name="pattern">[0-9]+(\.[0-9]{0,9})?</param>
</data>
</define>
<define name="target">
<element name="target">
<interleave>
<optional>
<element name="path">
<choice>
<data type="anyURI"/>
<ref name="absFilePath"/>
</choice>
</element>
</optional>
<ref name="format"/>
<ref name="permissions"/>
<ref name="timestamps"/>
<optional>
<ref name="encryption"/>
</optional>
<optional>
<ref name="compat"/>
</optional>
<optional>
<element name="nocow">
<empty/>
</element>
</optional>
<optional>
<ref name="clusterSize"/>
</optional>
<optional>
<ref name="fileFormatFeatures"/>
</optional>
</interleave>
</element>
</define>
<define name="backingStore">
<element name="backingStore">
<interleave>
<element name="path">
<ref name="absFilePath"/>
</element>
<ref name="format"/>
<ref name="permissions"/>
<ref name="timestamps"/>
</interleave>
</element>
</define>
<define name="source">
<element name="source">
<zeroOrMore>
<ref name="sourcedev"/>
</zeroOrMore>
</element>
</define>
<define name="sourcedev">
<element name="device">
<attribute name="path">
<ref name="absFilePath"/>
</attribute>
<choice>
<empty/>
<ref name="devextents"/>
</choice>
</element>
</define>
<define name="devextents">
<oneOrMore>
<element name="extent">
<attribute name="start">
<ref name="unsignedLong"/>
</attribute>
<attribute name="end">
<ref name="unsignedLong"/>
</attribute>
</element>
</oneOrMore>
</define>
<define name="formatdev">
<choice>
<value>none</value>
<value>auto</value>
<value>ext2</value>
<value>ext3</value>
<value>ext4</value>
<value>ufs</value>
<value>iso9660</value>
<value>udf</value>
<value>gfs</value>
<value>gfs2</value>
<value>vfat</value>
<value>hfs+</value>
<value>xfs</value>
<value>ocfs2</value>
<value>vmfs</value>
</choice>
</define>
<define name="formatfile">
<choice>
<value>unknown</value>
<ref name="storageFormat"/>
</choice>
</define>
<define name="formatdisk">
<choice>
<value>none</value>
<value>linux</value>
<value>fat16</value>
<value>fat32</value>
<value>linux-swap</value>
<value>linux-lvm</value>
<value>linux-raid</value>
<value>extended</value>
</choice>
</define>
<define name="format">
<optional>
<element name="format">
<attribute name="type">
<choice>
<ref name="formatfile"/>
<ref name="formatdev"/>
<ref name="formatdisk"/>
</choice>
</attribute>
</element>
</optional>
</define>
</grammar>