[PATCH 1/3] qemu: Re-reserve all PCI addresses on libvirtd restart

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

 



When reconnecting to existing VMs, we re-reserved only those PCI
addresses which were explicitly mentioned in domain XML. Since some
addresses are always reserved (e.g., 0:0:0 and 0:0:1), we need to handle
those too.

Also all this should only be done if device flag is supported by qemu.
---
 src/qemu/qemu_driver.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e718816..2ca3940 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1455,11 +1455,13 @@ qemuReconnectDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaq
     if (qemudExtractVersionInfo(obj->def->emulator,
                                 NULL,
                                 &qemuCmdFlags) >= 0 &&
-        (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE))
+        (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)) {
         priv->persistentAddrs = 1;
 
-    if (!(priv->pciaddrs = qemuDomainPCIAddressSetCreate(obj->def)))
-        goto error;
+        if (!(priv->pciaddrs = qemuDomainPCIAddressSetCreate(obj->def)) ||
+            qemuAssignDevicePCISlots(obj->def, priv->pciaddrs) < 0)
+            goto error;
+    }
 
     if (driver->securityDriver &&
         driver->securityDriver->domainReserveSecurityLabel &&
-- 
1.7.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]