mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
Pass config file object through to driver open methods
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@redhat.com>
This commit is contained in:
parent
416358d99d
commit
5f1837eaca
@ -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);
|
||||
|
@ -28,6 +28,7 @@
|
||||
typedef virDrvOpenStatus
|
||||
(*virDrvConnectOpen)(virConnectPtr conn,
|
||||
virConnectAuthPtr auth,
|
||||
virConfPtr conf,
|
||||
unsigned int flags);
|
||||
|
||||
typedef int
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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" :
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -1132,6 +1132,7 @@ qemuStateCleanup(void)
|
||||
|
||||
static virDrvOpenStatus qemuConnectOpen(virConnectPtr conn,
|
||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
||||
virConfPtr conf ATTRIBUTE_UNUSED,
|
||||
unsigned int flags)
|
||||
{
|
||||
virQEMUDriverConfigPtr cfg = NULL;
|
||||
|
@ -1180,6 +1180,7 @@ remoteAllocPrivateData(void)
|
||||
static virDrvOpenStatus
|
||||
remoteConnectOpen(virConnectPtr conn,
|
||||
virConnectAuthPtr auth,
|
||||
virConfPtr conf ATTRIBUTE_UNUSED,
|
||||
unsigned int flags)
|
||||
{
|
||||
struct private_data *priv;
|
||||
|
@ -1411,6 +1411,7 @@ testConnectAuthenticate(virConnectPtr conn,
|
||||
|
||||
static virDrvOpenStatus testConnectOpen(virConnectPtr conn,
|
||||
virConnectAuthPtr auth,
|
||||
virConfPtr conf ATTRIBUTE_UNUSED,
|
||||
unsigned int flags)
|
||||
{
|
||||
int ret;
|
||||
|
@ -1195,6 +1195,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);
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -135,6 +135,7 @@ getCapsObject(void)
|
||||
*/
|
||||
static virDrvOpenStatus
|
||||
xenapiConnectOpen(virConnectPtr conn, virConnectAuthPtr auth,
|
||||
virConfPtr conf ATTRIBUTE_UNUSED,
|
||||
unsigned int flags)
|
||||
{
|
||||
char *username = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user