The virConnectOpenInternal method opens the libvirt client config file and uses it to resolve things like URI aliases. There may be driver specific things that are useful to store in the config file too, so rather than have them re-parse the same file, pass the virConfPtr down to the drivers. Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx> --- src/bhyve/bhyve_driver.c | 1 + src/driver-hypervisor.h | 1 + src/esx/esx_driver.c | 1 + src/hyperv/hyperv_driver.c | 4 +++- src/libvirt.c | 2 +- src/libxl/libxl_driver.c | 1 + src/lxc/lxc_driver.c | 1 + src/openvz/openvz_driver.c | 1 + src/phyp/phyp_driver.c | 4 +++- src/qemu/qemu_driver.c | 1 + src/remote/remote_driver.c | 1 + src/test/test_driver.c | 1 + src/uml/uml_driver.c | 1 + src/vbox/vbox_common.c | 1 + src/vbox/vbox_driver.c | 1 + src/vmware/vmware_driver.c | 1 + src/vz/vz_driver.c | 1 + src/xen/xen_driver.c | 4 +++- 18 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index c4051a1..1885bdf 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -178,6 +178,7 @@ bhyveDomObjFromDomain(virDomainPtr domain) static virDrvOpenStatus bhyveConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index d11ff7f..5ab5775 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -28,6 +28,7 @@ typedef virDrvOpenStatus (*virDrvConnectOpen)(virConnectPtr conn, virConnectAuthPtr auth, + virConfPtr conf, unsigned int flags); typedef int diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 031c666..c5f5ed8 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -841,6 +841,7 @@ esxConnectToVCenter(esxPrivate *priv, */ static virDrvOpenStatus esxConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { virDrvOpenStatus result = VIR_DRV_OPEN_ERROR; diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index b95c549..9c7faf0 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -58,7 +58,9 @@ hypervFreePrivate(hypervPrivate **priv) static virDrvOpenStatus -hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) +hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, + virConfPtr conf ATTRIBUTE_UNUSED, + unsigned int flags) { virDrvOpenStatus result = VIR_DRV_OPEN_ERROR; char *plus; diff --git a/src/libvirt.c b/src/libvirt.c index 6d9dba8..a5e0e41 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -1084,7 +1084,7 @@ virConnectOpenInternal(const char *name, ret->secretDriver = virConnectDriverTab[i]->secretDriver; ret->storageDriver = virConnectDriverTab[i]->storageDriver; - res = virConnectDriverTab[i]->hypervisorDriver->connectOpen(ret, auth, flags); + res = virConnectDriverTab[i]->hypervisorDriver->connectOpen(ret, auth, conf, flags); VIR_DEBUG("driver %zu %s returned %s", i, virConnectDriverTab[i]->hypervisorDriver->name, res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" : diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 95dfc01..82a05e0 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -763,6 +763,7 @@ libxlStateReload(void) static virDrvOpenStatus libxlConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index f0948ea..ad866f9 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -155,6 +155,7 @@ lxcDomObjFromDomain(virDomainPtr domain) static virDrvOpenStatus lxcConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index a7474ff..489a607 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -1423,6 +1423,7 @@ openvzDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) static virDrvOpenStatus openvzConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { struct openvz_driver *driver; diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index da87686..5a9729d 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1123,7 +1123,9 @@ virDomainDefParserConfig virPhypDriverDomainDefParserConfig = { static virDrvOpenStatus phypConnectOpen(virConnectPtr conn, - virConnectAuthPtr auth, unsigned int flags) + virConnectAuthPtr auth, + virConfPtr conf ATTRIBUTE_UNUSED, + unsigned int flags) { LIBSSH2_SESSION *session = NULL; int internal_socket = -1; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 10d3e3d..eb0b804 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1120,6 +1120,7 @@ qemuStateCleanup(void) static virDrvOpenStatus qemuConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { virQEMUDriverConfigPtr cfg = NULL; diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 5f02169..b42d1d1 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -1179,6 +1179,7 @@ remoteAllocPrivateData(void) static virDrvOpenStatus remoteConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { struct private_data *priv; diff --git a/src/test/test_driver.c b/src/test/test_driver.c index a51eb09..2c7fbd1 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -1411,6 +1411,7 @@ testConnectAuthenticate(virConnectPtr conn, static virDrvOpenStatus testConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { int ret; diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 923c3f6..de28705 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -1200,6 +1200,7 @@ static void umlShutdownVMDaemon(struct uml_driver *driver, static virDrvOpenStatus umlConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index ee2b6ad..01748e8 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -391,6 +391,7 @@ static void vboxUninitialize(vboxGlobalData *data) static virDrvOpenStatus vboxConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { vboxGlobalData *data = NULL; diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c index d363fef..a5f3721 100644 --- a/src/vbox/vbox_driver.c +++ b/src/vbox/vbox_driver.c @@ -53,6 +53,7 @@ VIR_LOG_INIT("vbox.vbox_driver"); #if !defined(WITH_DRIVER_MODULES) || defined(VBOX_DRIVER) static virDrvOpenStatus dummyConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { uid_t uid = geteuid(); diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 93f21c9..37c7353 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -118,6 +118,7 @@ vmwareDomainXMLConfigInit(void) static virDrvOpenStatus vmwareConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { struct vmware_driver *driver; diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 177a57a..6dc2ecd 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -333,6 +333,7 @@ vzDriverObjNew(void) static virDrvOpenStatus vzConnectOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED, + virConfPtr conf ATTRIBUTE_UNUSED, unsigned int flags) { vzDriverPtr driver = NULL; diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 3f5d80d..63b5b58 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -404,7 +404,9 @@ xenDomainXMLConfInit(void) static virDrvOpenStatus -xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags) +xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, + virConfPtr conf ATTRIBUTE_UNUSED, + unsigned int flags) { xenUnifiedPrivatePtr priv; char ebuf[1024]; -- 2.5.5 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list