libvirt-11.10.0-12.el10

- test: Default to ROM type for loader (RHEL-82645)
- qemu_hotplug: Fix crash when attaching network inteface with hostdev network (RHEL-151916)

Resolves: RHEL-151916, RHEL-82645
This commit is contained in:
Jiri Denemark 2026-03-10 16:00:03 +01:00
parent 8d2da0bba7
commit dd0c987285
3 changed files with 162 additions and 1 deletions

View File

@ -0,0 +1,96 @@
From e7ad692e2f55a08db011f12a888a0156ef983ecd Mon Sep 17 00:00:00 2001
Message-ID: <e7ad692e2f55a08db011f12a888a0156ef983ecd.1773154803.git.jdenemar@redhat.com>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Tue, 10 Mar 2026 09:34:48 +0100
Subject: [PATCH] qemu_hotplug: Fix crash when attaching network inteface with
hostdev network
The following interface XML will crash libvirt when attached to
running VM:
<interface type='network'>
<source network='hostdev_net'/>
</interface>
Instead of trying to figure out every single place where hostdev is used
as struct directly and allocating empty private data check if iommufd
is configured as that will happen only for <hostdev> device where the
private data are correctly allocated.
This patch is best viewed with `git show -w`.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 25662b3700da9c32b5083d46ff3831aa4afc2eab)
Resolves: https://issues.redhat.com/browse/RHEL-151916
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
src/qemu/qemu_hotplug.c | 37 +++++++++++++++++++++----------------
1 file changed, 21 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index bb88815e27..845f42bf20 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1638,20 +1638,23 @@ qemuDomainAttachHostPCIDevice(virQEMUDriver *driver,
qemuDomainObjEnterMonitor(vm);
- if (objprops) {
- if ((ret = qemuFDPassDirectTransferMonitor(priv->iommufd, priv->mon)) < 0)
- goto exit_monitor;
- if ((ret = qemuMonitorAddObject(priv->mon, &objprops, NULL)) < 0)
- goto exit_monitor;
+ if (virHostdevIsPCIDeviceWithIOMMUFD(hostdev)) {
+ if (objprops) {
+ if ((ret = qemuFDPassDirectTransferMonitor(priv->iommufd, priv->mon)) < 0)
+ goto exit_monitor;
- priv->iommufdState = true;
- removeiommufd = true;
+ if ((ret = qemuMonitorAddObject(priv->mon, &objprops, NULL)) < 0)
+ goto exit_monitor;
+
+ priv->iommufdState = true;
+ removeiommufd = true;
+ }
+
+ if ((ret = qemuFDPassDirectTransferMonitor(hostdevPriv->vfioDeviceFd, priv->mon)) < 0)
+ goto exit_monitor;
}
- if ((ret = qemuFDPassDirectTransferMonitor(hostdevPriv->vfioDeviceFd, priv->mon)) < 0)
- goto exit_monitor;
-
if ((ret = qemuDomainAttachExtensionDevice(priv->mon, hostdev->info)) < 0)
goto exit_monitor;
@@ -1682,15 +1685,17 @@ qemuDomainAttachHostPCIDevice(virQEMUDriver *driver,
if (teardownmemlock && qemuDomainAdjustMaxMemLock(vm) < 0)
VIR_WARN("Unable to reset maximum locked memory on hotplug fail");
- qemuDomainObjEnterMonitor(vm);
+ if (virHostdevIsPCIDeviceWithIOMMUFD(hostdev)) {
+ qemuDomainObjEnterMonitor(vm);
- if (removeiommufd)
- ignore_value(qemuMonitorDelObject(priv->mon, "iommufd0", false));
+ if (removeiommufd)
+ ignore_value(qemuMonitorDelObject(priv->mon, "iommufd0", false));
- qemuFDPassDirectTransferMonitorRollback(hostdevPriv->vfioDeviceFd, priv->mon);
- qemuFDPassDirectTransferMonitorRollback(priv->iommufd, priv->mon);
+ qemuFDPassDirectTransferMonitorRollback(hostdevPriv->vfioDeviceFd, priv->mon);
+ qemuFDPassDirectTransferMonitorRollback(priv->iommufd, priv->mon);
- qemuDomainObjExitMonitor(vm);
+ qemuDomainObjExitMonitor(vm);
+ }
if (releaseaddr)
qemuDomainReleaseDeviceAddress(vm, info);
--
2.53.0

View File

@ -0,0 +1,59 @@
From 3c5a50888fffcc6fcc83745e24782dfbaf26519b Mon Sep 17 00:00:00 2001
Message-ID: <3c5a50888fffcc6fcc83745e24782dfbaf26519b.1773154803.git.jdenemar@redhat.com>
From: Jim Fehlig <jfehlig@suse.com>
Date: Fri, 6 Mar 2026 09:56:16 -0700
Subject: [PATCH] test: Default to ROM type for loader
Commit 1504b7f687 moved the corresponding logic from the generic
postparse code to drivers but failed to update the test driver,
which causes failures in virt-manager's test suite.
Fixes: 1504b7f687bdfc679377e605d076776b18533468
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit 3ea1550c64f689f1dff944cbe1e77c3e8f8f46f7)
https://issues.redhat.com/browse/RHEL-82645
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
src/test/test_driver.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 1165689de7..536e291861 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -421,6 +421,22 @@ testDomainDevicesDefPostParse(virDomainDeviceDef *dev G_GNUC_UNUSED,
}
+static int
+testDomainDefPostParse(virDomainDef *def,
+ unsigned int parseFlags G_GNUC_UNUSED,
+ void *opaque G_GNUC_UNUSED,
+ void *parseOpaque G_GNUC_UNUSED)
+{
+ if (def->os.loader &&
+ def->os.loader->path &&
+ !def->os.loader->type) {
+ def->os.loader->type = VIR_DOMAIN_LOADER_TYPE_ROM;
+ }
+
+ return 0;
+}
+
+
static void
testDomainObjPrivateFree(void *data)
{
@@ -448,6 +464,7 @@ testDriverNew(void)
VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT |
VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING,
.devicesPostParseCallback = testDomainDevicesDefPostParse,
+ .domainPostParseCallback = testDomainDefPostParse,
.defArch = VIR_ARCH_I686,
};
virDomainXMLPrivateDataCallbacks privatecb = {
--
2.53.0

View File

@ -294,7 +294,7 @@
Summary: Library providing a simple virtualization API
Name: libvirt
Version: 11.10.0
Release: 11%{?dist}%{?extra_release}
Release: 12%{?dist}%{?extra_release}
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/
@ -457,6 +457,8 @@ Patch152: libvirt-include-Mention-varstore-where-applicable.patch
Patch153: libvirt-virsh-Update-for-varstore-handling.patch
Patch154: libvirt-domain_conf-initialize-network-hostdev-private-data.patch
Patch155: libvirt-qemu_hotplug-enter-monitor-in-order-to-rollback-passed-FD.patch
Patch156: libvirt-test-Default-to-ROM-type-for-loader.patch
Patch157: libvirt-qemu_hotplug-Fix-crash-when-attaching-network-inteface-with-hostdev-network.patch
Requires: libvirt-daemon = %{version}-%{release}
@ -2849,6 +2851,10 @@ exit 0
%endif
%changelog
* Tue Mar 10 2026 Jiri Denemark <jdenemar@redhat.com> - 11.10.0-12
- test: Default to ROM type for loader (RHEL-82645)
- qemu_hotplug: Fix crash when attaching network inteface with hostdev network (RHEL-151916)
* Fri Mar 6 2026 Jiri Denemark <jdenemar@redhat.com> - 11.10.0-11
- qemu_firmware: Drop support for kernel descriptors (RHEL-82645)
- qemu_firmware: Drop 'nvram' local variable (RHEL-82645)