+Mon Nov 17 11:40:00 GMT 2008 Daniel Berrange <berrange@redhat.com>
+
+ Push URI probing down into individual drivers' open methods
+ * qemud/remote.c: Implement virConnectGetURI dispatcher
+ * qemud/remote_protocol.x: Add API definition for virConnectGetURI
+ * qemud/remote_dispatch_localvars.h, qemud/remote_dispatch_proc_switch.h,
+ qemud/remote_dispatch_prototypes.h, qemud/remote_protocol.c,
+ qemud/remote_protocol.h: Re-generate from protocol definition
+ * src/datatypes.c, src/datatypes.h: Store connection name as a
+ xmlURIPtr object instead of char *
+ * src/driver.h: Remove explicit URI parameter to open function
+ * src/libvirt.c: Delegrate URI probing into drivers
+ * src/lxc_driver.c, src/network_driver.c, src/openvz_driver.c,
+ src/proxy_internal.c, src/qemu_driver.c, src/remote_internal.c,
+ src/storage_driver.c, src/test.c, src/xen_internal.c,
+ src/xen_internal.h, src/xen_unified.c, src/xend_internal.c,
+ src/xend_internal.h, src/xm_internal.c, src/xm_internal.h,
+ src/xs_internal.c, src/xs_internal.h: Refactor open driver
+ methods to deal with automatic URI probing as required
+ * proxy/libvirt_proxy.c: Remove extra args to xs/xen driver
+ open calls
+
Mon Nov 17 11:19:00 GMT 2008 Daniel Berrange <berrange@redhat.com>
Refactor storage backend to remove dependancy from
priv->xshandle = NULL;
priv->proxy = -1;
- ret = xenHypervisorOpen(conn, NULL, NULL, 0);
+ ret = xenHypervisorOpen(conn, NULL, 0);
if (ret < 0) {
fprintf(stderr, "Failed to open Xen hypervisor\n");
return(-1);
fprintf(stderr, "Failed to connect to Xen daemon\n");
return(-1);
}
- ret = xenStoreOpen(conn, NULL, NULL, VIR_CONNECT_RO);
+ ret = xenStoreOpen(conn, NULL, VIR_CONNECT_RO);
if (ret < 0) {
fprintf(stderr, "Failed to open XenStore connection");
return (-1);
return 0;
}
+static int
+remoteDispatchGetUri (struct qemud_server *server ATTRIBUTE_UNUSED,
+ struct qemud_client *client,
+ remote_message_header *req,
+ void *args ATTRIBUTE_UNUSED,
+ remote_get_uri_ret *ret)
+{
+ char *uri;
+ CHECK_CONN(client);
+
+ uri = virConnectGetURI (client->conn);
+ if (uri == NULL) return -1;
+
+ ret->uri = uri;
+ return 0;
+}
+
static int
remoteDispatchGetMaxVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client,
remote_storage_vol_get_path_ret lv_remote_storage_vol_get_path_ret;
remote_domain_lookup_by_id_args lv_remote_domain_lookup_by_id_args;
remote_domain_lookup_by_id_ret lv_remote_domain_lookup_by_id_ret;
+remote_get_uri_ret lv_remote_get_uri_ret;
remote_domain_attach_device_args lv_remote_domain_attach_device_args;
remote_num_of_networks_ret lv_remote_num_of_networks_ret;
remote_storage_pool_get_info_args lv_remote_storage_pool_get_info_args;
ret = (char *) &lv_remote_get_type_ret;
memset (&lv_remote_get_type_ret, 0, sizeof lv_remote_get_type_ret);
break;
+case REMOTE_PROC_GET_URI:
+ fn = (dispatch_fn) remoteDispatchGetUri;
+ ret_filter = (xdrproc_t) xdr_remote_get_uri_ret;
+ ret = (char *) &lv_remote_get_uri_ret;
+ memset (&lv_remote_get_uri_ret, 0, sizeof lv_remote_get_uri_ret);
+ break;
case REMOTE_PROC_GET_VERSION:
fn = (dispatch_fn) remoteDispatchGetVersion;
ret_filter = (xdrproc_t) xdr_remote_get_version_ret;
static int remoteDispatchGetHostname (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_get_hostname_ret *ret);
static int remoteDispatchGetMaxVcpus (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_get_max_vcpus_args *args, remote_get_max_vcpus_ret *ret);
static int remoteDispatchGetType (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_get_type_ret *ret);
+static int remoteDispatchGetUri (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_get_uri_ret *ret);
static int remoteDispatchGetVersion (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, void *args, remote_get_version_ret *ret);
static int remoteDispatchListDefinedDomains (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_list_defined_domains_args *args, remote_list_defined_domains_ret *ret);
static int remoteDispatchListDefinedNetworks (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, remote_list_defined_networks_args *args, remote_list_defined_networks_ret *ret);
return TRUE;
}
+bool_t
+xdr_remote_get_uri_ret (XDR *xdrs, remote_get_uri_ret *objp)
+{
+
+ if (!xdr_remote_nonnull_string (xdrs, &objp->uri))
+ return FALSE;
+ return TRUE;
+}
+
bool_t
xdr_remote_get_max_vcpus_args (XDR *xdrs, remote_get_max_vcpus_args *objp)
{
};
typedef struct remote_get_hostname_ret remote_get_hostname_ret;
+struct remote_get_uri_ret {
+ remote_nonnull_string uri;
+};
+typedef struct remote_get_uri_ret remote_get_uri_ret;
+
struct remote_get_max_vcpus_args {
remote_string type;
};
REMOTE_PROC_DOMAIN_EVENT = 107,
REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2 = 108,
REMOTE_PROC_DOMAIN_MIGRATE_FINISH2 = 109,
+ REMOTE_PROC_GET_URI = 110,
};
typedef enum remote_procedure remote_procedure;
extern bool_t xdr_remote_get_type_ret (XDR *, remote_get_type_ret*);
extern bool_t xdr_remote_get_version_ret (XDR *, remote_get_version_ret*);
extern bool_t xdr_remote_get_hostname_ret (XDR *, remote_get_hostname_ret*);
+extern bool_t xdr_remote_get_uri_ret (XDR *, remote_get_uri_ret*);
extern bool_t xdr_remote_get_max_vcpus_args (XDR *, remote_get_max_vcpus_args*);
extern bool_t xdr_remote_get_max_vcpus_ret (XDR *, remote_get_max_vcpus_ret*);
extern bool_t xdr_remote_node_get_info_ret (XDR *, remote_node_get_info_ret*);
extern bool_t xdr_remote_get_type_ret ();
extern bool_t xdr_remote_get_version_ret ();
extern bool_t xdr_remote_get_hostname_ret ();
+extern bool_t xdr_remote_get_uri_ret ();
extern bool_t xdr_remote_get_max_vcpus_args ();
extern bool_t xdr_remote_get_max_vcpus_ret ();
extern bool_t xdr_remote_node_get_info_ret ();
remote_nonnull_string hostname;
};
+struct remote_get_uri_ret {
+ remote_nonnull_string uri;
+};
+
struct remote_get_max_vcpus_args {
/* The only backend which supports this call is Xen HV, and
* there the type is ignored so it could be NULL.
REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY = 101,
REMOTE_PROC_NODE_GET_FREE_MEMORY = 102,
-
REMOTE_PROC_DOMAIN_BLOCK_PEEK = 103,
REMOTE_PROC_DOMAIN_MEMORY_PEEK = 104,
-
REMOTE_PROC_DOMAIN_EVENTS_REGISTER = 105,
REMOTE_PROC_DOMAIN_EVENTS_DEREGISTER = 106,
REMOTE_PROC_DOMAIN_EVENT = 107,
-
REMOTE_PROC_DOMAIN_MIGRATE_PREPARE2 = 108,
- REMOTE_PROC_DOMAIN_MIGRATE_FINISH2 = 109
+ REMOTE_PROC_DOMAIN_MIGRATE_FINISH2 = 109,
+ REMOTE_PROC_GET_URI = 110
};
/* Custom RPC structure. */
*/
static void
virReleaseConnect(virConnectPtr conn) {
- DEBUG("release connection %p %s", conn, conn->name);
+ DEBUG("release connection %p", conn);
if (conn->domains != NULL)
virHashFree(conn->domains, (virHashDeallocator) virDomainFreeName);
if (conn->networks != NULL)
if (virLastErr.conn == conn)
virLastErr.conn = NULL;
- VIR_FREE(conn->name);
+ xmlFreeURI(conn->uri);
pthread_mutex_unlock(&conn->lock);
pthread_mutex_destroy(&conn->lock);
return(-1);
}
pthread_mutex_lock(&conn->lock);
- DEBUG("unref connection %p %s %d", conn, conn->name, conn->refs);
+ DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
refs = conn->refs;
if (refs == 0) {
VIR_FREE(domain->name);
VIR_FREE(domain);
- DEBUG("unref connection %p %s %d", conn, conn->name, conn->refs);
+ DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
VIR_FREE(network->name);
VIR_FREE(network);
- DEBUG("unref connection %p %s %d", conn, conn->name, conn->refs);
+ DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
VIR_FREE(pool->name);
VIR_FREE(pool);
- DEBUG("unref connection %p %s %d", conn, conn->name, conn->refs);
+ DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
VIR_FREE(vol->pool);
VIR_FREE(vol);
- DEBUG("unref connection %p %s %d", conn, conn->name, conn->refs);
+ DEBUG("unref connection %p %d", conn, conn->refs);
conn->refs--;
if (conn->refs == 0) {
virReleaseConnect(conn);
struct _virConnect {
unsigned int magic; /* specific value to check */
int flags; /* a set of connection flags */
- char *name; /* connection URI */
+ xmlURIPtr uri; /* connection URI */
/* The underlying hypervisor driver and network driver. */
virDriverPtr driver;
#define VIR_DRV_SUPPORTS_FEATURE(drv,conn,feature) \
((drv)->supports_feature ? (drv)->supports_feature((conn),(feature)) : 0)
-typedef const char *
- (*virDrvProbe) (void);
typedef virDrvOpenStatus
(*virDrvOpen) (virConnectPtr conn,
- xmlURIPtr uri,
virConnectAuthPtr auth,
int flags);
typedef int
int no; /* the number virDrvNo */
const char * name; /* the name of the driver */
unsigned long ver; /* the version of the backend */
- virDrvProbe probe;
virDrvOpen open;
virDrvClose close;
virDrvDrvSupportsFeature supports_feature;
int flags)
{
int i, res;
- virConnectPtr ret = NULL;
- xmlURIPtr uri;
+ virConnectPtr ret;
+
+ ret = virGetConnect();
+ if (ret == NULL)
+ return NULL;
/*
* If no URI is passed, then check for an environment string if not
DEBUG("Using LIBVIRT_DEFAULT_URI %s", defname);
name = defname;
} else {
- const char *use = NULL;
- const char *latest;
- int probes = 0;
- for (i = 0; i < virDriverTabCount; i++) {
- if ((virDriverTab[i]->probe != NULL) &&
- ((latest = virDriverTab[i]->probe()) != NULL)) {
- probes++;
-
- DEBUG("Probed %s", latest);
- /*
- * if running a xen kernel, give it priority over
- * QEmu emulation
- */
- if (STREQ(latest, "xen:///"))
- use = latest;
- else if (use == NULL)
- use = latest;
- }
- }
- if (use == NULL) {
- name = "xen:///";
- DEBUG("Could not probe any hypervisor defaulting to %s",
- name);
- } else {
- name = use;
- DEBUG("Using %s as default URI, %d hypervisor found",
- use, probes);
- }
+ name = NULL;
}
}
- /* Convert xen -> xen:/// for back compat */
- if (STRCASEEQ(name, "xen"))
- name = "xen:///";
+ if (name) {
+ /* Convert xen -> xen:/// for back compat */
+ if (STRCASEEQ(name, "xen"))
+ name = "xen:///";
- /* Convert xen:// -> xen:/// because xmlParseURI cannot parse the
- * former. This allows URIs such as xen://localhost to work.
- */
- if (STREQ (name, "xen://"))
- name = "xen:///";
-
- ret = virGetConnect();
- if (ret == NULL)
- return NULL;
-
- uri = xmlParseURI (name);
- if (!uri) {
- virLibConnError (ret, VIR_ERR_INVALID_ARG,
- _("could not parse connection URI"));
- goto failed;
- }
+ /* Convert xen:// -> xen:/// because xmlParseURI cannot parse the
+ * former. This allows URIs such as xen://localhost to work.
+ */
+ if (STREQ (name, "xen://"))
+ name = "xen:///";
+
+ ret->uri = xmlParseURI (name);
+ if (!ret->uri) {
+ virLibConnError (ret, VIR_ERR_INVALID_ARG,
+ _("could not parse connection URI"));
+ goto failed;
+ }
- DEBUG("name \"%s\" to URI components:\n"
- " scheme %s\n"
- " opaque %s\n"
- " authority %s\n"
- " server %s\n"
- " user %s\n"
- " port %d\n"
- " path %s\n",
- name,
- uri->scheme, uri->opaque, uri->authority, uri->server,
- uri->user, uri->port, uri->path);
-
- ret->name = strdup (name);
- if (!ret->name) {
- virLibConnError (ret, VIR_ERR_NO_MEMORY, _("allocating conn->name"));
- goto failed;
+ DEBUG("name \"%s\" to URI components:\n"
+ " scheme %s\n"
+ " opaque %s\n"
+ " authority %s\n"
+ " server %s\n"
+ " user %s\n"
+ " port %d\n"
+ " path %s\n",
+ name,
+ ret->uri->scheme, ret->uri->opaque,
+ ret->uri->authority, ret->uri->server,
+ ret->uri->user, ret->uri->port,
+ ret->uri->path);
+ } else {
+ DEBUG0("no name, allowing driver auto-select");
}
/* Cleansing flags */
for (i = 0; i < virDriverTabCount; i++) {
DEBUG("trying driver %d (%s) ...",
i, virDriverTab[i]->name);
- res = virDriverTab[i]->open (ret, uri, auth, flags);
+ res = virDriverTab[i]->open (ret, auth, flags);
DEBUG("driver %d %s returned %s",
i, virDriverTab[i]->name,
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
}
for (i = 0; i < virNetworkDriverTabCount; i++) {
- res = virNetworkDriverTab[i]->open (ret, uri, auth, flags);
+ res = virNetworkDriverTab[i]->open (ret, auth, flags);
DEBUG("network driver %d %s returned %s",
i, virNetworkDriverTab[i]->name,
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
/* Secondary driver for storage. Optional */
for (i = 0; i < virStorageDriverTabCount; i++) {
- res = virStorageDriverTab[i]->open (ret, uri, auth, flags);
+ res = virStorageDriverTab[i]->open (ret, auth, flags);
#ifdef ENABLE_DEBUG
DEBUG("storage driver %d %s returned %s",
i, virStorageDriverTab[i]->name,
}
}
- xmlFreeURI (uri);
-
return ret;
failed:
if (ret->driver) ret->driver->close (ret);
- if (uri) xmlFreeURI(uri);
/* If no global error was set, copy any error set
in the connection object we're about to dispose of */
if (conn->driver->getURI)
return conn->driver->getURI (conn);
- name = strdup (conn->name);
+ name = (char *)xmlSaveUri(conn->uri);
if (!name) {
virLibConnError (conn, VIR_ERR_NO_MEMORY, __FUNCTION__);
return NULL;
/* Functions */
-static const char *lxcProbe(void)
+static int lxcProbe(void)
{
- if (lxcContainerAvailable(0) < 0)
- return NULL;
+ if (getuid() != 0 ||
+ lxcContainerAvailable(0) < 0)
+ return 0;
- return("lxc:///");
+ return 1;
}
static virDrvOpenStatus lxcOpen(virConnectPtr conn,
- xmlURIPtr uri,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
{
- uid_t uid = getuid();
-
- /* Check that the user is root */
- if (0 != uid) {
+ if (!lxcProbe())
goto declineConnection;
- }
if (lxc_driver == NULL)
goto declineConnection;
/* Verify uri was specified */
- if ((NULL == uri) || (NULL == uri->scheme)) {
- goto declineConnection;
- }
-
- /* Check that the uri scheme is lxc */
- if (STRNEQ(uri->scheme, "lxc")) {
+ if (conn->uri == NULL) {
+ conn->uri = xmlParseURI("lxc:///");
+ if (!conn->uri) {
+ lxcError(conn, NULL, VIR_ERR_NO_MEMORY, NULL);
+ return VIR_DRV_OPEN_ERROR;
+ }
+ } else if (conn->uri->scheme == NULL ||
+ STRNEQ(conn->uri->scheme, "lxc")) {
goto declineConnection;
}
VIR_DRV_LXC, /* the number virDrvNo */
"LXC", /* the name of the driver */
LIBVIR_VERSION_NUMBER, /* the version of the backend */
- lxcProbe, /* probe */
lxcOpen, /* open */
lxcClose, /* close */
NULL, /* supports_feature */
}
static virDrvOpenStatus networkOpenNetwork(virConnectPtr conn,
- xmlURIPtr uri ATTRIBUTE_UNUSED,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED) {
if (!driverState)
return 0;
}
-static const char *openvzProbe(void)
+static int openvzProbe(void)
{
-#ifdef __linux__
- if ((geteuid() == 0) && (virFileExists("/proc/vz")))
- return("openvz:///system");
-#endif
- return(NULL);
+ if (geteuid() == 0 &&
+ virFileExists("/proc/vz"))
+ return 1;
+
+ return 0;
}
static virDrvOpenStatus openvzOpen(virConnectPtr conn,
- xmlURIPtr uri,
- virConnectAuthPtr auth ATTRIBUTE_UNUSED,
- int flags ATTRIBUTE_UNUSED)
+ virConnectAuthPtr auth ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED)
{
struct openvz_driver *driver;
- /*Just check if the user is root. Nothing really to open for OpenVZ */
- if (geteuid()) { // OpenVZ tools can only be used by r00t
+ if (!openvzProbe())
return VIR_DRV_OPEN_DECLINED;
- } else {
- if (uri == NULL ||
- uri->scheme == NULL ||
- uri->path == NULL ||
- STRNEQ (uri->scheme, "openvz") ||
- STRNEQ (uri->path, "/system"))
- return VIR_DRV_OPEN_DECLINED;
- }
- /* See if we are running an OpenVZ enabled kernel */
- if(access("/proc/vz/veinfo", F_OK) == -1 ||
- access("/proc/user_beancounters", F_OK) == -1) {
+
+ if (conn->uri == NULL) {
+ conn->uri = xmlParseURI("openvz:///system");
+ if (conn->uri == NULL) {
+ openvzError(conn, VIR_ERR_NO_DOMAIN, NULL);
+ return VIR_DRV_OPEN_ERROR;
+ }
+ } else if (conn->uri->scheme == NULL ||
+ conn->uri->path == NULL ||
+ STRNEQ (conn->uri->scheme, "openvz") ||
+ STRNEQ (conn->uri->path, "/system")) {
return VIR_DRV_OPEN_DECLINED;
}
VIR_DRV_OPENVZ,
"OPENVZ",
LIBVIR_VERSION_NUMBER,
- openvzProbe, /* probe */
openvzOpen, /* open */
openvzClose, /* close */
NULL, /* supports_feature */
static int debug = 0;
static int xenProxyClose(virConnectPtr conn);
-static int xenProxyOpen(virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int flags);
+static int xenProxyOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
static int xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer);
static int xenProxyNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
static char *xenProxyGetCapabilities(virConnectPtr conn);
*/
int
xenProxyOpen(virConnectPtr conn,
- xmlURIPtr uri ATTRIBUTE_UNUSED,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags)
{
* Probe for the availability of the qemu driver, assume the
* presence of QEmu emulation if the binaries are installed
*/
-static const char *qemudProbe(void)
+static int qemudProbe(void)
{
if ((virFileExists("/usr/bin/qemu")) ||
(virFileExists("/usr/bin/qemu-kvm")) ||
- (virFileExists("/usr/bin/xenner"))) {
- if (getuid() == 0) {
- return("qemu:///system");
- } else {
- return("qemu:///session");
- }
- }
- return(NULL);
+ (virFileExists("/usr/bin/xenner")))
+ return 1;
+
+ return 0;
}
static virDrvOpenStatus qemudOpen(virConnectPtr conn,
- xmlURIPtr uri,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED) {
uid_t uid = getuid();
if (qemu_driver == NULL)
goto decline;
- if (uri == NULL || uri->scheme == NULL || uri->path == NULL)
+ if (!qemudProbe())
+ goto decline;
+
+ if (conn->uri == NULL) {
+ conn->uri = xmlParseURI(uid ? "qemu:///session" : "qemu:///system");
+ if (!conn->uri) {
+ qemudReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY,NULL);
+ return VIR_DRV_OPEN_ERROR;
+ }
+ } else if (conn->uri->scheme == NULL ||
+ conn->uri->path == NULL)
goto decline;
- if (STRNEQ (uri->scheme, "qemu"))
+ if (STRNEQ (conn->uri->scheme, "qemu"))
goto decline;
if (uid != 0) {
- if (STRNEQ (uri->path, "/session"))
+ if (STRNEQ (conn->uri->path, "/session"))
goto decline;
} else { /* root */
- if (STRNEQ (uri->path, "/system") &&
- STRNEQ (uri->path, "/session"))
+ if (STRNEQ (conn->uri->path, "/system") &&
+ STRNEQ (conn->uri->path, "/session"))
goto decline;
}
VIR_DRV_QEMU,
"QEMU",
LIBVIR_VERSION_NUMBER,
- qemudProbe, /* probe */
qemudOpen, /* open */
qemudClose, /* close */
qemudSupportsFeature, /* supports_feature */
VIR_DRV_OPEN_REMOTE_AUTOSTART = (1 << 3),
};
+/* What transport? */
+enum {
+ trans_tls,
+ trans_unix,
+ trans_ssh,
+ trans_ext,
+ trans_tcp,
+} transport;
+
+
static int
doRemoteOpen (virConnectPtr conn,
struct private_data *priv,
- xmlURIPtr uri,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags)
{
- if (!uri || !uri->scheme)
- return VIR_DRV_OPEN_DECLINED; /* Decline - not a URL. */
-
- char *transport_str = get_transport_from_scheme (uri->scheme);
-
- /* What transport? */
- enum {
- trans_tls,
- trans_unix,
- trans_ssh,
- trans_ext,
- trans_tcp,
- } transport;
-
- if (!transport_str || STRCASEEQ (transport_str, "tls"))
- transport = trans_tls;
- else if (STRCASEEQ (transport_str, "unix"))
- transport = trans_unix;
- else if (STRCASEEQ (transport_str, "ssh"))
- transport = trans_ssh;
- else if (STRCASEEQ (transport_str, "ext"))
- transport = trans_ext;
- else if (STRCASEEQ (transport_str, "tcp"))
- transport = trans_tcp;
- else {
- error (conn, VIR_ERR_INVALID_ARG,
- _("remote_open: transport in URL not recognised "
- "(should be tls|unix|ssh|ext|tcp)"));
- return VIR_DRV_OPEN_ERROR;
+ char *transport_str = NULL;
+
+ if (conn->uri) {
+ if (!conn->uri->scheme)
+ return VIR_DRV_OPEN_DECLINED;
+
+ transport_str = get_transport_from_scheme (conn->uri->scheme);
+
+ if (!transport_str || STRCASEEQ (transport_str, "tls"))
+ transport = trans_tls;
+ else if (STRCASEEQ (transport_str, "unix"))
+ transport = trans_unix;
+ else if (STRCASEEQ (transport_str, "ssh"))
+ transport = trans_ssh;
+ else if (STRCASEEQ (transport_str, "ext"))
+ transport = trans_ext;
+ else if (STRCASEEQ (transport_str, "tcp"))
+ transport = trans_tcp;
+ else {
+ error (conn, VIR_ERR_INVALID_ARG,
+ _("remote_open: transport in URL not recognised "
+ "(should be tls|unix|ssh|ext|tcp)"));
+ return VIR_DRV_OPEN_ERROR;
+ }
}
- if (!uri->server && !transport_str) {
- if (flags & VIR_DRV_OPEN_REMOTE_UNIX)
+ if (!transport_str) {
+ if ((!conn->uri || !conn->uri->server) &&
+ (flags & VIR_DRV_OPEN_REMOTE_UNIX))
transport = trans_unix;
else
return VIR_DRV_OPEN_DECLINED; /* Decline - not a remote URL. */
int retcode = VIR_DRV_OPEN_ERROR;
/* Remote server defaults to "localhost" if not specified. */
- if (uri->port != 0) {
- if (asprintf (&port, "%d", uri->port) == -1) goto out_of_memory;
+ if (conn->uri && conn->uri->port != 0) {
+ if (asprintf (&port, "%d", conn->uri->port) == -1) goto out_of_memory;
} else if (transport == trans_tls) {
port = strdup (LIBVIRTD_TLS_PORT);
if (!port) goto out_of_memory;
port = NULL; /* Port not used for unix, ext. */
- priv->hostname = strdup (uri->server ? uri->server : "localhost");
+ priv->hostname = strdup (conn->uri && conn->uri->server ?
+ conn->uri->server : "localhost");
if (!priv->hostname)
goto out_of_memory;
- if (uri->user) {
- username = strdup (uri->user);
+ if (conn->uri && conn->uri->user) {
+ username = strdup (conn->uri->user);
if (!username)
goto out_of_memory;
}
struct qparam *var;
int i;
char *query;
-#ifdef HAVE_XMLURI_QUERY_RAW
- query = uri->query_raw;
-#else
- query = uri->query;
-#endif
- vars = qparam_query_parse (query);
- if (vars == NULL) goto failed;
-
- for (i = 0; i < vars->n; i++) {
- var = &vars->p[i];
- if (STRCASEEQ (var->name, "name")) {
- name = strdup (var->value);
- if (!name) goto out_of_memory;
- var->ignore = 1;
- } else if (STRCASEEQ (var->name, "command")) {
- command = strdup (var->value);
- if (!command) goto out_of_memory;
- var->ignore = 1;
- } else if (STRCASEEQ (var->name, "socket")) {
- sockname = strdup (var->value);
- if (!sockname) goto out_of_memory;
- var->ignore = 1;
- } else if (STRCASEEQ (var->name, "auth")) {
- authtype = strdup (var->value);
- if (!authtype) goto out_of_memory;
- var->ignore = 1;
- } else if (STRCASEEQ (var->name, "netcat")) {
- netcat = strdup (var->value);
- if (!netcat) goto out_of_memory;
- var->ignore = 1;
- } else if (STRCASEEQ (var->name, "no_verify")) {
- no_verify = atoi (var->value);
- var->ignore = 1;
- } else if (STRCASEEQ (var->name, "no_tty")) {
- no_tty = atoi (var->value);
- var->ignore = 1;
- } else if (STRCASEEQ (var->name, "debug")) {
- if (var->value &&
- STRCASEEQ (var->value, "stdout"))
- priv->debugLog = stdout;
- else
- priv->debugLog = stderr;
- } else
- DEBUG("passing through variable '%s' ('%s') to remote end",
- var->name, var->value);
- }
+ if (conn->uri) {
#ifdef HAVE_XMLURI_QUERY_RAW
- xmlFree (uri->query_raw);
+ query = conn->uri->query_raw;
#else
- xmlFree (uri->query);
+ query = conn->uri->query;
#endif
+ vars = qparam_query_parse (query);
+ if (vars == NULL) goto failed;
+
+ for (i = 0; i < vars->n; i++) {
+ var = &vars->p[i];
+ if (STRCASEEQ (var->name, "name")) {
+ name = strdup (var->value);
+ if (!name) goto out_of_memory;
+ var->ignore = 1;
+ } else if (STRCASEEQ (var->name, "command")) {
+ command = strdup (var->value);
+ if (!command) goto out_of_memory;
+ var->ignore = 1;
+ } else if (STRCASEEQ (var->name, "socket")) {
+ sockname = strdup (var->value);
+ if (!sockname) goto out_of_memory;
+ var->ignore = 1;
+ } else if (STRCASEEQ (var->name, "auth")) {
+ authtype = strdup (var->value);
+ if (!authtype) goto out_of_memory;
+ var->ignore = 1;
+ } else if (STRCASEEQ (var->name, "netcat")) {
+ netcat = strdup (var->value);
+ if (!netcat) goto out_of_memory;
+ var->ignore = 1;
+ } else if (STRCASEEQ (var->name, "no_verify")) {
+ no_verify = atoi (var->value);
+ var->ignore = 1;
+ } else if (STRCASEEQ (var->name, "no_tty")) {
+ no_tty = atoi (var->value);
+ var->ignore = 1;
+ } else if (STRCASEEQ (var->name, "debug")) {
+ if (var->value &&
+ STRCASEEQ (var->value, "stdout"))
+ priv->debugLog = stdout;
+ else
+ priv->debugLog = stderr;
+ } else
+ DEBUG("passing through variable '%s' ('%s') to remote end",
+ var->name, var->value);
+ }
+ /* Construct the original name. */
+ if (!name) {
+ xmlURI tmpuri = {
+ .scheme = conn->uri->scheme,
#ifdef HAVE_XMLURI_QUERY_RAW
- uri->query_raw =
+ .query_raw = qparam_get_query (vars),
#else
- uri->query =
+ .query = qparam_get_query (vars),
#endif
- qparam_get_query (vars);
-
- free_qparam_set (vars);
+ .path = conn->uri->path,
+ .fragment = conn->uri->fragment,
+ };
+
+ /* Evil, blank out transport scheme temporarily */
+ if (transport_str) {
+ assert (transport_str[-1] == '+');
+ transport_str[-1] = '\0';
+ }
- /* For ext transport, command is required. */
- if (transport == trans_ext && !command) {
- error (conn, VIR_ERR_INVALID_ARG,
- _("remote_open: for 'ext' transport, command is required"));
- goto failed;
- }
+ name = (char *) xmlSaveUri (&tmpuri);
- /* Construct the original name. */
- if (!name) {
- /* Remove the transport (if any) from the scheme. */
- if (transport_str) {
- assert (transport_str[-1] == '+');
- transport_str[-1] = '\0';
+ /* Restore transport scheme */
+ if (transport_str)
+ transport_str[-1] = '+';
}
- /* Remove the username, server name and port number. */
- xmlFree (uri->user);
- uri->user = 0;
- xmlFree (uri->server);
- uri->server = 0;
-
- uri->port = 0;
+ free_qparam_set (vars);
+ } else {
+ /* Probe URI server side */
+ name = strdup("");
+ }
- name = (char *) xmlSaveUri (uri);
+ if (!name) {
+ error(conn, VIR_ERR_NO_MEMORY, NULL);
+ goto failed;
}
- assert (name);
DEBUG("proceeding with name = %s", name);
+ /* For ext transport, command is required. */
+ if (transport == trans_ext && !command) {
+ error (conn, VIR_ERR_INVALID_ARG,
+ _("remote_open: for 'ext' transport, command is required"));
+ goto failed;
+ }
+
/* Connect to the remote service. */
switch (transport) {
case trans_tls:
(xdrproc_t) xdr_void, (char *) NULL) == -1)
goto failed;
+ /* Now try and find out what URI the daemon used */
+ if (conn->uri == NULL) {
+ remote_get_uri_ret uriret;
+ int urierr;
+
+ memset (&uriret, 0, sizeof uriret);
+ urierr = call (conn, priv,
+ REMOTE_CALL_IN_OPEN | REMOTE_CALL_QUIET_MISSING_RPC,
+ REMOTE_PROC_GET_URI,
+ (xdrproc_t) xdr_void, (char *) NULL,
+ (xdrproc_t) xdr_remote_get_uri_ret, (char *) &uriret);
+ if (urierr == -2) {
+ /* Should not really happen, since we only probe local libvirtd's,
+ & the library should always match the daemon. Only case is post
+ RPM upgrade where an old daemon instance is still running with
+ new client. Too bad. It is not worth the hassle to fix this */
+ error (conn, VIR_ERR_INTERNAL_ERROR, _("unable to auto-detect URI"));
+ goto failed;
+ }
+ if (urierr == -1) {
+ goto failed;
+ }
+
+ DEBUG("Auto-probed URI is %s", uriret.uri);
+ conn->uri = xmlParseURI(uriret.uri);
+ VIR_FREE(uriret.uri);
+ if (!conn->uri) {
+ error (conn, VIR_ERR_NO_MEMORY, NULL);
+ goto failed;
+ }
+ }
+
if(VIR_ALLOC(priv->callbackList)<0) {
error(conn, VIR_ERR_INVALID_ARG, _("Error allocating callbacks list"));
goto failed;
static int
remoteOpen (virConnectPtr conn,
- xmlURIPtr uri,
virConnectAuthPtr auth,
int flags)
{
if (flags & VIR_CONNECT_RO)
rflags |= VIR_DRV_OPEN_REMOTE_RO;
-#if WITH_QEMU
- if (uri &&
- uri->scheme && STREQ (uri->scheme, "qemu") &&
- (!uri->server || STREQ (uri->server, "")) &&
- uri->path) {
- if (STREQ (uri->path, "/system")) {
- rflags |= VIR_DRV_OPEN_REMOTE_UNIX;
- } else if (STREQ (uri->path, "/session")) {
- rflags |= VIR_DRV_OPEN_REMOTE_UNIX;
- if (getuid() > 0) {
- rflags |= VIR_DRV_OPEN_REMOTE_USER;
- rflags |= VIR_DRV_OPEN_REMOTE_AUTOSTART;
- }
- }
- }
-#endif
-#if WITH_XEN
- if (uri &&
- uri->scheme && STREQ (uri->scheme, "xen") &&
- (!uri->server || STREQ (uri->server, "")) &&
- (!uri->path || STREQ(uri->path, "/"))) {
+ /*
+ * If no servername is given, and no +XXX
+ * transport is listed, then force to a
+ * local UNIX socket connection
+ */
+ if (conn->uri &&
+ !conn->uri->server &&
+ !strchr(conn->uri->scheme, '+')) {
+ DEBUG0("Auto-remote UNIX socket");
rflags |= VIR_DRV_OPEN_REMOTE_UNIX;
}
-#endif
-#if WITH_LXC
- if (uri &&
- uri->scheme && STREQ (uri->scheme, "lxc")) {
+
+ /*
+ * If no servername is given, and no +XXX
+ * transport is listed, or transport is unix,
+ * and path is /session, and uid is unprivileged
+ * then auto-spawn a daemon.
+ */
+ if (conn->uri &&
+ !conn->uri->server &&
+ conn->uri->path &&
+ ((strchr(conn->uri->scheme, '+') == 0)||
+ (strstr(conn->uri->scheme, "+unix") != NULL)) &&
+ STREQ(conn->uri->path, "/session") &&
+ getuid() > 0) {
+ DEBUG0("Auto-spawn user daemon instance");
+ rflags |= VIR_DRV_OPEN_REMOTE_USER;
+ rflags |= VIR_DRV_OPEN_REMOTE_AUTOSTART;
+ }
+
+ /*
+ * If URI is NULL, then do a UNIX connection
+ * possibly auto-spawning unprivileged server
+ * and probe remote server for URI
+ */
+ if (!conn->uri) {
+ DEBUG0("Auto-probe remote URI");
rflags |= VIR_DRV_OPEN_REMOTE_UNIX;
+ if (getuid() > 0) {
+ DEBUG0("Auto-spawn user daemon instance");
+ rflags |= VIR_DRV_OPEN_REMOTE_USER;
+ rflags |= VIR_DRV_OPEN_REMOTE_AUTOSTART;
+ }
}
-#endif
priv->magic = DEAD;
priv->sock = -1;
- ret = doRemoteOpen(conn, priv, uri, auth, rflags);
+ ret = doRemoteOpen(conn, priv, auth, rflags);
if (ret != VIR_DRV_OPEN_SUCCESS) {
conn->privateData = NULL;
VIR_FREE(priv);
static int
remoteNetworkOpen (virConnectPtr conn,
- xmlURIPtr uri,
virConnectAuthPtr auth,
int flags)
{
priv->magic = DEAD;
priv->sock = -1;
- ret = doRemoteOpen(conn, priv, uri, auth, rflags);
+ ret = doRemoteOpen(conn, priv, auth, rflags);
if (ret != VIR_DRV_OPEN_SUCCESS) {
conn->networkPrivateData = NULL;
VIR_FREE(priv);
static int
remoteStorageOpen (virConnectPtr conn,
- xmlURIPtr uri,
virConnectAuthPtr auth,
int flags)
{
priv->magic = DEAD;
priv->sock = -1;
- ret = doRemoteOpen(conn, priv, uri, auth, rflags);
+ ret = doRemoteOpen(conn, priv, auth, rflags);
if (ret != VIR_DRV_OPEN_SUCCESS) {
conn->storagePrivateData = NULL;
VIR_FREE(priv);
.no = VIR_DRV_REMOTE,
.name = "remote",
.ver = REMOTE_PROTOCOL_VERSION,
- .probe = NULL,
.open = remoteOpen,
.close = remoteClose,
.supports_feature = remoteSupportsFeature,
static virDrvOpenStatus
storageOpen(virConnectPtr conn,
- xmlURIPtr uri ATTRIBUTE_UNUSED,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED) {
if (!driverState)
static int testOpen(virConnectPtr conn,
- xmlURIPtr uri,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
{
int ret;
- if (!uri)
+ if (!conn->uri)
return VIR_DRV_OPEN_DECLINED;
- if (!uri->scheme || STRNEQ(uri->scheme, "test"))
+ if (!conn->uri->scheme || STRNEQ(conn->uri->scheme, "test"))
return VIR_DRV_OPEN_DECLINED;
/* Remote driver should handle these. */
- if (uri->server)
+ if (conn->uri->server)
return VIR_DRV_OPEN_DECLINED;
- if (uri->server)
+ if (conn->uri->server)
return VIR_DRV_OPEN_DECLINED;
/* From this point on, the connection is for us. */
- if (!uri->path
- || uri->path[0] == '\0'
- || (uri->path[0] == '/' && uri->path[1] == '\0')) {
+ if (!conn->uri->path
+ || conn->uri->path[0] == '\0'
+ || (conn->uri->path[0] == '/' && conn->uri->path[1] == '\0')) {
testError (NULL, VIR_ERR_INVALID_ARG,
"%s", _("testOpen: supply a path or use test:///default"));
return VIR_DRV_OPEN_ERROR;
}
- if (STREQ(uri->path, "/default"))
+ if (STREQ(conn->uri->path, "/default"))
ret = testOpenDefault(conn);
else
ret = testOpenFromFile(conn,
- uri->path);
+ conn->uri->path);
return (ret);
}
return str;
}
-static char * testGetURI (virConnectPtr conn)
-{
- char *uri;
- GET_CONNECTION(conn);
-
- if (asprintf (&uri, "test://%s", privconn->path) == -1) {
- testError (conn, VIR_ERR_SYSTEM_ERROR, "%s",
- strerror (errno));
- return NULL;
- }
- return uri;
-}
-
static int testGetMaxVCPUs(virConnectPtr conn ATTRIBUTE_UNUSED,
const char *type ATTRIBUTE_UNUSED)
{
}
static virDrvOpenStatus testOpenNetwork(virConnectPtr conn,
- xmlURIPtr uri ATTRIBUTE_UNUSED,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED) {
if (STRNEQ(conn->driver->name, "Test"))
}
static virDrvOpenStatus testStorageOpen(virConnectPtr conn,
- xmlURIPtr uri ATTRIBUTE_UNUSED,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED) {
if (STRNEQ(conn->driver->name, "Test"))
VIR_DRV_TEST,
"Test",
LIBVIR_VERSION_NUMBER,
- NULL, /* probe */
testOpen, /* open */
testClose, /* close */
NULL, /* supports_feature */
NULL, /* type */
testGetVersion, /* version */
testGetHostname, /* hostname */
- testGetURI, /* URI */
+ NULL, /* URI */
testGetMaxVCPUs, /* getMaxVcpus */
testNodeGetInfo, /* nodeGetInfo */
testGetCapabilities, /* getCapabilities */
*/
int
xenHypervisorOpen(virConnectPtr conn,
- xmlURIPtr uri ATTRIBUTE_UNUSED,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
{
xenHypervisorDomainGetOSType (virDomainPtr dom);
int xenHypervisorOpen (virConnectPtr conn,
- xmlURIPtr uri,
virConnectAuthPtr auth,
int flags);
int xenHypervisorClose (virConnectPtr conn);
* in the low level drivers directly.
*/
-static const char *
+static int
xenUnifiedProbe (void)
{
#ifdef __linux__
if (virFileExists("/proc/xen"))
- return("xen:///");
+ return 1;
#endif
#ifdef __sun__
FILE *fh;
if (fh = fopen("/dev/xen/domcaps", "r")) {
fclose(fh);
- return("xen:///");
+ return 1;
}
#endif
- return(NULL);
+ return 0;
}
static int
-xenUnifiedOpen (virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int flags)
+xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, int flags)
{
int i, ret = VIR_DRV_OPEN_DECLINED;
xenUnifiedPrivatePtr priv;
+ if (conn->uri == NULL) {
+ if (!xenUnifiedProbe())
+ return VIR_DRV_OPEN_DECLINED;
+
+ conn->uri = xmlParseURI("xen:///");
+ if (!conn->uri) {
+ xenUnifiedError (NULL, VIR_ERR_NO_MEMORY, NULL);
+ return VIR_DRV_OPEN_ERROR;
+ }
+ }
+
/* Refuse any scheme which isn't "xen://" or "http://". */
- if (uri->scheme &&
- STRCASENEQ(uri->scheme, "xen") &&
- STRCASENEQ(uri->scheme, "http"))
+ if (conn->uri->scheme &&
+ STRCASENEQ(conn->uri->scheme, "xen") &&
+ STRCASENEQ(conn->uri->scheme, "http"))
return VIR_DRV_OPEN_DECLINED;
/* xmlParseURI will parse a naked string like "foo" as a URI with
* allow full pathnames (eg. ///var/lib/xen/xend-socket). Decline
* anything else.
*/
- if (!uri->scheme && (!uri->path || uri->path[0] != '/'))
+ if (!conn->uri->scheme && (!conn->uri->path || conn->uri->path[0] != '/'))
return VIR_DRV_OPEN_DECLINED;
/* Refuse any xen:// URI with a server specified - allow remote to do it */
- if (uri->scheme && STRCASEEQ(uri->scheme, "xen") && uri->server)
+ if (conn->uri->scheme && STRCASEEQ(conn->uri->scheme, "xen") && conn->uri->server)
return VIR_DRV_OPEN_DECLINED;
/* Allocate per-connection private data. */
/* Hypervisor is only run as root & required to succeed */
if (getuid() == 0) {
DEBUG0("Trying hypervisor sub-driver");
- if (drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->open(conn, uri, auth, flags) ==
+ if (drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
DEBUG0("Activated hypervisor sub-driver");
priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] = 1;
* If it fails as non-root, then the proxy driver may take over
*/
DEBUG0("Trying XenD sub-driver");
- if (drivers[XEN_UNIFIED_XEND_OFFSET]->open(conn, uri, auth, flags) ==
+ if (drivers[XEN_UNIFIED_XEND_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
DEBUG0("Activated XenD sub-driver");
priv->opened[XEN_UNIFIED_XEND_OFFSET] = 1;
* succeed if root, optional otherwise */
if (priv->xendConfigVersion <= 2) {
DEBUG0("Trying XM sub-driver");
- if (drivers[XEN_UNIFIED_XM_OFFSET]->open(conn, uri, auth, flags) ==
+ if (drivers[XEN_UNIFIED_XM_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
DEBUG0("Activated XM sub-driver");
priv->opened[XEN_UNIFIED_XM_OFFSET] = 1;
}
}
DEBUG0("Trying XS sub-driver");
- if (drivers[XEN_UNIFIED_XS_OFFSET]->open(conn, uri, auth, flags) ==
+ if (drivers[XEN_UNIFIED_XS_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
DEBUG0("Activated XS sub-driver");
priv->opened[XEN_UNIFIED_XS_OFFSET] = 1;
} else {
#if WITH_PROXY
DEBUG0("Trying proxy sub-driver");
- if (drivers[XEN_UNIFIED_PROXY_OFFSET]->open(conn, uri, auth, flags) ==
+ if (drivers[XEN_UNIFIED_PROXY_OFFSET]->open(conn, auth, flags) ==
VIR_DRV_OPEN_SUCCESS) {
DEBUG0("Activated proxy sub-driver");
priv->opened[XEN_UNIFIED_PROXY_OFFSET] = 1;
.no = VIR_DRV_XEN_UNIFIED,
.name = "Xen",
.ver = HV_VERSION,
- .probe = xenUnifiedProbe,
.open = xenUnifiedOpen,
.close = xenUnifiedClose,
.supports_feature = xenUnifiedSupportsFeature,
*/
int
xenDaemonOpen(virConnectPtr conn,
- xmlURIPtr uri,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
{
/* Switch on the scheme, which we expect to be NULL (file),
* "http" or "xen".
*/
- if (uri->scheme == NULL) {
+ if (conn->uri->scheme == NULL) {
/* It should be a file access */
- if (uri->path == NULL) {
+ if (conn->uri->path == NULL) {
virXendError(NULL, VIR_ERR_NO_CONNECT, __FUNCTION__);
goto failed;
}
- ret = xenDaemonOpen_unix(conn, uri->path);
+ ret = xenDaemonOpen_unix(conn, conn->uri->path);
if (ret < 0)
goto failed;
if (ret == -1)
goto failed;
}
- else if (STRCASEEQ (uri->scheme, "xen")) {
+ else if (STRCASEEQ (conn->uri->scheme, "xen")) {
/*
* try first to open the unix socket
*/
ret = xend_detect_config_version(conn);
if (ret == -1)
goto failed;
- } else if (STRCASEEQ (uri->scheme, "http")) {
- ret = xenDaemonOpen_tcp(conn, uri->server, uri->port);
+ } else if (STRCASEEQ (conn->uri->scheme, "http")) {
+ ret = xenDaemonOpen_tcp(conn, conn->uri->server, conn->uri->port);
if (ret < 0)
goto failed;
ret = xend_detect_config_version(conn);
/* refactored ones */
-int xenDaemonOpen(virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int flags);
+int xenDaemonOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
int xenDaemonClose(virConnectPtr conn);
int xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer);
int xenDaemonNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
*/
int
xenXMOpen (virConnectPtr conn ATTRIBUTE_UNUSED,
- xmlURIPtr uri ATTRIBUTE_UNUSED,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
{
extern struct xenUnifiedDriver xenXMDriver;
int xenXMInit (void);
-int xenXMOpen(virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int flags);
+int xenXMOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags);
int xenXMClose(virConnectPtr conn);
const char *xenXMGetType(virConnectPtr conn);
int xenXMDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info);
*/
int
xenStoreOpen(virConnectPtr conn,
- xmlURIPtr uri ATTRIBUTE_UNUSED,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED)
{
int xenStoreInit (void);
int xenStoreOpen (virConnectPtr conn,
- xmlURIPtr uri,
virConnectAuthPtr auth,
int flags);
int xenStoreClose (virConnectPtr conn);