mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
driver: allow drivers to indicate if they permit remote connections
Add a localOnly flag to the virConnectDriver struct which allows a driver to indicate whether it is local-only, or permits remote connections. Stateful drivers running inside libvirtd are generally local only. This allows us to remote the check for uri->server != NULL from most drivers. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
20ad55a8fd
commit
3714cc952d
@ -205,9 +205,6 @@ bhyveConnectOpen(virConnectPtr conn,
|
|||||||
if (!conn->uri->scheme || STRNEQ(conn->uri->scheme, "bhyve"))
|
if (!conn->uri->scheme || STRNEQ(conn->uri->scheme, "bhyve"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
if (conn->uri->server)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if (STRNEQ_NULLABLE(conn->uri->path, "/system")) {
|
if (STRNEQ_NULLABLE(conn->uri->path, "/system")) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unexpected bhyve URI path '%s', try bhyve:///system"),
|
_("Unexpected bhyve URI path '%s', try bhyve:///system"),
|
||||||
@ -1738,6 +1735,7 @@ static virHypervisorDriver bhyveHypervisorDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virConnectDriver bhyveConnectDriver = {
|
static virConnectDriver bhyveConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &bhyveHypervisorDriver,
|
.hypervisorDriver = &bhyveHypervisorDriver,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ my %whitelist = (
|
|||||||
"interfaceOpen" => 1,
|
"interfaceOpen" => 1,
|
||||||
"interfaceClose" => 1,
|
"interfaceClose" => 1,
|
||||||
"connectURIProbe" => 1,
|
"connectURIProbe" => 1,
|
||||||
|
"localOnly" => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
# Temp hack - remove it once xen driver is fixed
|
# Temp hack - remove it once xen driver is fixed
|
||||||
|
@ -79,6 +79,8 @@ typedef struct _virConnectDriver virConnectDriver;
|
|||||||
typedef virConnectDriver *virConnectDriverPtr;
|
typedef virConnectDriver *virConnectDriverPtr;
|
||||||
|
|
||||||
struct _virConnectDriver {
|
struct _virConnectDriver {
|
||||||
|
/* Wether driver permits a server in the URI */
|
||||||
|
bool localOnly;
|
||||||
virHypervisorDriverPtr hypervisorDriver;
|
virHypervisorDriverPtr hypervisorDriver;
|
||||||
virInterfaceDriverPtr interfaceDriver;
|
virInterfaceDriverPtr interfaceDriver;
|
||||||
virNetworkDriverPtr networkDriver;
|
virNetworkDriverPtr networkDriver;
|
||||||
|
@ -167,10 +167,6 @@ netcfConnectOpen(virConnectPtr conn,
|
|||||||
if (STRNEQ_NULLABLE(conn->uri->scheme, "interface"))
|
if (STRNEQ_NULLABLE(conn->uri->scheme, "interface"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Leave for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if (driver == NULL) {
|
if (driver == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("interface state driver is not active"));
|
_("interface state driver is not active"));
|
||||||
@ -1224,6 +1220,7 @@ static virHypervisorDriver interfaceHypervisorDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virConnectDriver interfaceConnectDriver = {
|
static virConnectDriver interfaceConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &interfaceHypervisorDriver,
|
.hypervisorDriver = &interfaceHypervisorDriver,
|
||||||
.interfaceDriver = &interfaceDriver,
|
.interfaceDriver = &interfaceDriver,
|
||||||
};
|
};
|
||||||
|
@ -1211,10 +1211,6 @@ udevConnectOpen(virConnectPtr conn,
|
|||||||
if (STRNEQ_NULLABLE(conn->uri->scheme, "interface"))
|
if (STRNEQ_NULLABLE(conn->uri->scheme, "interface"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Leave for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if (driver == NULL) {
|
if (driver == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("interface state driver is not active"));
|
_("interface state driver is not active"));
|
||||||
@ -1295,6 +1291,7 @@ static virHypervisorDriver udevHypervisorDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virConnectDriver udevConnectDriver = {
|
static virConnectDriver udevConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &udevHypervisorDriver,
|
.hypervisorDriver = &udevHypervisorDriver,
|
||||||
.interfaceDriver = &udevIfaceDriver,
|
.interfaceDriver = &udevIfaceDriver,
|
||||||
};
|
};
|
||||||
|
@ -1068,6 +1068,11 @@ virConnectOpenInternal(const char *name,
|
|||||||
VIR_DEBUG("trying driver %zu (%s) ...",
|
VIR_DEBUG("trying driver %zu (%s) ...",
|
||||||
i, virConnectDriverTab[i]->hypervisorDriver->name);
|
i, virConnectDriverTab[i]->hypervisorDriver->name);
|
||||||
|
|
||||||
|
if (virConnectDriverTab[i]->localOnly && ret->uri && ret->uri->server) {
|
||||||
|
VIR_DEBUG("Server present, skipping local only driver");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
ret->driver = virConnectDriverTab[i]->hypervisorDriver;
|
ret->driver = virConnectDriverTab[i]->hypervisorDriver;
|
||||||
ret->interfaceDriver = virConnectDriverTab[i]->interfaceDriver;
|
ret->interfaceDriver = virConnectDriverTab[i]->interfaceDriver;
|
||||||
ret->networkDriver = virConnectDriverTab[i]->networkDriver;
|
ret->networkDriver = virConnectDriverTab[i]->networkDriver;
|
||||||
|
@ -852,10 +852,6 @@ libxlConnectOpen(virConnectPtr conn,
|
|||||||
if (conn->uri->scheme == NULL || STRNEQ(conn->uri->scheme, "xen"))
|
if (conn->uri->scheme == NULL || STRNEQ(conn->uri->scheme, "xen"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* If server name is given, its for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
/* Error if xen or libxl scheme specified but driver not started. */
|
/* Error if xen or libxl scheme specified but driver not started. */
|
||||||
if (libxl_driver == NULL) {
|
if (libxl_driver == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
@ -6582,6 +6578,7 @@ static virHypervisorDriver libxlHypervisorDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virConnectDriver libxlConnectDriver = {
|
static virConnectDriver libxlConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &libxlHypervisorDriver,
|
.hypervisorDriver = &libxlHypervisorDriver,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -177,10 +177,6 @@ static virDrvOpenStatus lxcConnectOpen(virConnectPtr conn,
|
|||||||
STRNEQ(conn->uri->scheme, "lxc"))
|
STRNEQ(conn->uri->scheme, "lxc"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Leave for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
/* If path isn't '/' then they typoed, tell them correct path */
|
/* If path isn't '/' then they typoed, tell them correct path */
|
||||||
if (conn->uri->path != NULL &&
|
if (conn->uri->path != NULL &&
|
||||||
STRNEQ(conn->uri->path, "/") &&
|
STRNEQ(conn->uri->path, "/") &&
|
||||||
@ -5637,6 +5633,7 @@ static virHypervisorDriver lxcHypervisorDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virConnectDriver lxcConnectDriver = {
|
static virConnectDriver lxcConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &lxcHypervisorDriver,
|
.hypervisorDriver = &lxcHypervisorDriver,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -886,10 +886,6 @@ networkConnectOpen(virConnectPtr conn,
|
|||||||
if (STRNEQ_NULLABLE(conn->uri->scheme, "network"))
|
if (STRNEQ_NULLABLE(conn->uri->scheme, "network"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Leave for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if (network_driver == NULL) {
|
if (network_driver == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("network state driver is not active"));
|
_("network state driver is not active"));
|
||||||
@ -5616,6 +5612,7 @@ static virHypervisorDriver networkHypervisorDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virConnectDriver networkConnectDriver = {
|
static virConnectDriver networkConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &networkHypervisorDriver,
|
.hypervisorDriver = &networkHypervisorDriver,
|
||||||
.networkDriver = &networkDriver,
|
.networkDriver = &networkDriver,
|
||||||
};
|
};
|
||||||
|
@ -62,10 +62,6 @@ nodeConnectOpen(virConnectPtr conn,
|
|||||||
if (STRNEQ_NULLABLE(conn->uri->scheme, "nodedev"))
|
if (STRNEQ_NULLABLE(conn->uri->scheme, "nodedev"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Leave for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if (driver == NULL) {
|
if (driver == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("nodedev state driver is not active"));
|
_("nodedev state driver is not active"));
|
||||||
|
@ -783,6 +783,7 @@ static virHypervisorDriver halHypervisorDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virConnectDriver halConnectDriver = {
|
static virConnectDriver halConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &halHypervisorDriver,
|
.hypervisorDriver = &halHypervisorDriver,
|
||||||
.nodeDeviceDriver = &halNodeDeviceDriver,
|
.nodeDeviceDriver = &halNodeDeviceDriver,
|
||||||
};
|
};
|
||||||
|
@ -1957,6 +1957,7 @@ static virHypervisorDriver udevHypervisorDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virConnectDriver udevConnectDriver = {
|
static virConnectDriver udevConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &udevHypervisorDriver,
|
.hypervisorDriver = &udevHypervisorDriver,
|
||||||
.nodeDeviceDriver = &udevNodeDeviceDriver,
|
.nodeDeviceDriver = &udevNodeDeviceDriver,
|
||||||
};
|
};
|
||||||
|
@ -379,10 +379,6 @@ nwfilterConnectOpen(virConnectPtr conn,
|
|||||||
if (STRNEQ_NULLABLE(conn->uri->scheme, "nwfilter"))
|
if (STRNEQ_NULLABLE(conn->uri->scheme, "nwfilter"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Leave for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if (driver == NULL) {
|
if (driver == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("nwfilter state driver is not active"));
|
_("nwfilter state driver is not active"));
|
||||||
@ -712,6 +708,7 @@ static virHypervisorDriver nwfilterHypervisorDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virConnectDriver nwfilterConnectDriver = {
|
static virConnectDriver nwfilterConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &nwfilterHypervisorDriver,
|
.hypervisorDriver = &nwfilterHypervisorDriver,
|
||||||
.nwfilterDriver = &nwfilterDriver,
|
.nwfilterDriver = &nwfilterDriver,
|
||||||
};
|
};
|
||||||
|
@ -1362,10 +1362,6 @@ static virDrvOpenStatus openvzConnectOpen(virConnectPtr conn,
|
|||||||
STRNEQ(conn->uri->scheme, "openvz"))
|
STRNEQ(conn->uri->scheme, "openvz"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* If server name is given, its for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
/* If path isn't /system, then they typoed, so tell them correct path */
|
/* If path isn't /system, then they typoed, so tell them correct path */
|
||||||
if (conn->uri->path == NULL ||
|
if (conn->uri->path == NULL ||
|
||||||
STRNEQ(conn->uri->path, "/system")) {
|
STRNEQ(conn->uri->path, "/system")) {
|
||||||
@ -2524,6 +2520,7 @@ static virHypervisorDriver openvzHypervisorDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virConnectDriver openvzConnectDriver = {
|
static virConnectDriver openvzConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &openvzHypervisorDriver,
|
.hypervisorDriver = &openvzHypervisorDriver,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1153,12 +1153,6 @@ static virDrvOpenStatus qemuConnectOpen(virConnectPtr conn,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allow remote driver to deal with URIs with hostname server */
|
|
||||||
if (conn->uri->server != NULL) {
|
|
||||||
ret = VIR_DRV_OPEN_DECLINED;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qemu_driver == NULL) {
|
if (qemu_driver == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("qemu state driver is not active"));
|
_("qemu state driver is not active"));
|
||||||
@ -21569,6 +21563,7 @@ static virHypervisorDriver qemuHypervisorDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virConnectDriver qemuConnectDriver = {
|
static virConnectDriver qemuConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &qemuHypervisorDriver,
|
.hypervisorDriver = &qemuHypervisorDriver,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -532,10 +532,6 @@ secretConnectOpen(virConnectPtr conn,
|
|||||||
if (STRNEQ_NULLABLE(conn->uri->scheme, "secret"))
|
if (STRNEQ_NULLABLE(conn->uri->scheme, "secret"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Leave for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if (driver == NULL) {
|
if (driver == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("secret state driver is not active"));
|
_("secret state driver is not active"));
|
||||||
@ -662,6 +658,7 @@ static virHypervisorDriver secretHypervisorDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virConnectDriver secretConnectDriver = {
|
static virConnectDriver secretConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &secretHypervisorDriver,
|
.hypervisorDriver = &secretHypervisorDriver,
|
||||||
.secretDriver = &secretDriver,
|
.secretDriver = &secretDriver,
|
||||||
};
|
};
|
||||||
|
@ -392,10 +392,6 @@ storageConnectOpen(virConnectPtr conn,
|
|||||||
if (STRNEQ_NULLABLE(conn->uri->scheme, "storage"))
|
if (STRNEQ_NULLABLE(conn->uri->scheme, "storage"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Leave for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if (driver == NULL) {
|
if (driver == NULL) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("storage state driver is not active"));
|
_("storage state driver is not active"));
|
||||||
@ -2855,6 +2851,7 @@ static virHypervisorDriver storageHypervisorDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virConnectDriver storageConnectDriver = {
|
static virConnectDriver storageConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &storageHypervisorDriver,
|
.hypervisorDriver = &storageHypervisorDriver,
|
||||||
.storageDriver = &storageDriver,
|
.storageDriver = &storageDriver,
|
||||||
};
|
};
|
||||||
|
@ -1460,10 +1460,6 @@ testConnectOpen(virConnectPtr conn,
|
|||||||
if (!conn->uri->scheme || STRNEQ(conn->uri->scheme, "test"))
|
if (!conn->uri->scheme || STRNEQ(conn->uri->scheme, "test"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Remote driver should handle these. */
|
|
||||||
if (conn->uri->server)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
/* From this point on, the connection is for us. */
|
/* From this point on, the connection is for us. */
|
||||||
if (!conn->uri->path
|
if (!conn->uri->path
|
||||||
|| conn->uri->path[0] == '\0'
|
|| conn->uri->path[0] == '\0'
|
||||||
@ -7065,6 +7061,7 @@ static virNodeDeviceDriver testNodeDeviceDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virConnectDriver testConnectDriver = {
|
static virConnectDriver testConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &testHypervisorDriver,
|
.hypervisorDriver = &testHypervisorDriver,
|
||||||
.interfaceDriver = &testInterfaceDriver,
|
.interfaceDriver = &testInterfaceDriver,
|
||||||
.networkDriver = &testNetworkDriver,
|
.networkDriver = &testNetworkDriver,
|
||||||
|
@ -1210,11 +1210,6 @@ static virDrvOpenStatus umlConnectOpen(virConnectPtr conn,
|
|||||||
STRNEQ(conn->uri->scheme, "uml"))
|
STRNEQ(conn->uri->scheme, "uml"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Allow remote driver to deal with URIs with hostname server */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
|
|
||||||
/* Check path and tell them correct path if they made a mistake */
|
/* Check path and tell them correct path if they made a mistake */
|
||||||
if (uml_driver->privileged) {
|
if (uml_driver->privileged) {
|
||||||
if (STRNEQ(conn->uri->path, "/system") &&
|
if (STRNEQ(conn->uri->path, "/system") &&
|
||||||
@ -3018,6 +3013,7 @@ static virHypervisorDriver umlHypervisorDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virConnectDriver umlConnectDriver = {
|
static virConnectDriver umlConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = ¨HypervisorDriver,
|
.hypervisorDriver = ¨HypervisorDriver,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -524,10 +524,6 @@ vboxConnectOpen(virConnectPtr conn,
|
|||||||
STRNEQ(conn->uri->scheme, "vbox"))
|
STRNEQ(conn->uri->scheme, "vbox"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Leave for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if (conn->uri->path == NULL || STREQ(conn->uri->path, "")) {
|
if (conn->uri->path == NULL || STREQ(conn->uri->path, "")) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("no VirtualBox driver path specified (try vbox:///session)"));
|
_("no VirtualBox driver path specified (try vbox:///session)"));
|
||||||
|
@ -60,8 +60,7 @@ static virDrvOpenStatus dummyConnectOpen(virConnectPtr conn,
|
|||||||
|
|
||||||
if (conn->uri == NULL ||
|
if (conn->uri == NULL ||
|
||||||
conn->uri->scheme == NULL ||
|
conn->uri->scheme == NULL ||
|
||||||
STRNEQ(conn->uri->scheme, "vbox") ||
|
STRNEQ(conn->uri->scheme, "vbox"))
|
||||||
conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
if (conn->uri->path == NULL || STREQ(conn->uri->path, "")) {
|
if (conn->uri->path == NULL || STREQ(conn->uri->path, "")) {
|
||||||
@ -95,7 +94,10 @@ static virHypervisorDriver vboxDriverDummy = {
|
|||||||
.connectOpen = dummyConnectOpen, /* 0.6.3 */
|
.connectOpen = dummyConnectOpen, /* 0.6.3 */
|
||||||
};
|
};
|
||||||
|
|
||||||
static virConnectDriver vboxConnectDriver;
|
static virConnectDriver vboxConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
|
.hypervisorDriver = NULL,
|
||||||
|
};
|
||||||
|
|
||||||
int vboxRegister(void)
|
int vboxRegister(void)
|
||||||
{
|
{
|
||||||
|
@ -140,10 +140,6 @@ vmwareConnectOpen(virConnectPtr conn,
|
|||||||
STRNEQ(conn->uri->scheme, "vmwarefusion")))
|
STRNEQ(conn->uri->scheme, "vmwarefusion")))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* If server name is given, its for remote driver */
|
|
||||||
if (conn->uri->server != NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
/* If path isn't /session, then they typoed, so tell them correct path */
|
/* If path isn't /session, then they typoed, so tell them correct path */
|
||||||
if (conn->uri->path == NULL || STRNEQ(conn->uri->path, "/session")) {
|
if (conn->uri->path == NULL || STRNEQ(conn->uri->path, "/session")) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
@ -1271,6 +1267,7 @@ static virHypervisorDriver vmwareHypervisorDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virConnectDriver vmwareConnectDriver = {
|
static virConnectDriver vmwareConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &vmwareHypervisorDriver,
|
.hypervisorDriver = &vmwareHypervisorDriver,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -374,10 +374,6 @@ vzConnectOpen(virConnectPtr conn,
|
|||||||
if (STREQ(conn->uri->scheme, "parallels") && STRNEQ(conn->driver->name, "Parallels"))
|
if (STREQ(conn->uri->scheme, "parallels") && STRNEQ(conn->driver->name, "Parallels"))
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
/* Remote driver should handle these. */
|
|
||||||
if (conn->uri->server)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
/* From this point on, the connection is for us. */
|
/* From this point on, the connection is for us. */
|
||||||
if (STRNEQ_NULLABLE(conn->uri->path, "/system")) {
|
if (STRNEQ_NULLABLE(conn->uri->path, "/system")) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
@ -4143,6 +4139,7 @@ static virHypervisorDriver vzHypervisorDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virConnectDriver vzConnectDriver = {
|
static virConnectDriver vzConnectDriver = {
|
||||||
|
.localOnly = true,
|
||||||
.hypervisorDriver = &vzHypervisorDriver,
|
.hypervisorDriver = &vzHypervisorDriver,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user