[PATCH 03/10] qemu: remove vioserialaddrs caching

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

 



Dropping the caching of virtio serial address set.
The cached set is not required anymore, because the set is now being
recalculated from the domain definition on demand, so the cache
can be deleted.

Credit goes to Cole Robinson.
---
 src/qemu/qemu_domain.c         |  1 -
 src/qemu/qemu_domain.h         |  1 -
 src/qemu/qemu_domain_address.c | 17 ++---------------
 3 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 286f096..543f21a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1300,7 +1300,6 @@ qemuDomainObjPrivateFree(void *data)
     virCgroupFree(&priv->cgroup);
     virDomainPCIAddressSetFree(priv->pciaddrs);
     virDomainCCWAddressSetFree(priv->ccwaddrs);
-    virDomainVirtioSerialAddrSetFree(priv->vioserialaddrs);
     virDomainChrSourceDefFree(priv->monConfig);
     qemuDomainObjFreeJob(priv);
     VIR_FREE(priv->lockState);
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 114db98..cbdbdfc 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -186,7 +186,6 @@ struct _qemuDomainObjPrivate {
 
     virDomainPCIAddressSetPtr pciaddrs;
     virDomainCCWAddressSetPtr ccwaddrs;
-    virDomainVirtioSerialAddrSetPtr vioserialaddrs;
 
     virQEMUCapsPtr qemuCaps;
     char *lockState;
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 3033ab9..ec8ce40 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -106,13 +106,11 @@ qemuDomainSetSCSIControllerModel(const virDomainDef *def,
 
 
 static int
-qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def,
-                                      virDomainObjPtr obj)
+qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def)
 {
     int ret = -1;
     size_t i;
     virDomainVirtioSerialAddrSetPtr addrs = NULL;
-    qemuDomainObjPrivatePtr priv = NULL;
 
     if (!(addrs = virDomainVirtioSerialAddrSetCreateFromDomain(def)))
         goto cleanup;
@@ -137,13 +135,6 @@ qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def,
             goto cleanup;
     }
 
-    if (obj && obj->privateData) {
-        priv = obj->privateData;
-        /* if this is the live domain object, we persist the addresses */
-        virDomainVirtioSerialAddrSetFree(priv->vioserialaddrs);
-        priv->vioserialaddrs = addrs;
-        addrs = NULL;
-    }
     ret = 0;
 
  cleanup:
@@ -1621,7 +1612,7 @@ qemuDomainAssignAddresses(virDomainDefPtr def,
                           virDomainObjPtr obj,
                           bool newDomain ATTRIBUTE_UNUSED)
 {
-    if (qemuDomainAssignVirtioSerialAddresses(def, obj) < 0)
+    if (qemuDomainAssignVirtioSerialAddresses(def) < 0)
         return -1;
 
     if (qemuDomainAssignSpaprVIOAddresses(def, qemuCaps) < 0)
@@ -1660,8 +1651,4 @@ qemuDomainReleaseDeviceAddress(virDomainObjPtr vm,
                                             &info->addr.pci) < 0)
         VIR_WARN("Unable to release PCI address on %s",
                  NULLSTR(devstr));
-    if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL &&
-        virDomainVirtioSerialAddrRelease(priv->vioserialaddrs, info) < 0)
-        VIR_WARN("Unable to release virtio-serial address on %s",
-                 NULLSTR(devstr));
 }
-- 
2.7.4 (Apple Git-66)

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