[PATCH 1/2] qemu: block: Use correct format name when formatting overlay of qcow2+luks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A logic bug in the code creating overlays on existing images resulted
into wrongly using "luks" instead of "qcow2" for the backing format if
the backing image is an luks-encrypted qcow2. The special format munging
is needed only for raw luks images.

In practice the impact is not as critical as to use encrypted images in
the backing chain the user must fully describe the backing chain
including backing images to provide encryption keys, which overrides the
metadata recorded in the qcow2 header.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_block.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index e09c7e66c8..0bc92f6a23 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -2264,7 +2264,8 @@ qemuBlockStorageSourceCreateAddBacking(virStorageSource *backing,
         return 0;

     if (format) {
-        if (backing->encryption &&
+        if (backing->format == VIR_STORAGE_FILE_RAW &&
+            backing->encryption &&
             backing->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS)
             backingFormatStr = "luks";
         else
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux