libvirt-11.10.0-10.2.el10nv
- domain_conf: initialize network hostdev private data (VOYAGER-227) - qemu_hotplug: enter monitor in order to rollback passed FD (VOYAGER-227) Resolves: VOYAGER-227
This commit is contained in:
parent
d39b9dfb91
commit
c3a2f6f18b
@ -0,0 +1,96 @@
|
||||
From dad5203ccef4ef9321034a4234ea82af6d945af3 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <dad5203ccef4ef9321034a4234ea82af6d945af3.1772544849.git.phrdina@redhat.com>
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
Date: Thu, 26 Feb 2026 10:18:23 +0100
|
||||
Subject: [PATCH] domain_conf: initialize network hostdev private data
|
||||
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
|
||||
Currently virDomainNetDef and virDomainActualNetDef use
|
||||
virDomainHostdevDef directly as structure and the code doesn't call
|
||||
virDomainHostdevDefNew() that would initialize private data.
|
||||
|
||||
This is hackish quick fix to solve a crash that happens in two
|
||||
scenarios:
|
||||
|
||||
1. attaching any interface with hostdev backend
|
||||
|
||||
0x0000fffbfc0e2a90 in qemuDomainAttachHostPCIDevice (driver=0xfffbb4006750, vm=0xfffbf001f790, hostdev=0xfffbf400b150) at ../src/qemu/qemu_hotplug.c:1652
|
||||
1652 if ((ret = qemuFDPassDirectTransferMonitor(hostdevPriv->vfioDeviceFd, priv->mon)) < 0)
|
||||
|
||||
2. starting VM with interface with hostdev backend using iommufd
|
||||
|
||||
0x00007f6638d5b9ca in qemuProcessOpenVfioDeviceFd (hostdev=hostdev@entry=0x7f6634425ee0) at ../src/qemu/qemu_process.c:7719
|
||||
7719 hostdevPriv->vfioDeviceFd = qemuFDPassDirectNew(name, &vfioDeviceFd);
|
||||
|
||||
Proper fix for this issue is to refactor network code to use pointer and to
|
||||
use virDomainHostdevDefNew().
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit fe782ed334ea0d4373e6dad093f5815fc925a56b)
|
||||
|
||||
https://issues.redhat.com/browse/VOYAGER-227
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
---
|
||||
src/conf/domain_conf.c | 23 +++++++++++++++++++++--
|
||||
1 file changed, 21 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index b8c180e72d..4e12ebf712 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -3489,6 +3489,20 @@ void virDomainVideoDefFree(virDomainVideoDef *def)
|
||||
}
|
||||
|
||||
|
||||
+static int
|
||||
+virDomainHostdevDefPrivateDataNew(virDomainHostdevDef *def,
|
||||
+ virDomainXMLOption *xmlopt)
|
||||
+{
|
||||
+ if (!xmlopt || !xmlopt->privateData.hostdevNew)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (!(def->privateData = xmlopt->privateData.hostdevNew()))
|
||||
+ return -1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
virDomainHostdevDef *
|
||||
virDomainHostdevDefNew(virDomainXMLOption *xmlopt)
|
||||
{
|
||||
@@ -3498,8 +3512,7 @@ virDomainHostdevDefNew(virDomainXMLOption *xmlopt)
|
||||
|
||||
def->info = g_new0(virDomainDeviceInfo, 1);
|
||||
|
||||
- if (xmlopt && xmlopt->privateData.hostdevNew &&
|
||||
- !(def->privateData = xmlopt->privateData.hostdevNew())) {
|
||||
+ if (virDomainHostdevDefPrivateDataNew(def, xmlopt) < 0) {
|
||||
VIR_FREE(def->info);
|
||||
VIR_FREE(def);
|
||||
return NULL;
|
||||
@@ -9653,6 +9666,9 @@ virDomainActualNetDefParseXML(xmlNodePtr node,
|
||||
virDomainHostdevDef *hostdev = &actual->data.hostdev.def;
|
||||
int type;
|
||||
|
||||
+ if (virDomainHostdevDefPrivateDataNew(hostdev, xmlopt) < 0)
|
||||
+ goto error;
|
||||
+
|
||||
hostdev->parentnet = parent;
|
||||
hostdev->info = &parent->info;
|
||||
/* The helper function expects type to already be found and
|
||||
@@ -10346,6 +10362,9 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
|
||||
g_autofree char *addrtype = virXPathString("string(./source/address/@type)", ctxt);
|
||||
int type;
|
||||
|
||||
+ if (virDomainHostdevDefPrivateDataNew(&def->data.hostdev.def, xmlopt) < 0)
|
||||
+ return NULL;
|
||||
+
|
||||
def->data.hostdev.def.parentnet = def;
|
||||
def->data.hostdev.def.info = &def->info;
|
||||
def->data.hostdev.def.mode = VIR_DOMAIN_HOSTDEV_MODE_SUBSYS;
|
||||
--
|
||||
2.53.0
|
||||
@ -0,0 +1,48 @@
|
||||
From af8b75eaad8a84b712338a2975091d8bbe144015 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <af8b75eaad8a84b712338a2975091d8bbe144015.1772544849.git.phrdina@redhat.com>
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
Date: Thu, 26 Feb 2026 10:54:18 +0100
|
||||
Subject: [PATCH] qemu_hotplug: enter monitor in order to rollback passed FD
|
||||
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
|
||||
Reported-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
(cherry picked from commit 4374dbbbf0d87f0052dd96be96baad6c20963713)
|
||||
|
||||
https://issues.redhat.com/browse/VOYAGER-227
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_hotplug.c | 9 +++++----
|
||||
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
||||
index a455c2cd53..bb88815e27 100644
|
||||
--- a/src/qemu/qemu_hotplug.c
|
||||
+++ b/src/qemu/qemu_hotplug.c
|
||||
@@ -1682,15 +1682,16 @@ qemuDomainAttachHostPCIDevice(virQEMUDriver *driver,
|
||||
if (teardownmemlock && qemuDomainAdjustMaxMemLock(vm) < 0)
|
||||
VIR_WARN("Unable to reset maximum locked memory on hotplug fail");
|
||||
|
||||
- if (removeiommufd) {
|
||||
- qemuDomainObjEnterMonitor(vm);
|
||||
+ qemuDomainObjEnterMonitor(vm);
|
||||
+
|
||||
+ if (removeiommufd)
|
||||
ignore_value(qemuMonitorDelObject(priv->mon, "iommufd0", false));
|
||||
- qemuDomainObjExitMonitor(vm);
|
||||
- }
|
||||
|
||||
qemuFDPassDirectTransferMonitorRollback(hostdevPriv->vfioDeviceFd, priv->mon);
|
||||
qemuFDPassDirectTransferMonitorRollback(priv->iommufd, priv->mon);
|
||||
|
||||
+ qemuDomainObjExitMonitor(vm);
|
||||
+
|
||||
if (releaseaddr)
|
||||
qemuDomainReleaseDeviceAddress(vm, info);
|
||||
|
||||
--
|
||||
2.53.0
|
||||
@ -294,7 +294,7 @@
|
||||
Summary: Library providing a simple virtualization API
|
||||
Name: libvirt
|
||||
Version: 11.10.0
|
||||
Release: 10.1%{?dist}%{?extra_release}
|
||||
Release: 10.2%{?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/
|
||||
|
||||
@ -385,6 +385,8 @@ Patch80: libvirt-qemu-Add-support-for-HW-accelerated-nested-SMMUv3.patch
|
||||
Patch81: libvirt-tests-qemuxmlconfdata-provide-HW-accel-smmuv3-sample-XML-and-CLI-args.patch
|
||||
Patch82: libvirt-qemu-add-IOMMU-attribute-cmdqv-for-smmuv3.patch
|
||||
Patch83: libvirt-tests-qemuxmlconfdata-provide-cmdqv-sample-XML-and-CLI-args.patch
|
||||
Patch84: libvirt-domain_conf-initialize-network-hostdev-private-data.patch
|
||||
Patch85: libvirt-qemu_hotplug-enter-monitor-in-order-to-rollback-passed-FD.patch
|
||||
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
@ -2776,6 +2778,10 @@ exit 0
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Mar 4 2026 Pavel Hrdina <phrdina@redhat.com> - 11.10.0-10.2.el10nv
|
||||
- domain_conf: initialize network hostdev private data (VOYAGER-227)
|
||||
- qemu_hotplug: enter monitor in order to rollback passed FD (VOYAGER-227)
|
||||
|
||||
* Thu Feb 19 2026 Pavel Hrdina <phrdina@redhat.com> - 11.10.0-10.1.el10nv
|
||||
- qemu: Add support for HW-accelerated nested SMMUv3 (VOYAGER-4)
|
||||
- tests: qemuxmlconfdata: provide HW-accel smmuv3 sample XML and CLI args (VOYAGER-4)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user