render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
a41c76
From 2256db09e8b86b58be3c86b1575d64d7a9f5d05c Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <2256db09e8b86b58be3c86b1575d64d7a9f5d05c@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Fri, 28 Feb 2020 10:24:44 +0100
a41c76
Subject: [PATCH] kbase: backing_chains: Clarify some aspects of image probing
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
a41c76
(cherry picked from commit d552b93448e253552c7e53a1240132c9763d2b24)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1798148
a41c76
Message-Id: <b44052c081a18bec62762ab2a7358abd0e914a3a.1582881363.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 docs/kbase/backing_chains.rst | 16 ++++++++++++++--
a41c76
 1 file changed, 14 insertions(+), 2 deletions(-)
a41c76
a41c76
diff --git a/docs/kbase/backing_chains.rst b/docs/kbase/backing_chains.rst
a41c76
index 3b3f0583e5..12ed6253ac 100644
a41c76
--- a/docs/kbase/backing_chains.rst
a41c76
+++ b/docs/kbase/backing_chains.rst
a41c76
@@ -46,14 +46,17 @@ system used on the host so that the hypervisor can access the files and possibly
a41c76
 also directly to configure the hypervisor to use the appropriate images. Thus
a41c76
 it's important to properly setup the formats and paths of the backing images.
a41c76
 
a41c76
+Any externally created image should always use the -F switch of ``qemu-img``
a41c76
+to specify the format of the backing file to avoid probing.
a41c76
+
a41c76
 Image detection caveats
a41c76
 -----------------------
a41c76
 
a41c76
 Detection of the backing chain requires libvirt to read and understand the
a41c76
 ``backing file`` field recorded in the image metadata and also being able to
a41c76
 recurse and read the backing file. Due to security implications libvirt
a41c76
-will not attempt to detect the format of the backing image if the image metadata
a41c76
-doesn't contain it.
a41c76
+will refuse to use backing images of any image whose format was not specified
a41c76
+explicitly in the XML or the overlay image itself.
a41c76
 
a41c76
 Libvirt also might lack support for a network disk storage technology and thus
a41c76
 may be unable to visit and detect backing chains on such storage. This may
a41c76
@@ -104,6 +107,8 @@ Note that it's also possible to partially specify the chain in the XML but omit
a41c76
 the terminating element. This will result into probing from the last specified
a41c76
 ``<backingStore>``
a41c76
 
a41c76
+Any image specified explicitly will not be probed for backing file or format.
a41c76
+
a41c76
 
a41c76
 Manual image creation
a41c76
 =====================
a41c76
@@ -113,6 +118,13 @@ them properly so that they work with libvirt as expected. The created disk
a41c76
 images must contain the format of the backing image in the metadata. This
a41c76
 means that the **-F** parameter of ``qemu-img`` must always be used.
a41c76
 
a41c76
+::
a41c76
+
a41c76
+  qemu-img -f qcow2 -F qcow2 -b /path/to/backing /path/to/overlay
a41c76
+
a41c76
+Note that if '/path/to/backing' is relative the path is considered relative to
a41c76
+the location of '/path/to/overlay'.
a41c76
+
a41c76
 Troubleshooting
a41c76
 ===============
a41c76
 
a41c76
-- 
a41c76
2.25.1
a41c76