libvirt-10.10.0-5.el9
- 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
This commit is contained in:
parent
806516057f
commit
c2bfdf96a6
@ -0,0 +1,76 @@
|
|||||||
|
From 1a54514bba90d0541efaf3e905ab30205c6014bd Mon Sep 17 00:00:00 2001
|
||||||
|
Message-ID: <1a54514bba90d0541efaf3e905ab30205c6014bd.1737731143.git.jdenemar@redhat.com>
|
||||||
|
From: Laine Stump <laine@redhat.com>
|
||||||
|
Date: Fri, 13 Dec 2024 12:47:39 -0500
|
||||||
|
Subject: [PATCH] qemu: allow migration of guest with mdev vGPU to VF vGPU
|
||||||
|
|
||||||
|
GPU vendors are moving away from using mdev to create virtual GPUs
|
||||||
|
towards using SRIOV VFs that are vGPUs. In both cases, once created
|
||||||
|
the vGPUs are assigned to guests via <hostdev> (i.e. VFIO device
|
||||||
|
assignment), and inside the guest the devices look identical, but mdev
|
||||||
|
vGPUs are located by QEMU/VFIO using a uuid, while VF vGPUs are
|
||||||
|
located with a PCI address. So although we generally require the
|
||||||
|
device on the source host to exactly match the device on the
|
||||||
|
destination host, in the case of mdev-created vGPU vs. VF vGPU
|
||||||
|
migration *can* potentially work, except that libvirt has a hard-coded
|
||||||
|
check that prevents us from even trying.
|
||||||
|
|
||||||
|
This patch loosens up that check so that we will allow attempts to
|
||||||
|
migrate a guest from a source host that has mdev-created vGPUs to a
|
||||||
|
destination host that has VF vGPUs (and vice versa). The expectation
|
||||||
|
is that if this doesn't actually work then QEMU will fail and generate
|
||||||
|
an error that we can report.
|
||||||
|
|
||||||
|
Signed-off-by: Laine Stump <laine@redhat.com>
|
||||||
|
Tested-by: Zhiyi Guo <zhguo@redhat.com>
|
||||||
|
Reviewed-by: Zhiyi Guo <zhguo@redhat.com>
|
||||||
|
(cherry picked from commit dd82e2baa84eed485fa0554eafd2bdc06a094081)
|
||||||
|
|
||||||
|
https://issues.redhat.com/browse/RHEL-68064
|
||||||
|
|
||||||
|
Signed-off-by: Laine Stump <laine@redhat.com>
|
||||||
|
---
|
||||||
|
src/conf/domain_conf.c | 28 +++++++++++++++++++++-------
|
||||||
|
1 file changed, 21 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||||
|
index 1f0b67ca28..d3f30b08dc 100644
|
||||||
|
--- a/src/conf/domain_conf.c
|
||||||
|
+++ b/src/conf/domain_conf.c
|
||||||
|
@@ -20671,13 +20671,27 @@ virDomainHostdevDefCheckABIStability(virDomainHostdevDef *src,
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (src->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
|
||||||
|
- src->source.subsys.type != dst->source.subsys.type) {
|
||||||
|
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
- _("Target host device subsystem %1$s does not match source %2$s"),
|
||||||
|
- virDomainHostdevSubsysTypeToString(dst->source.subsys.type),
|
||||||
|
- virDomainHostdevSubsysTypeToString(src->source.subsys.type));
|
||||||
|
- return false;
|
||||||
|
+ if (src->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
||||||
|
+ virDomainHostdevSubsysType srcType = src->source.subsys.type;
|
||||||
|
+ virDomainHostdevSubsysType dstType = dst->source.subsys.type;
|
||||||
|
+
|
||||||
|
+ /* If the source and destination subsys types aren't the same,
|
||||||
|
+ * then migration can't be supported, *except* that it might
|
||||||
|
+ * be supported to migrate from subsys type 'pci' to 'mdev'
|
||||||
|
+ * and vice versa. (libvirt can't know for certain whether or
|
||||||
|
+ * not it will actually work, so we have to just allow it and
|
||||||
|
+ * count on QEMU to provide us with an error if it fails)
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+ if (srcType != dstType
|
||||||
|
+ && ((srcType != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI && srcType != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV)
|
||||||
|
+ || (dstType != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI && dstType != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV))) {
|
||||||
|
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
+ _("Target host device subsystem type %1$s is not compatible with source subsystem type %2$s"),
|
||||||
|
+ virDomainHostdevSubsysTypeToString(dstType),
|
||||||
|
+ virDomainHostdevSubsysTypeToString(srcType));
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!virDomainDeviceInfoCheckABIStability(src->info, dst->info))
|
||||||
|
--
|
||||||
|
2.48.1
|
@ -0,0 +1,106 @@
|
|||||||
|
From ace165fe4fa45ceb7e26cfd7f2fafead7cfeb503 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-ID: <ace165fe4fa45ceb7e26cfd7f2fafead7cfeb503.1737731143.git.jdenemar@redhat.com>
|
||||||
|
From: Laine Stump <laine@redhat.com>
|
||||||
|
Date: Mon, 25 Nov 2024 22:51:04 -0500
|
||||||
|
Subject: [PATCH] qemu: re-use existing ActualNetDef for more interface types
|
||||||
|
during update-device
|
||||||
|
|
||||||
|
For the full history behind this patch, look at the following:
|
||||||
|
|
||||||
|
https://issues.redhat.com/browse/RHEL-7036
|
||||||
|
commit v10.7.0-101-ga37bd2a15b
|
||||||
|
commit v10.8.0-rc2-8-gbcd5ae4e73
|
||||||
|
|
||||||
|
Summary: original problem was unexpected failure of update-device when
|
||||||
|
the user hadn't changed anything other than online status of the guest
|
||||||
|
NIC (which should always be allowed).
|
||||||
|
|
||||||
|
The first commit "fixed" this by avoiding the allocation of a new
|
||||||
|
ActualNetDef (i.e. creating a new networkport) for *all* network
|
||||||
|
device updates (because that was inappropriately changing which
|
||||||
|
ethernet physdev should be used for a macvtap connection, which by
|
||||||
|
design can't be handled in an update-device).
|
||||||
|
|
||||||
|
But this commit caused a regression for update-device of bridge-based
|
||||||
|
network devices (because some the updates of certain attributes *do*
|
||||||
|
require the ActualNetDef be re-allocated), so...
|
||||||
|
|
||||||
|
The 2nd commit narrowed the list of network types that get the "don't
|
||||||
|
allocate new ActualNetDef" treatment (so that only interfaces
|
||||||
|
connected to a network that uses a pool of ethernet VFs *being used in
|
||||||
|
passthrough mode* qualify).
|
||||||
|
|
||||||
|
But then it was pointed out that this re-broke simple updates of
|
||||||
|
devices that used a direct/macvtap network in "bridge" mode (because
|
||||||
|
it's possible to list multiple physdevs to use for bridge mode, in
|
||||||
|
which case the network driver attempts to "load balance" (and so a new
|
||||||
|
allocation might have a different ethernet physdev which, again, can't
|
||||||
|
be supported in a device-update).
|
||||||
|
|
||||||
|
So this (single line of code) patch *widens* the list of network types
|
||||||
|
that don't allocate a new ActualNetDef to also include the other
|
||||||
|
direct (macvtap) modes, e.g. bridge, private, etc.
|
||||||
|
|
||||||
|
Signed-off-by: Laine Stump <laine@redhat.com>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
(cherry picked from commit 4e987a86b5e4c9faf36aa5abad47fe6db6314950)
|
||||||
|
|
||||||
|
https://issues.redhat.com/browse/RHEL-7036
|
||||||
|
|
||||||
|
Signed-off-by: Laine Stump <laine@redhat.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_hotplug.c | 36 ++++++++++++++++++++----------------
|
||||||
|
1 file changed, 20 insertions(+), 16 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
||||||
|
index 3c18af6b0c..de0777d330 100644
|
||||||
|
--- a/src/qemu/qemu_hotplug.c
|
||||||
|
+++ b/src/qemu/qemu_hotplug.c
|
||||||
|
@@ -3935,25 +3935,29 @@ qemuDomainChangeNet(virQEMUDriver *driver,
|
||||||
|
if (newdev->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
|
||||||
|
if (olddev->type == VIR_DOMAIN_NET_TYPE_NETWORK &&
|
||||||
|
oldType == VIR_DOMAIN_NET_TYPE_DIRECT &&
|
||||||
|
- virDomainNetGetActualDirectMode(olddev) == VIR_NETDEV_MACVLAN_MODE_PASSTHRU &&
|
||||||
|
STREQ(olddev->data.network.name, newdev->data.network.name)) {
|
||||||
|
/* old and new are type='network', and the network name
|
||||||
|
- * hasn't changed *and* this is a network where each
|
||||||
|
- * connection is allocated exclusive use of a VF
|
||||||
|
- * device. In this case we *don't* want to get a new port
|
||||||
|
- * ("actual device") from the network because attempting
|
||||||
|
- * to allocate a new device would also allocate a
|
||||||
|
- * new/different VF, causing the update to fail. And
|
||||||
|
- * anyway we can use olddev's actualNetDef (since it
|
||||||
|
- * hasn't changed).
|
||||||
|
+ * hasn't changed *and* this is a "direct" network (a pool
|
||||||
|
+ * of 1 or more host ethernet devices where each guest
|
||||||
|
+ * interface is allocated one of those physical devices
|
||||||
|
+ * that it then connects to via macvtap). In this case we
|
||||||
|
+ * *don't* want to get a new port ("actual device") from
|
||||||
|
+ * the network because attempting to allocate a new port
|
||||||
|
+ * would also allocate a new/different ethernet (physical
|
||||||
|
+ * device), causing the update to fail (because the
|
||||||
|
+ * physical device of a macvtap-based interface can't be
|
||||||
|
+ * changed without completely unplugging and re-plugging
|
||||||
|
+ * the guest NIC).
|
||||||
|
*
|
||||||
|
- * So instead we just duplicate *the pointer to* the
|
||||||
|
- * actualNetDef from olddev to newdev so that comparisons
|
||||||
|
- * of actualNetDef will show no change. If the update is
|
||||||
|
- * successful, we will clear the actualNetDef pointer from
|
||||||
|
- * olddev before destroying it (or if the update fails,
|
||||||
|
- * then we need to clear the pointer from newdev before
|
||||||
|
- * destroying it)
|
||||||
|
+ * We can work around this issue by just re-using olddev's
|
||||||
|
+ * actualNetDef (since it hasn't changed) rather than
|
||||||
|
+ * allocating a new one. We just duplicate *the pointer
|
||||||
|
+ * to* the actualNetDef from olddev to newdev so that
|
||||||
|
+ * comparisons of actualNetDef will show no change. If the
|
||||||
|
+ * update is successful, we will clear the actualNetDef
|
||||||
|
+ * pointer from olddev before destroying it (or if the
|
||||||
|
+ * update fails, then we need to clear the pointer from
|
||||||
|
+ * newdev before destroying it)
|
||||||
|
*/
|
||||||
|
newdev->data.network.actual = olddev->data.network.actual;
|
||||||
|
memcpy(newdev->data.network.portid, olddev->data.network.portid,
|
||||||
|
--
|
||||||
|
2.48.1
|
@ -0,0 +1,71 @@
|
|||||||
|
From b617eb7d706e30ffd241d86898cb02d42ab8e817 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-ID: <b617eb7d706e30ffd241d86898cb02d42ab8e817.1737731143.git.jdenemar@redhat.com>
|
||||||
|
From: Pavel Hrdina <phrdina@redhat.com>
|
||||||
|
Date: Thu, 9 Jan 2025 16:23:44 +0100
|
||||||
|
Subject: [PATCH] qemu: snapshot: delete disk image only if parent snapshot is
|
||||||
|
external
|
||||||
|
|
||||||
|
When we are deleting external snapshot that is not active we only need
|
||||||
|
to delete overlay disk image of the parent snapshot. This works
|
||||||
|
correctly even if parent snapshot is external and active as it will have
|
||||||
|
another overlay created when user reverted to that snapshot.
|
||||||
|
|
||||||
|
In case the parent snapshot is internal there are no overlay disk images
|
||||||
|
created as everything is stored internally within the disk image. In
|
||||||
|
this case we would delete the actual disk image storing internal
|
||||||
|
snapshots and most likely the original disk image as well resulting in
|
||||||
|
data loss once the VM is shutoff.
|
||||||
|
|
||||||
|
Fixes: https://gitlab.com/libvirt/libvirt/-/issues/734
|
||||||
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||||
|
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
(cherry picked from commit d51179fa82448f4720f1645f0b7100df80508cc4)
|
||||||
|
|
||||||
|
https://issues.redhat.com/browse/RHEL-74041
|
||||||
|
|
||||||
|
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||||
|
---
|
||||||
|
src/qemu/qemu_snapshot.c | 14 ++++++++------
|
||||||
|
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
|
||||||
|
index 18b2e478f6..80cd54bf33 100644
|
||||||
|
--- a/src/qemu/qemu_snapshot.c
|
||||||
|
+++ b/src/qemu/qemu_snapshot.c
|
||||||
|
@@ -3144,6 +3144,8 @@ qemuSnapshotDeleteExternalPrepareData(virDomainObj *vm,
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ data->parentSnap = qemuSnapshotFindParentSnapForDisk(snap, data->snapDisk);
|
||||||
|
+
|
||||||
|
if (data->merge) {
|
||||||
|
virStorageSource *snapDiskSrc = NULL;
|
||||||
|
|
||||||
|
@@ -3185,8 +3187,6 @@ qemuSnapshotDeleteExternalPrepareData(virDomainObj *vm,
|
||||||
|
qemuSnapshotGetDisksWithBackingStore(vm, snap, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
- data->parentSnap = qemuSnapshotFindParentSnapForDisk(snap, data->snapDisk);
|
||||||
|
-
|
||||||
|
if (data->parentSnap && !virDomainSnapshotIsExternal(data->parentSnap)) {
|
||||||
|
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||||
|
_("deleting external snapshot that has internal snapshot as parent not supported"));
|
||||||
|
@@ -3642,10 +3642,12 @@ qemuSnapshotDiscardExternal(virDomainObj *vm,
|
||||||
|
if (!data->job)
|
||||||
|
goto error;
|
||||||
|
} else {
|
||||||
|
- if (virStorageSourceInit(data->parentDomDisk->src) < 0 ||
|
||||||
|
- virStorageSourceUnlink(data->parentDomDisk->src) < 0) {
|
||||||
|
- VIR_WARN("Failed to remove snapshot image '%s'",
|
||||||
|
- data->snapDisk->name);
|
||||||
|
+ if (data->parentSnap && virDomainSnapshotIsExternal(data->parentSnap)) {
|
||||||
|
+ if (virStorageSourceInit(data->parentDomDisk->src) < 0 ||
|
||||||
|
+ virStorageSourceUnlink(data->parentDomDisk->src) < 0) {
|
||||||
|
+ VIR_WARN("Failed to remove snapshot image '%s'",
|
||||||
|
+ data->snapDisk->name);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.48.1
|
@ -0,0 +1,56 @@
|
|||||||
|
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
|
117
libvirt-storage_file-de-modularize-the-local-file-backend.patch
Normal file
117
libvirt-storage_file-de-modularize-the-local-file-backend.patch
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
From 8baa9e689e641fca914b59e5d27966a1cd925991 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-ID: <8baa9e689e641fca914b59e5d27966a1cd925991.1737731143.git.jdenemar@redhat.com>
|
||||||
|
From: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
Date: Thu, 9 Jan 2025 09:52:36 +0100
|
||||||
|
Subject: [PATCH] storage_file: de-modularize the local file backend
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
The 'storage_file' infrastructure serves as an abstraction on top of
|
||||||
|
file-looking storage technologies. Apart from local file it currently
|
||||||
|
implements also a backend for 'gluster'.
|
||||||
|
|
||||||
|
Historically it was all modularized and the local file module was
|
||||||
|
usually packaged with the 'core' part of the storage driver. Now with
|
||||||
|
split daemons one can install e.g. 'virqemud' without the storage driver
|
||||||
|
core which contains the 'fs' backend module. Since the qemu driver uses
|
||||||
|
the storage file backends to e.g. create storage for snapshots and
|
||||||
|
backups this allows users to create a deployment where some things will
|
||||||
|
not work properly.
|
||||||
|
|
||||||
|
As the 'fs' backend doesn't use any code that wouldn't be linked
|
||||||
|
directly anyways there's no point in actually shipping it as a module.
|
||||||
|
|
||||||
|
Let's compile it in so that all deployments can use it.
|
||||||
|
|
||||||
|
To achieve that, compile the source directly into the
|
||||||
|
'virt_storage_file_lib' static library and remove the loading code. Also
|
||||||
|
adjust the spec file.
|
||||||
|
|
||||||
|
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||||
|
(cherry picked from commit f8558a87ac8525b16f4cbba4f24e0885fde2b79e)
|
||||||
|
|
||||||
|
https://issues.redhat.com/browse/RHEL-73507
|
||||||
|
---
|
||||||
|
libvirt.spec.in | 1 -
|
||||||
|
src/storage_file/meson.build | 16 ----------------
|
||||||
|
src/storage_file/storage_file_backend.c | 11 ++++++-----
|
||||||
|
3 files changed, 6 insertions(+), 22 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/storage_file/meson.build b/src/storage_file/meson.build
|
||||||
|
index d40e98befa..27c4e5a432 100644
|
||||||
|
--- a/src/storage_file/meson.build
|
||||||
|
+++ b/src/storage_file/meson.build
|
||||||
|
@@ -3,9 +3,6 @@ storage_file_sources = [
|
||||||
|
'storage_source_backingstore.c',
|
||||||
|
'storage_file_backend.c',
|
||||||
|
'storage_file_probe.c',
|
||||||
|
-]
|
||||||
|
-
|
||||||
|
-stoarge_file_fs_sources = [
|
||||||
|
'storage_file_backend_fs.c',
|
||||||
|
]
|
||||||
|
|
||||||
|
@@ -30,19 +27,6 @@ virt_storage_file_lib = static_library(
|
||||||
|
|
||||||
|
libvirt_libs += virt_storage_file_lib
|
||||||
|
|
||||||
|
-if conf.has('WITH_STORAGE')
|
||||||
|
- virt_modules += {
|
||||||
|
- 'name': 'virt_storage_file_fs',
|
||||||
|
- 'sources': [
|
||||||
|
- files(stoarge_file_fs_sources),
|
||||||
|
- ],
|
||||||
|
- 'include': [
|
||||||
|
- storage_inc_dir,
|
||||||
|
- ],
|
||||||
|
- 'install_dir': storage_file_install_dir,
|
||||||
|
- }
|
||||||
|
-endif
|
||||||
|
-
|
||||||
|
if conf.has('WITH_STORAGE_GLUSTER')
|
||||||
|
virt_modules += {
|
||||||
|
'name': 'virt_storage_file_gluster',
|
||||||
|
diff --git a/src/storage_file/storage_file_backend.c b/src/storage_file/storage_file_backend.c
|
||||||
|
index 03583803de..1eeec5fb43 100644
|
||||||
|
--- a/src/storage_file/storage_file_backend.c
|
||||||
|
+++ b/src/storage_file/storage_file_backend.c
|
||||||
|
@@ -26,6 +26,7 @@
|
||||||
|
#include "virerror.h"
|
||||||
|
#include "internal.h"
|
||||||
|
#include "storage_file_backend.h"
|
||||||
|
+#include "storage_file_backend_fs.h"
|
||||||
|
#include "virlog.h"
|
||||||
|
#include "virmodule.h"
|
||||||
|
#include "virfile.h"
|
||||||
|
@@ -40,7 +41,7 @@ VIR_LOG_INIT("storage.storage_source_backend");
|
||||||
|
static virStorageFileBackend *virStorageFileBackends[VIR_STORAGE_BACKENDS_MAX];
|
||||||
|
static size_t virStorageFileBackendsCount;
|
||||||
|
|
||||||
|
-#if WITH_STORAGE_DIR || WITH_STORAGE_FS || WITH_STORAGE_GLUSTER
|
||||||
|
+#if WITH_STORAGE_GLUSTER
|
||||||
|
|
||||||
|
# define STORAGE_FILE_MODULE_DIR LIBDIR "/libvirt/storage-file"
|
||||||
|
|
||||||
|
@@ -64,14 +65,14 @@ virStorageFileLoadBackendModule(const char *name,
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
-#endif /* WITH_STORAGE_DIR || WITH_STORAGE_FS || WITH_STORAGE_GLUSTER */
|
||||||
|
+#endif /* WITH_STORAGE_GLUSTER */
|
||||||
|
|
||||||
|
static int virStorageFileBackendOnceInit(void)
|
||||||
|
{
|
||||||
|
-#if WITH_STORAGE_DIR || WITH_STORAGE_FS
|
||||||
|
- if (virStorageFileLoadBackendModule("fs", "virStorageFileFsRegister", false) < 0)
|
||||||
|
+ /* The backend for local files is compiled in */
|
||||||
|
+ if (virStorageFileFsRegister() < 0)
|
||||||
|
return -1;
|
||||||
|
-#endif /* WITH_STORAGE_DIR || WITH_STORAGE_FS */
|
||||||
|
+
|
||||||
|
#if WITH_STORAGE_GLUSTER
|
||||||
|
if (virStorageFileLoadBackendModule("gluster", "virStorageFileGlusterRegister", false) < 0)
|
||||||
|
return -1;
|
||||||
|
--
|
||||||
|
2.48.1
|
@ -0,0 +1,43 @@
|
|||||||
|
From 2eab8ef9338a884b491d198bf2c6a51e271f2170 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-ID: <2eab8ef9338a884b491d198bf2c6a51e271f2170.1737731143.git.jdenemar@redhat.com>
|
||||||
|
From: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Date: Tue, 21 Jan 2025 12:36:48 +0100
|
||||||
|
Subject: [PATCH] tools: ssh-proxy: Check for domain status before parsing its
|
||||||
|
CID
|
||||||
|
|
||||||
|
Inactive domain XML can be wildly different to the live XML. For
|
||||||
|
instance, it can have VSOCK CID of that from another (running)
|
||||||
|
domain. Since domain status is not checked for, attempting to ssh
|
||||||
|
into an inactive domain may in fact result in opening a
|
||||||
|
connection to a different live domain that listens on said CID
|
||||||
|
currently.
|
||||||
|
|
||||||
|
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/737
|
||||||
|
Resolves: https://issues.redhat.com/browse/RHEL-75577
|
||||||
|
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
||||||
|
(cherry picked from commit ab10c0695d142c78d1ea078b553e1c035e7abc8a)
|
||||||
|
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
---
|
||||||
|
tools/ssh-proxy/ssh-proxy.c | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/tools/ssh-proxy/ssh-proxy.c b/tools/ssh-proxy/ssh-proxy.c
|
||||||
|
index e60c58d57f..22daffeb63 100644
|
||||||
|
--- a/tools/ssh-proxy/ssh-proxy.c
|
||||||
|
+++ b/tools/ssh-proxy/ssh-proxy.c
|
||||||
|
@@ -194,7 +194,10 @@ lookupDomainAndFetchCID(const char *uri,
|
||||||
|
if (virStrToLong_i(domname, NULL, 10, &id) >= 0)
|
||||||
|
dom = virDomainLookupByID(conn, id);
|
||||||
|
}
|
||||||
|
- if (!dom)
|
||||||
|
+
|
||||||
|
+ /* If no domain is found, return an error. Similarly, inactive domain may
|
||||||
|
+ * contain CID of another (running) domain, yielding misleading results. */
|
||||||
|
+ if (!dom || virDomainIsActive(dom) <= 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return extractCID(dom, cid);
|
||||||
|
--
|
||||||
|
2.48.1
|
@ -0,0 +1,63 @@
|
|||||||
|
From f8f48ce493edee78cd499c0aa3630d8d678b43a0 Mon Sep 17 00:00:00 2001
|
||||||
|
Message-ID: <f8f48ce493edee78cd499c0aa3630d8d678b43a0.1737731143.git.jdenemar@redhat.com>
|
||||||
|
From: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
Date: Thu, 9 Jan 2025 15:18:58 +0100
|
||||||
|
Subject: [PATCH] virstoragetest: Add case for qcow2 image with empty string as
|
||||||
|
'data_file'
|
||||||
|
|
||||||
|
Add an example image formatted by:
|
||||||
|
|
||||||
|
qemu-img create -f qcow2 -o data_file=nbd+unix:///datafile?socket=/tmp/nbd,data_file_raw=true /tmp/nbddatastore.qcow2 10M -u
|
||||||
|
|
||||||
|
serving as an example when qemu records an empty string as the
|
||||||
|
'data_file' field.
|
||||||
|
|
||||||
|
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||||
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||||
|
(cherry picked from commit e6a4245d2a4db3857cfb38d4d3c4e3e0bcff6587)
|
||||||
|
|
||||||
|
https://issues.redhat.com/browse/RHEL-73504
|
||||||
|
---
|
||||||
|
tests/virstoragetest.c | 5 +++++
|
||||||
|
.../images/datafile-emptystr.qcow2 | Bin 0 -> 327680 bytes
|
||||||
|
2 files changed, 5 insertions(+)
|
||||||
|
create mode 100644 tests/virstoragetestdata/images/datafile-emptystr.qcow2
|
||||||
|
|
||||||
|
diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
|
||||||
|
index 4ec837eefb..78dc644637 100644
|
||||||
|
--- a/tests/virstoragetest.c
|
||||||
|
+++ b/tests/virstoragetest.c
|
||||||
|
@@ -494,6 +494,11 @@ mymain(void)
|
||||||
|
abs_srcdir "/virstoragetestdata/images/qcow2datafile-datafile.qcow2",
|
||||||
|
VIR_STORAGE_FILE_QCOW2, EXP_PASS);
|
||||||
|
|
||||||
|
+ /* broken qcow2 with a 'data_file' which is an empty string */
|
||||||
|
+ TEST_CHAIN("qcow2-datafile-broken",
|
||||||
|
+ abs_srcdir "/virstoragetestdata/images/datafile-emptystr.qcow2",
|
||||||
|
+ VIR_STORAGE_FILE_QCOW2, EXP_FAIL);
|
||||||
|
+
|
||||||
|
/* Test various combinations of qcow2 images with missing 'backing_format' */
|
||||||
|
TEST_CHAIN("qcow2-qcow2_qcow2-qcow2_qcow2-auto",
|
||||||
|
abs_srcdir "/virstoragetestdata/images/qcow2_qcow2-qcow2_qcow2-auto.qcow2",
|
||||||
|
diff --git a/tests/virstoragetestdata/images/datafile-emptystr.qcow2 b/tests/virstoragetestdata/images/datafile-emptystr.qcow2
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000000000000000000000000000000000..18fae8740b4d650252d9a20629ca6e4d04653692
|
||||||
|
GIT binary patch
|
||||||
|
literal 327680
|
||||||
|
zcmeIuK}y3w6b9f)+5>omoWUCuL=fBvg6p(NG0>(VouYNsV+(F1sS&bCUEA*q4D;Un
|
||||||
|
znPKMX{^2WxFbiWh=Q16-Nk17<=juF;&BtZGLDy@B{@vnv(am3HpD!UKrx1#&jmK<R
|
||||||
|
z#UU~+S?${P(8Ry~k(TeVZ0mfJ6?x3Fb+suc516fX+omn|`)XHb@z_kKLzs8_*F{-m
|
||||||
|
zkGEM_$F?f>69*(=lYbnuwp_1vhdNG0dudo!aho?6gFn)w&EK-oorfg=0000000000
|
||||||
|
z00000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
z0D#NV%Mkzo0000000000000000000000000000000000000000000000000000000
|
||||||
|
z000000000000000000000RFk;_X7X`00000000000000000000000000000000000
|
||||||
|
z0000000000000000000000000000000000000000;EJ8PyU(xq0RR910000000000
|
||||||
|
z00000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
z=$*U+000000000000000000000000000000000000000000000000000000000000
|
||||||
|
V0000000000000000000Xgm1%)GK2sC
|
||||||
|
|
||||||
|
literal 0
|
||||||
|
HcmV?d00001
|
||||||
|
|
||||||
|
--
|
||||||
|
2.48.1
|
22
libvirt.spec
22
libvirt.spec
@ -289,7 +289,7 @@
|
|||||||
Summary: Library providing a simple virtualization API
|
Summary: Library providing a simple virtualization API
|
||||||
Name: libvirt
|
Name: libvirt
|
||||||
Version: 10.10.0
|
Version: 10.10.0
|
||||||
Release: 4%{?dist}%{?extra_release}
|
Release: 5%{?dist}%{?extra_release}
|
||||||
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
|
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
|
||||||
URL: https://libvirt.org/
|
URL: https://libvirt.org/
|
||||||
|
|
||||||
@ -331,6 +331,13 @@ Patch31: libvirt-qemu-Add-support-for-direct-and-extended-tlbflush-features.patc
|
|||||||
Patch32: libvirt-conf-refactor-hyperv-features-formatting.patch
|
Patch32: libvirt-conf-refactor-hyperv-features-formatting.patch
|
||||||
Patch33: libvirt-conf-Adjust-hyperv-tlbflush-formatting.patch
|
Patch33: libvirt-conf-Adjust-hyperv-tlbflush-formatting.patch
|
||||||
Patch34: libvirt-qemu_migration-Do-not-consider-post-copy-active-in-postcopy-recover.patch
|
Patch34: libvirt-qemu_migration-Do-not-consider-post-copy-active-in-postcopy-recover.patch
|
||||||
|
Patch35: libvirt-qemu-allow-migration-of-guest-with-mdev-vGPU-to-VF-vGPU.patch
|
||||||
|
Patch36: libvirt-storage_file-Refuse-qcow2-images-with-empty-string-as-data_file.patch
|
||||||
|
Patch37: libvirt-virstoragetest-Add-case-for-qcow2-image-with-empty-string-as-data_file.patch
|
||||||
|
Patch38: libvirt-qemu-snapshot-delete-disk-image-only-if-parent-snapshot-is-external.patch
|
||||||
|
Patch39: libvirt-storage_file-de-modularize-the-local-file-backend.patch
|
||||||
|
Patch40: libvirt-qemu-re-use-existing-ActualNetDef-for-more-interface-types-during-update-device.patch
|
||||||
|
Patch41: libvirt-tools-ssh-proxy-Check-for-domain-status-before-parsing-its-CID.patch
|
||||||
|
|
||||||
|
|
||||||
Requires: libvirt-daemon = %{version}-%{release}
|
Requires: libvirt-daemon = %{version}-%{release}
|
||||||
@ -2085,7 +2092,6 @@ exit 0
|
|||||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/
|
%dir %attr(0755, root, root) %{_libdir}/libvirt/
|
||||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/
|
%dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/
|
||||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/storage-backend/
|
%dir %attr(0755, root, root) %{_libdir}/libvirt/storage-backend/
|
||||||
%dir %attr(0755, root, root) %{_libdir}/libvirt/storage-file/
|
|
||||||
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
|
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
|
||||||
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
|
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
|
||||||
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
|
%{_datadir}/polkit-1/rules.d/50-libvirt.rules
|
||||||
@ -2255,7 +2261,6 @@ exit 0
|
|||||||
%ghost %dir %{_rundir}/libvirt/storage/
|
%ghost %dir %{_rundir}/libvirt/storage/
|
||||||
%{_libdir}/libvirt/connection-driver/libvirt_driver_storage.so
|
%{_libdir}/libvirt/connection-driver/libvirt_driver_storage.so
|
||||||
%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_fs.so
|
%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_fs.so
|
||||||
%{_libdir}/libvirt/storage-file/libvirt_storage_file_fs.so
|
|
||||||
%{_mandir}/man8/virtstoraged.8*
|
%{_mandir}/man8/virtstoraged.8*
|
||||||
|
|
||||||
%files daemon-driver-storage-disk
|
%files daemon-driver-storage-disk
|
||||||
@ -2281,6 +2286,7 @@ exit 0
|
|||||||
%if %{with_storage_gluster}
|
%if %{with_storage_gluster}
|
||||||
%files daemon-driver-storage-gluster
|
%files daemon-driver-storage-gluster
|
||||||
%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_gluster.so
|
%{_libdir}/libvirt/storage-backend/libvirt_storage_backend_gluster.so
|
||||||
|
%dir %attr(0755, root, root) %{_libdir}/libvirt/storage-file/
|
||||||
%{_libdir}/libvirt/storage-file/libvirt_storage_file_gluster.so
|
%{_libdir}/libvirt/storage-file/libvirt_storage_file_gluster.so
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
@ -2656,6 +2662,16 @@ exit 0
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jan 24 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-5
|
||||||
|
- 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)
|
||||||
|
|
||||||
* Thu Jan 16 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-4
|
* Thu Jan 16 2025 Jiri Denemark <jdenemar@redhat.com> - 10.10.0-4
|
||||||
- conf, docs: Add support for direct and extended tlbflush features (RHEL-7122)
|
- conf, docs: Add support for direct and extended tlbflush features (RHEL-7122)
|
||||||
- qemu: Add support for direct and extended tlbflush features (RHEL-7122)
|
- qemu: Add support for direct and extended tlbflush features (RHEL-7122)
|
||||||
|
Loading…
Reference in New Issue
Block a user