[PATCH 15/15] docs: formatdomain: describe dataFileStore element of disk

Nikolai Barybin via Devel posted 15 patches 1 year, 2 months ago
[PATCH 15/15] docs: formatdomain: describe dataFileStore element of disk
Posted by Nikolai Barybin via Devel 1 year, 2 months ago
Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
---
 docs/formatdomain.rst | 45 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 42 insertions(+), 3 deletions(-)

diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 18b60fe260..54a9e01034 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -2708,24 +2708,38 @@ paravirtualized driver is specified via the ``disk`` element.
        </backingStore>
        <target dev='vdd' bus='virtio'/>
      </disk>
+     <disk type='file' device='disk'>
+       <driver name='qemu' type='qcow2' queues='4' queue_size='256' />
+       <source file='/var/lib/libvirt/images/domain2.qcow'/>
+       <backingStore type='file'>
+         <format type='qcow2'/>
+         <source file='/var/lib/libvirt/images/base-with-data-file.qcow'/>
+         </backingStore>
+         <dataFileStore type='block'>
+           <format type='raw'/>
+           <source dev='/dev/mapper/base2'/>
+         <dataFileStore/>
+       </backingStore>
+       <target dev='vde' bus='virtio'/>
+     </disk>
      <disk type='nvme' device='disk'>
        <driver name='qemu' type='raw'/>
        <source type='pci' managed='yes' namespace='1'>
          <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
        </source>
-       <target dev='vde' bus='virtio'/>
+       <target dev='vdf' bus='virtio'/>
      </disk>
      <disk type='vhostuser' device='disk'>
        <driver name='qemu' type='raw'/>
        <source type='unix' path='/tmp/vhost-blk.sock'>
          <reconnect enabled='yes' timeout='10'/>
        </source>
-       <target dev='vdf' bus='virtio'/>
+       <target dev='vdg' bus='virtio'/>
      </disk>
      <disk type='vhostvdpa' device='disk'>
        <driver name='qemu' type='raw'/>
        <source dev='/dev/vhost-vdpa-0' />
-       <target dev='vdg' bus='virtio'/>
+       <target dev='vdh' bus='virtio'/>
      </disk>
    </devices>
    ...
@@ -3116,6 +3130,27 @@ paravirtualized driver is specified via the ``disk`` element.
    accessible or its disk chain is broken, with startupPolicy 'optional' the
    guest will drop this disk. This feature doesn't support migration currently.
 
+``dataFileStore``
+   This element describes external data file store, which is represented by ``qcow2``
+   incompatible features bit and allows to store guest clusters are the external
+   data file. For such images, clusters in the external data file are not refcounted.
+   The following attribute is supported in ``dataFileStore``:
+
+   ``type``
+      The ``type`` attribute represents the type of disk used by the data file store,
+      see disk type attribute above for more details and possible values.
+
+   Moreover, ``dataFileStore`` supports the following sub-elements:
+
+   ``format``
+      The ``format`` element contains ``type`` attribute which specifies the
+      internal format of the data file store. Only ``raw`` value is supported.
+
+   ``source``
+      This element has the same structure as the ``source`` element in ``disk``.
+      It specifies which file, device, or network location contains the data of
+      the described data file store.
+
 ``backingStore``
    This element describes the backing store used by the disk specified by
    sibling ``source`` element. :since:`Since 1.2.4`. If the hypervisor driver
@@ -3161,6 +3196,10 @@ paravirtualized driver is specified via the ``disk`` element.
    ``backingStore``
       If the backing store is not self-contained, the next element in the chain
       is described by nested ``backingStore`` element.
+   ``dataFileStore``
+      If backing store is in ``qcow2`` format it is allowed to have data file store.
+      But it should me mentioned that an image can have either backing store or data
+      file store, not both.
 
 ``mirror``
    This element is present if the hypervisor has started a long-running block
-- 
2.43.5
Re: [PATCH 15/15] docs: formatdomain: describe dataFileStore element of disk
Posted by Peter Krempa 1 year, 2 months ago
On Wed, Nov 20, 2024 at 18:48:50 +0300, Nikolai Barybin via Devel wrote:
> Signed-off-by: Nikolai Barybin <nikolai.barybin@virtuozzo.com>
> ---
>  docs/formatdomain.rst | 45 ++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 42 insertions(+), 3 deletions(-)

I'll adapt the docs to conform with the changes in naming and placement
of the element as well as squash it into the commit which adds the
schema.

> 
> diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
> index 18b60fe260..54a9e01034 100644
> --- a/docs/formatdomain.rst
> +++ b/docs/formatdomain.rst
> @@ -2708,24 +2708,38 @@ paravirtualized driver is specified via the ``disk`` element.
>         </backingStore>
>         <target dev='vdd' bus='virtio'/>
>       </disk>
> +     <disk type='file' device='disk'>
> +       <driver name='qemu' type='qcow2' queues='4' queue_size='256' />
> +       <source file='/var/lib/libvirt/images/domain2.qcow'/>
> +       <backingStore type='file'>
> +         <format type='qcow2'/>
> +         <source file='/var/lib/libvirt/images/base-with-data-file.qcow'/>
> +         </backingStore>
> +         <dataFileStore type='block'>
> +           <format type='raw'/>
> +           <source dev='/dev/mapper/base2'/>
> +         <dataFileStore/>
> +       </backingStore>
> +       <target dev='vde' bus='virtio'/>
> +     </disk>
>       <disk type='nvme' device='disk'>
>         <driver name='qemu' type='raw'/>
>         <source type='pci' managed='yes' namespace='1'>
>           <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
>         </source>
> -       <target dev='vde' bus='virtio'/>
> +       <target dev='vdf' bus='virtio'/>
>       </disk>
>       <disk type='vhostuser' device='disk'>
>         <driver name='qemu' type='raw'/>
>         <source type='unix' path='/tmp/vhost-blk.sock'>
>           <reconnect enabled='yes' timeout='10'/>
>         </source>
> -       <target dev='vdf' bus='virtio'/>
> +       <target dev='vdg' bus='virtio'/>
>       </disk>
>       <disk type='vhostvdpa' device='disk'>
>         <driver name='qemu' type='raw'/>
>         <source dev='/dev/vhost-vdpa-0' />
> -       <target dev='vdg' bus='virtio'/>
> +       <target dev='vdh' bus='virtio'/>
>       </disk>
>     </devices>
>     ...
> @@ -3116,6 +3130,27 @@ paravirtualized driver is specified via the ``disk`` element.
>     accessible or its disk chain is broken, with startupPolicy 'opt>     guest will drop this disk. This feature doesn't support migration currently.
>  
> +``dataFileStore``
> +   This element describes external data file store, which is represented by ``qcow2``
> +   incompatible features bit and allows to store guest clusters are the external
> +   data file. For such images, clusters in the external data file are not refcounted.
> +   The following attribute is supported in ``dataFileStore``:
> +
> +   ``type``
> +      The ``type`` attribute represents the type of disk used by the data file store,
> +      see disk type attribute above for more details and possible values.
> +
> +   Moreover, ``dataFileStore`` supports the following sub-elements:
> +
> +   ``format``
> +      The ``format`` element contains ``type`` attribute which specifies the
> +      internal format of the data file store. Only ``raw`` value is supported.
> +
> +   ``source``
> +      This element has the same structure as the ``source`` element in ``disk``.
> +      It specifies which file, device, or network location contains the data of
> +      the described data file store.
> +