1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-11-06 20:25:00 +03:00

driver: introduce a driver method for probing default URIs

Currently the virDrvConnectOpen method is supposed to handle both
opening an explicit URI and auto-probing a driver if no URI is
given. Introduce a dedicated virDrvConnectURIProbe method to enable the
probing functionality to be split from the driver opening functionality.

It is still possible for NULL to be passed to the virDrvConnectOpen
method after this change, because the remote driver needs special
handling to enable probing of the URI against a remote libvirtd daemon.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2018-03-27 17:24:44 +01:00
parent a2fd657b86
commit 20ad55a8fd
11 changed files with 118 additions and 45 deletions

View File

@@ -25,6 +25,9 @@
# error "Don't include this file directly, only use driver.h"
# endif
typedef int
(*virDrvConnectURIProbe)(char **uri);
typedef virDrvOpenStatus
(*virDrvConnectOpen)(virConnectPtr conn,
virConnectAuthPtr auth,
@@ -1300,6 +1303,7 @@ typedef virHypervisorDriver *virHypervisorDriverPtr;
*/
struct _virHypervisorDriver {
const char *name; /* the name of the driver */
virDrvConnectURIProbe connectURIProbe;
virDrvConnectOpen connectOpen;
virDrvConnectClose connectClose;
virDrvConnectSupportsFeature connectSupportsFeature;