[PATCH v3 5/5] qemu: remove pciaddrs caching

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

 



The cached pci address set is not required anymore, because the set
is now being recalculated from the domain definition on demand,
so the cache can be deleted.
---
 src/qemu/qemu_domain.c         |  1 -
 src/qemu/qemu_domain.h         |  1 -
 src/qemu/qemu_domain_address.c | 14 ++------------
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 6c0f261..24e594b 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1328,7 +1328,6 @@ qemuDomainObjPrivateFree(void *data)
     virObjectUnref(priv->qemuCaps);
 
     virCgroupFree(&priv->cgroup);
-    virDomainPCIAddressSetFree(priv->pciaddrs);
     virDomainUSBAddressSetFree(priv->usbaddrs);
     virDomainChrSourceDefFree(priv->monConfig);
     qemuDomainObjFreeJob(priv);
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 0613093..af96d4a 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -184,7 +184,6 @@ struct _qemuDomainObjPrivate {
     bool beingDestroyed;
     char *pidfile;
 
-    virDomainPCIAddressSetPtr pciaddrs;
     virDomainUSBAddressSetPtr usbaddrs;
 
     virQEMUCapsPtr qemuCaps;
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 2870afc..ade1c21 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -1482,12 +1482,10 @@ qemuDomainAddressFindNewBusNr(virDomainDefPtr def)
 
 static int
 qemuDomainAssignPCIAddresses(virDomainDefPtr def,
-                             virQEMUCapsPtr qemuCaps,
-                             virDomainObjPtr obj)
+                             virQEMUCapsPtr qemuCaps)
 {
     int ret = -1;
     virDomainPCIAddressSetPtr addrs = NULL;
-    qemuDomainObjPrivatePtr priv = NULL;
     int max_idx = -1;
     int nbuses = 0;
     size_t i;
@@ -1641,14 +1639,6 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
         }
     }
 
-    if (obj && obj->privateData) {
-        priv = obj->privateData;
-        /* if this is the live domain object, we persist the PCI addresses */
-        virDomainPCIAddressSetFree(priv->pciaddrs);
-        priv->pciaddrs = addrs;
-        addrs = NULL;
-    }
-
     ret = 0;
 
  cleanup:
@@ -1821,7 +1811,7 @@ qemuDomainAssignAddresses(virDomainDefPtr def,
 
     qemuDomainAssignARMVirtioMMIOAddresses(def, qemuCaps);
 
-    if (qemuDomainAssignPCIAddresses(def, qemuCaps, obj) < 0)
+    if (qemuDomainAssignPCIAddresses(def, qemuCaps) < 0)
         return -1;
 
     if (newDomain && qemuDomainAssignUSBAddresses(def, obj) < 0)
-- 
1.9.1

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