[libvirt] [PATCH 22/30] conf: drop virCapsPtr param from domain obj list APIs

Daniel P. Berrangé berrange at redhat.com
Wed Dec 4 14:21:05 UTC 2019


Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 src/bhyve/bhyve_driver.c    |  2 --
 src/conf/virdomainobjlist.c |  5 -----
 src/conf/virdomainobjlist.h |  1 -
 src/libxl/libxl_driver.c    |  3 ---
 src/lxc/lxc_driver.c        | 14 --------------
 src/qemu/qemu_driver.c      |  8 +-------
 6 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index eecd6532f7..a764b4d4ed 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1249,7 +1249,6 @@ bhyveStateInitialize(bool privileged,
     if (virDomainObjListLoadAllConfigs(bhyve_driver->domains,
                                        BHYVE_STATE_DIR,
                                        NULL, true,
-                                       bhyve_driver->caps,
                                        bhyve_driver->xmlopt,
                                        NULL, NULL) < 0)
         goto cleanup;
@@ -1257,7 +1256,6 @@ bhyveStateInitialize(bool privileged,
     if (virDomainObjListLoadAllConfigs(bhyve_driver->domains,
                                        BHYVE_CONFIG_DIR,
                                        BHYVE_AUTOSTART_DIR, false,
-                                       bhyve_driver->caps,
                                        bhyve_driver->xmlopt,
                                        NULL, NULL) < 0)
         goto cleanup;
diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c
index ae18a4544f..417025ae9f 100644
--- a/src/conf/virdomainobjlist.c
+++ b/src/conf/virdomainobjlist.c
@@ -483,7 +483,6 @@ virDomainObjListRename(virDomainObjListPtr doms,
 
 static virDomainObjPtr
 virDomainObjListLoadConfig(virDomainObjListPtr doms,
-                           virCapsPtr caps G_GNUC_UNUSED,
                            virDomainXMLOptionPtr xmlopt,
                            const char *configDir,
                            const char *autostartDir,
@@ -536,7 +535,6 @@ static virDomainObjPtr
 virDomainObjListLoadStatus(virDomainObjListPtr doms,
                            const char *statusDir,
                            const char *name,
-                           virCapsPtr caps G_GNUC_UNUSED,
                            virDomainXMLOptionPtr xmlopt,
                            virDomainLoadConfigNotify notify,
                            void *opaque)
@@ -586,7 +584,6 @@ virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
                                const char *configDir,
                                const char *autostartDir,
                                bool liveStatus,
-                               virCapsPtr caps,
                                virDomainXMLOptionPtr xmlopt,
                                virDomainLoadConfigNotify notify,
                                void *opaque)
@@ -616,13 +613,11 @@ virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
             dom = virDomainObjListLoadStatus(doms,
                                              configDir,
                                              entry->d_name,
-                                             caps,
                                              xmlopt,
                                              notify,
                                              opaque);
         else
             dom = virDomainObjListLoadConfig(doms,
-                                             caps,
                                              xmlopt,
                                              configDir,
                                              autostartDir,
diff --git a/src/conf/virdomainobjlist.h b/src/conf/virdomainobjlist.h
index da5ec8a57c..6150e13aa4 100644
--- a/src/conf/virdomainobjlist.h
+++ b/src/conf/virdomainobjlist.h
@@ -66,7 +66,6 @@ int virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
                                    const char *configDir,
                                    const char *autostartDir,
                                    bool liveStatus,
-                                   virCapsPtr caps,
                                    virDomainXMLOptionPtr xmlopt,
                                    virDomainLoadConfigNotify notify,
                                    void *opaque);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index cdb1296aa3..568277c714 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -781,7 +781,6 @@ libxlStateInitialize(bool privileged,
                                        cfg->stateDir,
                                        cfg->autostartDir,
                                        true,
-                                       cfg->caps,
                                        libxl_driver->xmlopt,
                                        NULL, NULL) < 0)
         goto error;
@@ -793,7 +792,6 @@ libxlStateInitialize(bool privileged,
                                        cfg->configDir,
                                        cfg->autostartDir,
                                        false,
-                                       cfg->caps,
                                        libxl_driver->xmlopt,
                                        NULL, NULL) < 0)
         goto error;
@@ -833,7 +831,6 @@ libxlStateReload(void)
                                    cfg->configDir,
                                    cfg->autostartDir,
                                    true,
-                                   cfg->caps,
                                    libxl_driver->xmlopt,
                                    NULL, libxl_driver);
 
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 3467b07538..b40a96b4ce 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1529,7 +1529,6 @@ static int lxcStateInitialize(bool privileged,
                               virStateInhibitCallback callback G_GNUC_UNUSED,
                               void *opaque G_GNUC_UNUSED)
 {
-    virCapsPtr caps = NULL;
     virLXCDriverConfigPtr cfg = NULL;
     bool autostart = true;
 
@@ -1581,9 +1580,6 @@ static int lxcStateInitialize(bool privileged,
     if (!(lxc_driver->hostdevMgr = virHostdevManagerGetDefault()))
         goto cleanup;
 
-    if (!(caps = virLXCDriverGetCapabilities(lxc_driver, true)))
-        goto cleanup;
-
     if (!(lxc_driver->xmlopt = lxcDomainXMLConfInit(lxc_driver)))
         goto cleanup;
 
@@ -1605,7 +1601,6 @@ static int lxcStateInitialize(bool privileged,
     if (virDomainObjListLoadAllConfigs(lxc_driver->domains,
                                        cfg->stateDir,
                                        NULL, true,
-                                       caps,
                                        lxc_driver->xmlopt,
                                        NULL, NULL) < 0)
         goto cleanup;
@@ -1616,7 +1611,6 @@ static int lxcStateInitialize(bool privileged,
     if (virDomainObjListLoadAllConfigs(lxc_driver->domains,
                                        cfg->configDir,
                                        cfg->autostartDir, false,
-                                       caps,
                                        lxc_driver->xmlopt,
                                        NULL, NULL) < 0)
         goto cleanup;
@@ -1627,11 +1621,9 @@ static int lxcStateInitialize(bool privileged,
     if (autostart)
         virLXCProcessAutostartAll(lxc_driver);
 
-    virObjectUnref(caps);
     return VIR_DRV_STATE_INIT_COMPLETE;
 
  cleanup:
-    virObjectUnref(caps);
     lxcStateCleanup();
     return VIR_DRV_STATE_INIT_ERROR;
 }
@@ -1659,23 +1651,17 @@ static int
 lxcStateReload(void)
 {
     virLXCDriverConfigPtr cfg = NULL;
-    virCapsPtr caps = NULL;
 
     if (!lxc_driver)
         return 0;
 
-    if (!(caps = virLXCDriverGetCapabilities(lxc_driver, false)))
-        return -1;
-
     cfg = virLXCDriverGetConfig(lxc_driver);
 
     virDomainObjListLoadAllConfigs(lxc_driver->domains,
                                    cfg->configDir,
                                    cfg->autostartDir, false,
-                                   caps,
                                    lxc_driver->xmlopt,
                                    lxcNotifyLoadDomain, lxc_driver);
-    virObjectUnref(caps);
     virObjectUnref(cfg);
     return 0;
 }
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 91cf3fb21a..0aefe8cd2a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -972,7 +972,6 @@ qemuStateInitialize(bool privileged,
     if (virDomainObjListLoadAllConfigs(qemu_driver->domains,
                                        cfg->stateDir,
                                        NULL, true,
-                                       qemu_driver->caps,
                                        qemu_driver->xmlopt,
                                        NULL, NULL) < 0)
         goto error;
@@ -994,7 +993,6 @@ qemuStateInitialize(bool privileged,
     if (virDomainObjListLoadAllConfigs(qemu_driver->domains,
                                        cfg->configDir,
                                        cfg->autostartDir, false,
-                                       qemu_driver->caps,
                                        qemu_driver->xmlopt,
                                        NULL, NULL) < 0)
         goto error;
@@ -1059,19 +1057,15 @@ static int
 qemuStateReload(void)
 {
     g_autoptr(virQEMUDriverConfig) cfg = NULL;
-    g_autoptr(virCaps) caps = NULL;
 
     if (!qemu_driver)
         return 0;
 
-    if (!(caps = virQEMUDriverGetCapabilities(qemu_driver, false)))
-        return 0;
-
     cfg = virQEMUDriverGetConfig(qemu_driver);
     virDomainObjListLoadAllConfigs(qemu_driver->domains,
                                    cfg->configDir,
                                    cfg->autostartDir, false,
-                                   caps, qemu_driver->xmlopt,
+                                   qemu_driver->xmlopt,
                                    qemuNotifyLoadDomain, qemu_driver);
     return 0;
 }
-- 
2.23.0




More information about the libvir-list mailing list