render / rpms / libvirt

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