- qemu: allow migration of guest with mdev vGPU to VF vGPU (RHEL-68064) - storage_file: Refuse qcow2 images with empty string as 'data_file' (RHEL-73504) - virstoragetest: Add case for qcow2 image with empty string as 'data_file' (RHEL-73504) - qemu: snapshot: delete disk image only if parent snapshot is external (RHEL-74041) - storage_file: de-modularize the local file backend (RHEL-73507) - libvirt.spec: Move ownership of 'storage-file' backends directory to gluster (RHEL-73507) - qemu: re-use existing ActualNetDef for more interface types during update-device (RHEL-7036) - tools: ssh-proxy: Check for domain status before parsing its CID (RHEL-75577) Resolves: RHEL-68064, RHEL-7036, RHEL-73504, RHEL-73507, RHEL-74041 Resolves: RHEL-75577
57 lines
2.3 KiB
Diff
57 lines
2.3 KiB
Diff
From 45c5f48cef27f4233a4964337d33db78ab51740b Mon Sep 17 00:00:00 2001
|
|
Message-ID: <45c5f48cef27f4233a4964337d33db78ab51740b.1737731143.git.jdenemar@redhat.com>
|
|
From: Peter Krempa <pkrempa@redhat.com>
|
|
Date: Thu, 9 Jan 2025 14:53:49 +0100
|
|
Subject: [PATCH] storage_file: Refuse qcow2 images with empty string as
|
|
'data_file'
|
|
|
|
In certain buggy conditions qemu can create an image which has empty
|
|
string stored as 'data_file'. While probing libvirt would consider the
|
|
empty string as a relative file name and construct the path using the
|
|
path of the parent image stripping the last component and appending the
|
|
empty string. This results into attempting to using a directory as an
|
|
image and thus the following error when attempting to start VM with such
|
|
an image:
|
|
|
|
error: unsupported configuration: storage type 'dir' requires use of storage format 'fat'
|
|
|
|
Reject empty strings passed in as 'data_file'.
|
|
|
|
Note that we do not have the same problem with 'backing store' as an
|
|
empty string there is interpreted as no backing file both by qemu and
|
|
libvirt.
|
|
|
|
Resolves: https://issues.redhat.com/browse/RHEL-70627
|
|
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
(cherry picked from commit 87a4fe2906b712d3a6ea3e9c8d9faa98b9ec5632)
|
|
|
|
https://issues.redhat.com/browse/RHEL-73504
|
|
---
|
|
src/storage_file/storage_source.c | 10 ++++++++++
|
|
1 file changed, 10 insertions(+)
|
|
|
|
diff --git a/src/storage_file/storage_source.c b/src/storage_file/storage_source.c
|
|
index 4612e710b0..fa59949cf2 100644
|
|
--- a/src/storage_file/storage_source.c
|
|
+++ b/src/storage_file/storage_source.c
|
|
@@ -557,6 +557,16 @@ virStorageSourceNewFromDataFile(virStorageSource *parent)
|
|
g_autoptr(virStorageSource) dataFile = NULL;
|
|
int rc;
|
|
|
|
+ /* 'qemu-img' records an empty string as 'data_file' field in certain buggy
|
|
+ * cases. Note that it can't happen for 'backing store' as absence of the
|
|
+ * string equals to no backing store. */
|
|
+ if (STREQ(parent->dataFileRaw, "")) {
|
|
+ virReportError(VIR_ERR_OPERATION_FAILED,
|
|
+ _("invalid empty data-file definition in '%1$s'"),
|
|
+ NULLSTR(parent->path));
|
|
+ return NULL;
|
|
+ }
|
|
+
|
|
if ((rc = virStorageSourceNewFromChild(parent,
|
|
parent->dataFileRaw,
|
|
&dataFile)) < 0)
|
|
--
|
|
2.48.1
|