conf: drop virCapsPtr param from domain obj list APIs

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2019-11-27 12:58:57 +00:00
parent 78d8228eec
commit 1cd2b2d545
6 changed files with 1 additions and 32 deletions

View File

@ -1249,7 +1249,6 @@ bhyveStateInitialize(bool privileged,
if (virDomainObjListLoadAllConfigs(bhyve_driver->domains, if (virDomainObjListLoadAllConfigs(bhyve_driver->domains,
BHYVE_STATE_DIR, BHYVE_STATE_DIR,
NULL, true, NULL, true,
bhyve_driver->caps,
bhyve_driver->xmlopt, bhyve_driver->xmlopt,
NULL, NULL) < 0) NULL, NULL) < 0)
goto cleanup; goto cleanup;
@ -1257,7 +1256,6 @@ bhyveStateInitialize(bool privileged,
if (virDomainObjListLoadAllConfigs(bhyve_driver->domains, if (virDomainObjListLoadAllConfigs(bhyve_driver->domains,
BHYVE_CONFIG_DIR, BHYVE_CONFIG_DIR,
BHYVE_AUTOSTART_DIR, false, BHYVE_AUTOSTART_DIR, false,
bhyve_driver->caps,
bhyve_driver->xmlopt, bhyve_driver->xmlopt,
NULL, NULL) < 0) NULL, NULL) < 0)
goto cleanup; goto cleanup;

View File

@ -483,7 +483,6 @@ virDomainObjListRename(virDomainObjListPtr doms,
static virDomainObjPtr static virDomainObjPtr
virDomainObjListLoadConfig(virDomainObjListPtr doms, virDomainObjListLoadConfig(virDomainObjListPtr doms,
virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
const char *configDir, const char *configDir,
const char *autostartDir, const char *autostartDir,
@ -536,7 +535,6 @@ static virDomainObjPtr
virDomainObjListLoadStatus(virDomainObjListPtr doms, virDomainObjListLoadStatus(virDomainObjListPtr doms,
const char *statusDir, const char *statusDir,
const char *name, const char *name,
virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
virDomainLoadConfigNotify notify, virDomainLoadConfigNotify notify,
void *opaque) void *opaque)
@ -586,7 +584,6 @@ virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
const char *configDir, const char *configDir,
const char *autostartDir, const char *autostartDir,
bool liveStatus, bool liveStatus,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
virDomainLoadConfigNotify notify, virDomainLoadConfigNotify notify,
void *opaque) void *opaque)
@ -616,13 +613,11 @@ virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
dom = virDomainObjListLoadStatus(doms, dom = virDomainObjListLoadStatus(doms,
configDir, configDir,
entry->d_name, entry->d_name,
caps,
xmlopt, xmlopt,
notify, notify,
opaque); opaque);
else else
dom = virDomainObjListLoadConfig(doms, dom = virDomainObjListLoadConfig(doms,
caps,
xmlopt, xmlopt,
configDir, configDir,
autostartDir, autostartDir,

View File

@ -66,7 +66,6 @@ int virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
const char *configDir, const char *configDir,
const char *autostartDir, const char *autostartDir,
bool liveStatus, bool liveStatus,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
virDomainLoadConfigNotify notify, virDomainLoadConfigNotify notify,
void *opaque); void *opaque);

View File

@ -781,7 +781,6 @@ libxlStateInitialize(bool privileged,
cfg->stateDir, cfg->stateDir,
cfg->autostartDir, cfg->autostartDir,
true, true,
cfg->caps,
libxl_driver->xmlopt, libxl_driver->xmlopt,
NULL, NULL) < 0) NULL, NULL) < 0)
goto error; goto error;
@ -793,7 +792,6 @@ libxlStateInitialize(bool privileged,
cfg->configDir, cfg->configDir,
cfg->autostartDir, cfg->autostartDir,
false, false,
cfg->caps,
libxl_driver->xmlopt, libxl_driver->xmlopt,
NULL, NULL) < 0) NULL, NULL) < 0)
goto error; goto error;
@ -833,7 +831,6 @@ libxlStateReload(void)
cfg->configDir, cfg->configDir,
cfg->autostartDir, cfg->autostartDir,
true, true,
cfg->caps,
libxl_driver->xmlopt, libxl_driver->xmlopt,
NULL, libxl_driver); NULL, libxl_driver);

View File

@ -1529,7 +1529,6 @@ static int lxcStateInitialize(bool privileged,
virStateInhibitCallback callback G_GNUC_UNUSED, virStateInhibitCallback callback G_GNUC_UNUSED,
void *opaque G_GNUC_UNUSED) void *opaque G_GNUC_UNUSED)
{ {
virCapsPtr caps = NULL;
virLXCDriverConfigPtr cfg = NULL; virLXCDriverConfigPtr cfg = NULL;
bool autostart = true; bool autostart = true;
@ -1581,9 +1580,6 @@ static int lxcStateInitialize(bool privileged,
if (!(lxc_driver->hostdevMgr = virHostdevManagerGetDefault())) if (!(lxc_driver->hostdevMgr = virHostdevManagerGetDefault()))
goto cleanup; goto cleanup;
if (!(caps = virLXCDriverGetCapabilities(lxc_driver, true)))
goto cleanup;
if (!(lxc_driver->xmlopt = lxcDomainXMLConfInit(lxc_driver))) if (!(lxc_driver->xmlopt = lxcDomainXMLConfInit(lxc_driver)))
goto cleanup; goto cleanup;
@ -1605,7 +1601,6 @@ static int lxcStateInitialize(bool privileged,
if (virDomainObjListLoadAllConfigs(lxc_driver->domains, if (virDomainObjListLoadAllConfigs(lxc_driver->domains,
cfg->stateDir, cfg->stateDir,
NULL, true, NULL, true,
caps,
lxc_driver->xmlopt, lxc_driver->xmlopt,
NULL, NULL) < 0) NULL, NULL) < 0)
goto cleanup; goto cleanup;
@ -1616,7 +1611,6 @@ static int lxcStateInitialize(bool privileged,
if (virDomainObjListLoadAllConfigs(lxc_driver->domains, if (virDomainObjListLoadAllConfigs(lxc_driver->domains,
cfg->configDir, cfg->configDir,
cfg->autostartDir, false, cfg->autostartDir, false,
caps,
lxc_driver->xmlopt, lxc_driver->xmlopt,
NULL, NULL) < 0) NULL, NULL) < 0)
goto cleanup; goto cleanup;
@ -1627,11 +1621,9 @@ static int lxcStateInitialize(bool privileged,
if (autostart) if (autostart)
virLXCProcessAutostartAll(lxc_driver); virLXCProcessAutostartAll(lxc_driver);
virObjectUnref(caps);
return VIR_DRV_STATE_INIT_COMPLETE; return VIR_DRV_STATE_INIT_COMPLETE;
cleanup: cleanup:
virObjectUnref(caps);
lxcStateCleanup(); lxcStateCleanup();
return VIR_DRV_STATE_INIT_ERROR; return VIR_DRV_STATE_INIT_ERROR;
} }
@ -1659,23 +1651,17 @@ static int
lxcStateReload(void) lxcStateReload(void)
{ {
virLXCDriverConfigPtr cfg = NULL; virLXCDriverConfigPtr cfg = NULL;
virCapsPtr caps = NULL;
if (!lxc_driver) if (!lxc_driver)
return 0; return 0;
if (!(caps = virLXCDriverGetCapabilities(lxc_driver, false)))
return -1;
cfg = virLXCDriverGetConfig(lxc_driver); cfg = virLXCDriverGetConfig(lxc_driver);
virDomainObjListLoadAllConfigs(lxc_driver->domains, virDomainObjListLoadAllConfigs(lxc_driver->domains,
cfg->configDir, cfg->configDir,
cfg->autostartDir, false, cfg->autostartDir, false,
caps,
lxc_driver->xmlopt, lxc_driver->xmlopt,
lxcNotifyLoadDomain, lxc_driver); lxcNotifyLoadDomain, lxc_driver);
virObjectUnref(caps);
virObjectUnref(cfg); virObjectUnref(cfg);
return 0; return 0;
} }

View File

@ -972,7 +972,6 @@ qemuStateInitialize(bool privileged,
if (virDomainObjListLoadAllConfigs(qemu_driver->domains, if (virDomainObjListLoadAllConfigs(qemu_driver->domains,
cfg->stateDir, cfg->stateDir,
NULL, true, NULL, true,
qemu_driver->caps,
qemu_driver->xmlopt, qemu_driver->xmlopt,
NULL, NULL) < 0) NULL, NULL) < 0)
goto error; goto error;
@ -994,7 +993,6 @@ qemuStateInitialize(bool privileged,
if (virDomainObjListLoadAllConfigs(qemu_driver->domains, if (virDomainObjListLoadAllConfigs(qemu_driver->domains,
cfg->configDir, cfg->configDir,
cfg->autostartDir, false, cfg->autostartDir, false,
qemu_driver->caps,
qemu_driver->xmlopt, qemu_driver->xmlopt,
NULL, NULL) < 0) NULL, NULL) < 0)
goto error; goto error;
@ -1059,19 +1057,15 @@ static int
qemuStateReload(void) qemuStateReload(void)
{ {
g_autoptr(virQEMUDriverConfig) cfg = NULL; g_autoptr(virQEMUDriverConfig) cfg = NULL;
g_autoptr(virCaps) caps = NULL;
if (!qemu_driver) if (!qemu_driver)
return 0; return 0;
if (!(caps = virQEMUDriverGetCapabilities(qemu_driver, false)))
return 0;
cfg = virQEMUDriverGetConfig(qemu_driver); cfg = virQEMUDriverGetConfig(qemu_driver);
virDomainObjListLoadAllConfigs(qemu_driver->domains, virDomainObjListLoadAllConfigs(qemu_driver->domains,
cfg->configDir, cfg->configDir,
cfg->autostartDir, false, cfg->autostartDir, false,
caps, qemu_driver->xmlopt, qemu_driver->xmlopt,
qemuNotifyLoadDomain, qemu_driver); qemuNotifyLoadDomain, qemu_driver);
return 0; return 0;
} }