mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
Removing probing of secondary drivers
For stateless, client side drivers, it is never correct to probe for secondary drivers. It is only ever appropriate to use the secondary driver that is associated with the hypervisor in question. As a result the ESX & HyperV drivers have both been forced to do hacks where they register no-op drivers for the ones they don't implement. For stateful, server side drivers, we always just want to use the same built-in shared driver. The exception is virtualbox which is really a stateless driver and so wants to use its own server side secondary drivers. To deal with this virtualbox has to be built as 3 separate loadable modules to allow registration to work in the right order. This can all be simplified by introducing a new struct recording the precise set of secondary drivers each hypervisor driver wants struct _virConnectDriver { virHypervisorDriverPtr hypervisorDriver; virInterfaceDriverPtr interfaceDriver; virNetworkDriverPtr networkDriver; virNodeDeviceDriverPtr nodeDeviceDriver; virNWFilterDriverPtr nwfilterDriver; virSecretDriverPtr secretDriver; virStorageDriverPtr storageDriver; }; Instead of registering the hypervisor driver, we now just register a virConnectDriver instead. This allows us to remove all probing of secondary drivers. Once we have chosen the primary driver, we immediately know the correct secondary drivers to use. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
220c01aa0a
commit
55ea7be7d9
@ -334,12 +334,7 @@ static void daemonInitialize(void)
|
|||||||
* priority when calling virStateInitialize. We must register the
|
* priority when calling virStateInitialize. We must register the
|
||||||
* network, storage and nodedev drivers before any stateful domain
|
* network, storage and nodedev drivers before any stateful domain
|
||||||
* driver, since their resources must be auto-started before any
|
* driver, since their resources must be auto-started before any
|
||||||
* domains can be auto-started. Moreover, some stateless drivers
|
* domains can be auto-started.
|
||||||
* implement their own subdrivers (e.g. the vbox driver has its
|
|
||||||
* own network and storage subdriers) which need to have higher
|
|
||||||
* priority. Otherwise, when connecting to such driver the generic
|
|
||||||
* subdriver may be opened instead of the one corresponding to the
|
|
||||||
* stateless driver.
|
|
||||||
*/
|
*/
|
||||||
#ifdef WITH_DRIVER_MODULES
|
#ifdef WITH_DRIVER_MODULES
|
||||||
/* We don't care if any of these fail, because the whole point
|
/* We don't care if any of these fail, because the whole point
|
||||||
@ -347,18 +342,12 @@ static void daemonInitialize(void)
|
|||||||
* If they try to open a connection for a module that
|
* If they try to open a connection for a module that
|
||||||
* is not loaded they'll get a suitable error at that point
|
* is not loaded they'll get a suitable error at that point
|
||||||
*/
|
*/
|
||||||
# ifdef WITH_VBOX
|
|
||||||
virDriverLoadModule("vbox_network");
|
|
||||||
# endif
|
|
||||||
# ifdef WITH_NETWORK
|
# ifdef WITH_NETWORK
|
||||||
virDriverLoadModule("network");
|
virDriverLoadModule("network");
|
||||||
# endif
|
# endif
|
||||||
# ifdef WITH_INTERFACE
|
# ifdef WITH_INTERFACE
|
||||||
virDriverLoadModule("interface");
|
virDriverLoadModule("interface");
|
||||||
# endif
|
# endif
|
||||||
# ifdef WITH_VBOX
|
|
||||||
virDriverLoadModule("vbox_storage");
|
|
||||||
# endif
|
|
||||||
# ifdef WITH_STORAGE
|
# ifdef WITH_STORAGE
|
||||||
virDriverLoadModule("storage");
|
virDriverLoadModule("storage");
|
||||||
# endif
|
# endif
|
||||||
@ -393,18 +382,12 @@ static void daemonInitialize(void)
|
|||||||
virDriverLoadModule("bhyve");
|
virDriverLoadModule("bhyve");
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# ifdef WITH_VBOX
|
|
||||||
vboxNetworkRegister();
|
|
||||||
# endif
|
|
||||||
# ifdef WITH_NETWORK
|
# ifdef WITH_NETWORK
|
||||||
networkRegister();
|
networkRegister();
|
||||||
# endif
|
# endif
|
||||||
# ifdef WITH_INTERFACE
|
# ifdef WITH_INTERFACE
|
||||||
interfaceRegister();
|
interfaceRegister();
|
||||||
# endif
|
# endif
|
||||||
# ifdef WITH_VBOX
|
|
||||||
vboxStorageRegister();
|
|
||||||
# endif
|
|
||||||
# ifdef WITH_STORAGE
|
# ifdef WITH_STORAGE
|
||||||
storageRegister();
|
storageRegister();
|
||||||
# endif
|
# endif
|
||||||
|
@ -539,8 +539,6 @@ DRIVER_SOURCE_FILES = \
|
|||||||
$(TEST_DRIVER_SOURCES) \
|
$(TEST_DRIVER_SOURCES) \
|
||||||
$(UML_DRIVER_SOURCES) \
|
$(UML_DRIVER_SOURCES) \
|
||||||
$(VBOX_DRIVER_SOURCES) \
|
$(VBOX_DRIVER_SOURCES) \
|
||||||
$(VBOX_NETWORK_DRIVER_SOURCES) \
|
|
||||||
$(VBOX_STORAGE_DRIVER_SOURCES) \
|
|
||||||
vbox/vbox_tmpl.c \
|
vbox/vbox_tmpl.c \
|
||||||
$(VMWARE_DRIVER_SOURCES) \
|
$(VMWARE_DRIVER_SOURCES) \
|
||||||
$(XEN_DRIVER_SOURCES) \
|
$(XEN_DRIVER_SOURCES) \
|
||||||
@ -701,15 +699,9 @@ VBOX_DRIVER_SOURCES = \
|
|||||||
vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h \
|
vbox/vbox_V4_3_4.c vbox/vbox_CAPI_v4_3_4.h \
|
||||||
vbox/vbox_common.c vbox/vbox_common.h \
|
vbox/vbox_common.c vbox/vbox_common.h \
|
||||||
vbox/vbox_uniformed_api.h \
|
vbox/vbox_uniformed_api.h \
|
||||||
vbox/vbox_get_driver.h
|
vbox/vbox_get_driver.h \
|
||||||
|
vbox/vbox_network.c \
|
||||||
VBOX_NETWORK_DRIVER_SOURCES = \
|
vbox/vbox_storage.c
|
||||||
vbox/vbox_driver.c vbox/vbox_driver.h \
|
|
||||||
vbox/vbox_network.c vbox/vbox_get_driver.h
|
|
||||||
|
|
||||||
VBOX_STORAGE_DRIVER_SOURCES = \
|
|
||||||
vbox/vbox_driver.c vbox/vbox_driver.h \
|
|
||||||
vbox/vbox_storage.c vbox/vbox_get_driver.h
|
|
||||||
|
|
||||||
VBOX_DRIVER_EXTRA_DIST = \
|
VBOX_DRIVER_EXTRA_DIST = \
|
||||||
vbox/vbox_tmpl.c vbox/README \
|
vbox/vbox_tmpl.c vbox/README \
|
||||||
@ -760,10 +752,7 @@ ESX_DRIVER_SOURCES = \
|
|||||||
esx/esx_storage_driver.c esx/esx_storage_driver.h \
|
esx/esx_storage_driver.c esx/esx_storage_driver.h \
|
||||||
esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h \
|
esx/esx_storage_backend_vmfs.c esx/esx_storage_backend_vmfs.h \
|
||||||
esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h \
|
esx/esx_storage_backend_iscsi.c esx/esx_storage_backend_iscsi.h \
|
||||||
esx/esx_device_monitor.c esx/esx_device_monitor.h \
|
|
||||||
esx/esx_secret_driver.c esx/esx_secret_driver.h \
|
|
||||||
esx/esx_stream.c esx/esx_stream.h \
|
esx/esx_stream.c esx/esx_stream.h \
|
||||||
esx/esx_nwfilter_driver.c esx/esx_nwfilter_driver.h \
|
|
||||||
esx/esx_util.c esx/esx_util.h \
|
esx/esx_util.c esx/esx_util.h \
|
||||||
esx/esx_vi.c esx/esx_vi.h \
|
esx/esx_vi.c esx/esx_vi.h \
|
||||||
esx/esx_vi_methods.c esx/esx_vi_methods.h \
|
esx/esx_vi_methods.c esx/esx_vi_methods.h \
|
||||||
@ -791,12 +780,6 @@ ESX_DRIVER_EXTRA_DIST = \
|
|||||||
HYPERV_DRIVER_SOURCES = \
|
HYPERV_DRIVER_SOURCES = \
|
||||||
hyperv/hyperv_private.h \
|
hyperv/hyperv_private.h \
|
||||||
hyperv/hyperv_driver.c hyperv/hyperv_driver.h \
|
hyperv/hyperv_driver.c hyperv/hyperv_driver.h \
|
||||||
hyperv/hyperv_interface_driver.c hyperv/hyperv_interface_driver.h \
|
|
||||||
hyperv/hyperv_network_driver.c hyperv/hyperv_network_driver.h \
|
|
||||||
hyperv/hyperv_storage_driver.c hyperv/hyperv_storage_driver.h \
|
|
||||||
hyperv/hyperv_device_monitor.c hyperv/hyperv_device_monitor.h \
|
|
||||||
hyperv/hyperv_secret_driver.c hyperv/hyperv_secret_driver.h \
|
|
||||||
hyperv/hyperv_nwfilter_driver.c hyperv/hyperv_nwfilter_driver.h \
|
|
||||||
hyperv/hyperv_util.c hyperv/hyperv_util.h \
|
hyperv/hyperv_util.c hyperv/hyperv_util.h \
|
||||||
hyperv/hyperv_wmi.c hyperv/hyperv_wmi.h \
|
hyperv/hyperv_wmi.c hyperv/hyperv_wmi.h \
|
||||||
hyperv/hyperv_wmi_classes.c hyperv/hyperv_wmi_classes.h \
|
hyperv/hyperv_wmi_classes.c hyperv/hyperv_wmi_classes.h \
|
||||||
@ -1180,33 +1163,19 @@ endif WITH_VMWARE
|
|||||||
|
|
||||||
if WITH_VBOX
|
if WITH_VBOX
|
||||||
noinst_LTLIBRARIES += \
|
noinst_LTLIBRARIES += \
|
||||||
libvirt_driver_vbox_impl.la \
|
libvirt_driver_vbox_impl.la
|
||||||
libvirt_driver_vbox_network_impl.la \
|
|
||||||
libvirt_driver_vbox_storage_impl.la
|
|
||||||
libvirt_driver_vbox_la_SOURCES =
|
libvirt_driver_vbox_la_SOURCES =
|
||||||
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
|
libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
|
||||||
libvirt_driver_vbox_network_la_SOURCES =
|
|
||||||
libvirt_driver_vbox_network_la_LIBADD = libvirt_driver_vbox_network_impl.la
|
|
||||||
libvirt_driver_vbox_storage_la_SOURCES =
|
|
||||||
libvirt_driver_vbox_storage_la_LIBADD = libvirt_driver_vbox_storage_impl.la
|
|
||||||
if WITH_DRIVER_MODULES
|
if WITH_DRIVER_MODULES
|
||||||
mod_LTLIBRARIES += \
|
mod_LTLIBRARIES += \
|
||||||
libvirt_driver_vbox.la \
|
libvirt_driver_vbox.la
|
||||||
libvirt_driver_vbox_network.la \
|
|
||||||
libvirt_driver_vbox_storage.la
|
|
||||||
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
|
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
|
||||||
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
|
libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
|
||||||
libvirt_driver_vbox_network_la_LIBADD += ../gnulib/lib/libgnu.la
|
|
||||||
libvirt_driver_vbox_network_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
|
|
||||||
libvirt_driver_vbox_storage_la_LIBADD += ../gnulib/lib/libgnu.la
|
|
||||||
libvirt_driver_vbox_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
|
|
||||||
else ! WITH_DRIVER_MODULES
|
else ! WITH_DRIVER_MODULES
|
||||||
noinst_LTLIBRARIES += libvirt_driver_vbox.la
|
noinst_LTLIBRARIES += libvirt_driver_vbox.la
|
||||||
# GPLv2-only license requries that it be linked into
|
# GPLv2-only license requries that it be linked into
|
||||||
# libvirtd and *not* libvirt.so
|
# libvirtd and *not* libvirt.so
|
||||||
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
|
#libvirt_la_BUILT_LIBADD += libvirt_driver_vbox.la
|
||||||
libvirt_driver_vbox_la_LIBADD += libvirt_driver_vbox_network_impl.la \
|
|
||||||
libvirt_driver_vbox_storage_impl.la
|
|
||||||
endif ! WITH_DRIVER_MODULES
|
endif ! WITH_DRIVER_MODULES
|
||||||
|
|
||||||
libvirt_driver_vbox_impl_la_CFLAGS = \
|
libvirt_driver_vbox_impl_la_CFLAGS = \
|
||||||
@ -1218,28 +1187,6 @@ libvirt_driver_vbox_impl_la_LIBADD = $(DLOPEN_LIBS) \
|
|||||||
$(MSCOM_LIBS) \
|
$(MSCOM_LIBS) \
|
||||||
$(LIBXML_LIBS)
|
$(LIBXML_LIBS)
|
||||||
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
|
libvirt_driver_vbox_impl_la_SOURCES = $(VBOX_DRIVER_SOURCES)
|
||||||
|
|
||||||
libvirt_driver_vbox_network_impl_la_CFLAGS = \
|
|
||||||
-I$(srcdir)/conf \
|
|
||||||
$(AM_CFLAGS) \
|
|
||||||
-DVBOX_NETWORK_DRIVER
|
|
||||||
libvirt_driver_vbox_network_impl_la_LDFLAGS = $(AM_LDFLAGS)
|
|
||||||
libvirt_driver_vbox_network_impl_la_LIBADD = $(DLOPEN_LIBS) \
|
|
||||||
$(MSCOM_LIBS) \
|
|
||||||
$(LIBXML_LIBS) \
|
|
||||||
libvirt_driver_vbox_impl.la
|
|
||||||
libvirt_driver_vbox_network_impl_la_SOURCES = $(VBOX_NETWORK_DRIVER_SOURCES)
|
|
||||||
|
|
||||||
libvirt_driver_vbox_storage_impl_la_CFLAGS = \
|
|
||||||
-I$(srcdir)/conf \
|
|
||||||
$(AM_CFLAGS) \
|
|
||||||
-DVBOX_STORAGE_DRIVER
|
|
||||||
libvirt_driver_vbox_storage_impl_la_LDFLAGS = $(AM_LDFLAGS)
|
|
||||||
libvirt_driver_vbox_storage_impl_la_LIBADD = $(DLOPEN_LIBS) \
|
|
||||||
$(MSCOM_LIBS) \
|
|
||||||
$(LIBXML_LIBS) \
|
|
||||||
libvirt_driver_vbox_impl.la
|
|
||||||
libvirt_driver_vbox_storage_impl_la_SOURCES = $(VBOX_STORAGE_DRIVER_SOURCES)
|
|
||||||
endif WITH_VBOX
|
endif WITH_VBOX
|
||||||
|
|
||||||
if WITH_XENAPI
|
if WITH_XENAPI
|
||||||
|
@ -1430,8 +1430,7 @@ bhyveConnectDomainEventDeregisterAny(virConnectPtr conn,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virHypervisorDriver bhyveDriver = {
|
static virHypervisorDriver bhyveHypervisorDriver = {
|
||||||
.no = VIR_DRV_BHYVE,
|
|
||||||
.name = "bhyve",
|
.name = "bhyve",
|
||||||
.connectOpen = bhyveConnectOpen, /* 1.2.2 */
|
.connectOpen = bhyveConnectOpen, /* 1.2.2 */
|
||||||
.connectClose = bhyveConnectClose, /* 1.2.2 */
|
.connectClose = bhyveConnectClose, /* 1.2.2 */
|
||||||
@ -1480,6 +1479,10 @@ static virHypervisorDriver bhyveDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static virConnectDriver bhyveConnectDriver = {
|
||||||
|
.hypervisorDriver = &bhyveHypervisorDriver,
|
||||||
|
};
|
||||||
|
|
||||||
static virStateDriver bhyveStateDriver = {
|
static virStateDriver bhyveStateDriver = {
|
||||||
.name = "bhyve",
|
.name = "bhyve",
|
||||||
.stateInitialize = bhyveStateInitialize,
|
.stateInitialize = bhyveStateInitialize,
|
||||||
@ -1490,9 +1493,10 @@ static virStateDriver bhyveStateDriver = {
|
|||||||
int
|
int
|
||||||
bhyveRegister(void)
|
bhyveRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&bhyveDriver) < 0)
|
if (virRegisterConnectDriver(&bhyveConnectDriver,
|
||||||
|
true) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&bhyveStateDriver) < 0)
|
if (virRegisterStateDriver(&bhyveStateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,8 @@ while (<>) {
|
|||||||
}
|
}
|
||||||
} elsif (/^(?:static\s+)?(vir(?:\w+)?Driver)\s+/) {
|
} elsif (/^(?:static\s+)?(vir(?:\w+)?Driver)\s+/) {
|
||||||
next if $1 eq "virNWFilterCallbackDriver" ||
|
next if $1 eq "virNWFilterCallbackDriver" ||
|
||||||
$1 eq "virNWFilterTechDriver";
|
$1 eq "virNWFilterTechDriver" ||
|
||||||
|
$1 eq "virConnectDriver";
|
||||||
$intable = 1;
|
$intable = 1;
|
||||||
$table = $1;
|
$table = $1;
|
||||||
}
|
}
|
||||||
|
@ -138,18 +138,6 @@ virConnectDispose(void *obj)
|
|||||||
{
|
{
|
||||||
virConnectPtr conn = obj;
|
virConnectPtr conn = obj;
|
||||||
|
|
||||||
if (conn->networkDriver)
|
|
||||||
conn->networkDriver->networkClose(conn);
|
|
||||||
if (conn->interfaceDriver)
|
|
||||||
conn->interfaceDriver->interfaceClose(conn);
|
|
||||||
if (conn->storageDriver)
|
|
||||||
conn->storageDriver->storageClose(conn);
|
|
||||||
if (conn->nodeDeviceDriver)
|
|
||||||
conn->nodeDeviceDriver->nodeDeviceClose(conn);
|
|
||||||
if (conn->secretDriver)
|
|
||||||
conn->secretDriver->secretClose(conn);
|
|
||||||
if (conn->nwfilterDriver)
|
|
||||||
conn->nwfilterDriver->nwfilterClose(conn);
|
|
||||||
if (conn->driver)
|
if (conn->driver)
|
||||||
conn->driver->connectClose(conn);
|
conn->driver->connectClose(conn);
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ typedef virDrvOpenStatus
|
|||||||
typedef int
|
typedef int
|
||||||
(*virDrvConnectClose)(virConnectPtr conn);
|
(*virDrvConnectClose)(virConnectPtr conn);
|
||||||
|
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
(*virDrvConnectSupportsFeature)(virConnectPtr conn,
|
(*virDrvConnectSupportsFeature)(virConnectPtr conn,
|
||||||
int feature);
|
int feature);
|
||||||
@ -1185,13 +1184,11 @@ typedef virHypervisorDriver *virHypervisorDriverPtr;
|
|||||||
* entry points for it.
|
* entry points for it.
|
||||||
*
|
*
|
||||||
* All drivers must support the following fields/methods:
|
* All drivers must support the following fields/methods:
|
||||||
* - no
|
|
||||||
* - name
|
* - name
|
||||||
* - open
|
* - open
|
||||||
* - close
|
* - close
|
||||||
*/
|
*/
|
||||||
struct _virHypervisorDriver {
|
struct _virHypervisorDriver {
|
||||||
int no; /* the number virDrvNo */
|
|
||||||
const char *name; /* the name of the driver */
|
const char *name; /* the name of the driver */
|
||||||
virDrvConnectOpen connectOpen;
|
virDrvConnectOpen connectOpen;
|
||||||
virDrvConnectClose connectClose;
|
virDrvConnectClose connectClose;
|
||||||
|
@ -25,9 +25,6 @@
|
|||||||
# error "Don't include this file directly, only use driver.h"
|
# error "Don't include this file directly, only use driver.h"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
typedef virDrvConnectOpen virDrvInterfaceOpen;
|
|
||||||
typedef virDrvConnectClose virDrvInterfaceClose;
|
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
(*virDrvConnectNumOfInterfaces)(virConnectPtr conn);
|
(*virDrvConnectNumOfInterfaces)(virConnectPtr conn);
|
||||||
|
|
||||||
@ -100,15 +97,9 @@ typedef virInterfaceDriver *virInterfaceDriverPtr;
|
|||||||
*
|
*
|
||||||
* Structure associated to a network interface driver, defining the various
|
* Structure associated to a network interface driver, defining the various
|
||||||
* entry points for it.
|
* entry points for it.
|
||||||
*
|
|
||||||
* All drivers must support the following fields/methods:
|
|
||||||
* - open
|
|
||||||
* - close
|
|
||||||
*/
|
*/
|
||||||
struct _virInterfaceDriver {
|
struct _virInterfaceDriver {
|
||||||
const char *name; /* the name of the driver */
|
const char *name; /* the name of the driver */
|
||||||
virDrvInterfaceOpen interfaceOpen;
|
|
||||||
virDrvInterfaceClose interfaceClose;
|
|
||||||
virDrvConnectNumOfInterfaces connectNumOfInterfaces;
|
virDrvConnectNumOfInterfaces connectNumOfInterfaces;
|
||||||
virDrvConnectListInterfaces connectListInterfaces;
|
virDrvConnectListInterfaces connectListInterfaces;
|
||||||
virDrvConnectNumOfDefinedInterfaces connectNumOfDefinedInterfaces;
|
virDrvConnectNumOfDefinedInterfaces connectNumOfDefinedInterfaces;
|
||||||
|
@ -25,9 +25,6 @@
|
|||||||
# error "Don't include this file directly, only use driver.h"
|
# error "Don't include this file directly, only use driver.h"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
typedef virDrvConnectOpen virDrvNetworkOpen;
|
|
||||||
typedef virDrvConnectClose virDrvNetworkClose;
|
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
(*virDrvConnectNumOfNetworks)(virConnectPtr conn);
|
(*virDrvConnectNumOfNetworks)(virConnectPtr conn);
|
||||||
|
|
||||||
@ -129,15 +126,9 @@ typedef virNetworkDriver *virNetworkDriverPtr;
|
|||||||
*
|
*
|
||||||
* Structure associated to a network virtualization driver, defining the various
|
* Structure associated to a network virtualization driver, defining the various
|
||||||
* entry points for it.
|
* entry points for it.
|
||||||
*
|
|
||||||
* All drivers must support the following fields/methods:
|
|
||||||
* - open
|
|
||||||
* - close
|
|
||||||
*/
|
*/
|
||||||
struct _virNetworkDriver {
|
struct _virNetworkDriver {
|
||||||
const char * name; /* the name of the driver */
|
const char *name; /* the name of the driver */
|
||||||
virDrvNetworkOpen networkOpen;
|
|
||||||
virDrvNetworkClose networkClose;
|
|
||||||
virDrvConnectNumOfNetworks connectNumOfNetworks;
|
virDrvConnectNumOfNetworks connectNumOfNetworks;
|
||||||
virDrvConnectListNetworks connectListNetworks;
|
virDrvConnectListNetworks connectListNetworks;
|
||||||
virDrvConnectNumOfDefinedNetworks connectNumOfDefinedNetworks;
|
virDrvConnectNumOfDefinedNetworks connectNumOfDefinedNetworks;
|
||||||
|
@ -25,10 +25,6 @@
|
|||||||
# error "Don't include this file directly, only use driver.h"
|
# error "Don't include this file directly, only use driver.h"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
typedef virDrvConnectOpen virDrvNodeDeviceOpen;
|
|
||||||
typedef virDrvConnectClose virDrvNodeDeviceClose;
|
|
||||||
|
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
(*virDrvNodeNumOfDevices)(virConnectPtr conn,
|
(*virDrvNodeNumOfDevices)(virConnectPtr conn,
|
||||||
const char *cap,
|
const char *cap,
|
||||||
@ -92,9 +88,7 @@ typedef virNodeDeviceDriver *virNodeDeviceDriverPtr;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct _virNodeDeviceDriver {
|
struct _virNodeDeviceDriver {
|
||||||
const char * name; /* the name of the driver */
|
const char *name; /* the name of the driver */
|
||||||
virDrvNodeDeviceOpen nodeDeviceOpen;
|
|
||||||
virDrvNodeDeviceClose nodeDeviceClose;
|
|
||||||
virDrvNodeNumOfDevices nodeNumOfDevices;
|
virDrvNodeNumOfDevices nodeNumOfDevices;
|
||||||
virDrvNodeListDevices nodeListDevices;
|
virDrvNodeListDevices nodeListDevices;
|
||||||
virDrvConnectListAllNodeDevices connectListAllNodeDevices;
|
virDrvConnectListAllNodeDevices connectListAllNodeDevices;
|
||||||
|
@ -25,11 +25,6 @@
|
|||||||
# error "Don't include this file directly, only use driver.h"
|
# error "Don't include this file directly, only use driver.h"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|
||||||
typedef virDrvConnectOpen virDrvNWFilterOpen;
|
|
||||||
typedef virDrvConnectClose virDrvNWFilterClose;
|
|
||||||
|
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
(*virDrvConnectNumOfNWFilters)(virConnectPtr conn);
|
(*virDrvConnectNumOfNWFilters)(virConnectPtr conn);
|
||||||
|
|
||||||
@ -71,15 +66,9 @@ typedef virNWFilterDriver *virNWFilterDriverPtr;
|
|||||||
*
|
*
|
||||||
* Structure associated to a network filter driver, defining the various
|
* Structure associated to a network filter driver, defining the various
|
||||||
* entry points for it.
|
* entry points for it.
|
||||||
*
|
|
||||||
* All drivers must support the following fields/methods:
|
|
||||||
* - open
|
|
||||||
* - close
|
|
||||||
*/
|
*/
|
||||||
struct _virNWFilterDriver {
|
struct _virNWFilterDriver {
|
||||||
const char * name; /* the name of the driver */
|
const char *name; /* the name of the driver */
|
||||||
virDrvNWFilterOpen nwfilterOpen;
|
|
||||||
virDrvNWFilterClose nwfilterClose;
|
|
||||||
virDrvConnectNumOfNWFilters connectNumOfNWFilters;
|
virDrvConnectNumOfNWFilters connectNumOfNWFilters;
|
||||||
virDrvConnectListNWFilters connectListNWFilters;
|
virDrvConnectListNWFilters connectListNWFilters;
|
||||||
virDrvConnectListAllNWFilters connectListAllNWFilters;
|
virDrvConnectListAllNWFilters connectListAllNWFilters;
|
||||||
|
@ -31,10 +31,6 @@ enum {
|
|||||||
VIR_SECRET_GET_VALUE_INTERNAL_CALL = 1 << 0,
|
VIR_SECRET_GET_VALUE_INTERNAL_CALL = 1 << 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef virDrvConnectOpen virDrvSecretOpen;
|
|
||||||
typedef virDrvConnectClose virDrvSecretClose;
|
|
||||||
|
|
||||||
|
|
||||||
typedef virSecretPtr
|
typedef virSecretPtr
|
||||||
(*virDrvSecretLookupByUUID)(virConnectPtr conn,
|
(*virDrvSecretLookupByUUID)(virConnectPtr conn,
|
||||||
const unsigned char *uuid);
|
const unsigned char *uuid);
|
||||||
@ -89,15 +85,9 @@ typedef virSecretDriver *virSecretDriverPtr;
|
|||||||
*
|
*
|
||||||
* Structure associated to a driver for storing secrets, defining the various
|
* Structure associated to a driver for storing secrets, defining the various
|
||||||
* entry points for it.
|
* entry points for it.
|
||||||
*
|
|
||||||
* All drivers must support the following fields/methods:
|
|
||||||
* - open
|
|
||||||
* - close
|
|
||||||
*/
|
*/
|
||||||
struct _virSecretDriver {
|
struct _virSecretDriver {
|
||||||
const char *name;
|
const char *name; /* the name of the driver */
|
||||||
virDrvSecretOpen secretOpen;
|
|
||||||
virDrvSecretClose secretClose;
|
|
||||||
virDrvConnectNumOfSecrets connectNumOfSecrets;
|
virDrvConnectNumOfSecrets connectNumOfSecrets;
|
||||||
virDrvConnectListSecrets connectListSecrets;
|
virDrvConnectListSecrets connectListSecrets;
|
||||||
virDrvConnectListAllSecrets connectListAllSecrets;
|
virDrvConnectListAllSecrets connectListAllSecrets;
|
||||||
|
@ -25,10 +25,6 @@
|
|||||||
# error "Don't include this file directly, only use driver.h"
|
# error "Don't include this file directly, only use driver.h"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
typedef virDrvConnectOpen virDrvStorageOpen;
|
|
||||||
typedef virDrvConnectClose virDrvStorageClose;
|
|
||||||
|
|
||||||
|
|
||||||
typedef int
|
typedef int
|
||||||
(*virDrvConnectNumOfStoragePools)(virConnectPtr conn);
|
(*virDrvConnectNumOfStoragePools)(virConnectPtr conn);
|
||||||
|
|
||||||
@ -210,15 +206,9 @@ typedef virStorageDriver *virStorageDriverPtr;
|
|||||||
*
|
*
|
||||||
* Structure associated to a storage driver, defining the various
|
* Structure associated to a storage driver, defining the various
|
||||||
* entry points for it.
|
* entry points for it.
|
||||||
*
|
|
||||||
* All drivers must support the following fields/methods:
|
|
||||||
* - open
|
|
||||||
* - close
|
|
||||||
*/
|
*/
|
||||||
struct _virStorageDriver {
|
struct _virStorageDriver {
|
||||||
const char * name; /* the name of the driver */
|
const char *name; /* the name of the driver */
|
||||||
virDrvStorageOpen storageOpen;
|
|
||||||
virDrvStorageClose storageClose;
|
|
||||||
virDrvConnectNumOfStoragePools connectNumOfStoragePools;
|
virDrvConnectNumOfStoragePools connectNumOfStoragePools;
|
||||||
virDrvConnectListStoragePools connectListStoragePools;
|
virDrvConnectListStoragePools connectListStoragePools;
|
||||||
virDrvConnectNumOfDefinedStoragePools connectNumOfDefinedStoragePools;
|
virDrvConnectNumOfDefinedStoragePools connectNumOfDefinedStoragePools;
|
||||||
|
54
src/driver.h
54
src/driver.h
@ -27,28 +27,6 @@
|
|||||||
# include "internal.h"
|
# include "internal.h"
|
||||||
# include "libvirt_internal.h"
|
# include "libvirt_internal.h"
|
||||||
# include "viruri.h"
|
# include "viruri.h"
|
||||||
/*
|
|
||||||
* List of registered drivers numbers
|
|
||||||
*/
|
|
||||||
typedef enum {
|
|
||||||
VIR_DRV_XEN_UNIFIED = 1,
|
|
||||||
VIR_DRV_TEST = 2,
|
|
||||||
VIR_DRV_QEMU = 3,
|
|
||||||
VIR_DRV_REMOTE = 4,
|
|
||||||
VIR_DRV_OPENVZ = 5,
|
|
||||||
VIR_DRV_LXC = 6,
|
|
||||||
VIR_DRV_UML = 7,
|
|
||||||
VIR_DRV_VBOX = 8,
|
|
||||||
VIR_DRV_ONE = 9,
|
|
||||||
VIR_DRV_ESX = 10,
|
|
||||||
VIR_DRV_PHYP = 11,
|
|
||||||
VIR_DRV_XENAPI = 12,
|
|
||||||
VIR_DRV_VMWARE = 13,
|
|
||||||
VIR_DRV_LIBXL = 14,
|
|
||||||
VIR_DRV_HYPERV = 15,
|
|
||||||
VIR_DRV_PARALLELS = 16,
|
|
||||||
VIR_DRV_BHYVE = 17,
|
|
||||||
} virDrvNo;
|
|
||||||
|
|
||||||
|
|
||||||
/* Status codes returned from driver open call. */
|
/* Status codes returned from driver open call. */
|
||||||
@ -97,15 +75,29 @@ typedef enum {
|
|||||||
|
|
||||||
# undef __VIR_DRIVER_H_INCLUDES___
|
# undef __VIR_DRIVER_H_INCLUDES___
|
||||||
|
|
||||||
int virRegisterHypervisorDriver(virHypervisorDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
typedef struct _virConnectDriver virConnectDriver;
|
||||||
int virRegisterNetworkDriver(virNetworkDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
typedef virConnectDriver *virConnectDriverPtr;
|
||||||
int virRegisterInterfaceDriver(virInterfaceDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
|
||||||
int virRegisterNetworkDriver(virNetworkDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
struct _virConnectDriver {
|
||||||
int virRegisterNodeDeviceDriver(virNodeDeviceDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
virHypervisorDriverPtr hypervisorDriver;
|
||||||
int virRegisterNWFilterDriver(virNWFilterDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
virInterfaceDriverPtr interfaceDriver;
|
||||||
int virRegisterSecretDriver(virSecretDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
virNetworkDriverPtr networkDriver;
|
||||||
int virRegisterStateDriver(virStateDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
virNodeDeviceDriverPtr nodeDeviceDriver;
|
||||||
int virRegisterStorageDriver(virStorageDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
virNWFilterDriverPtr nwfilterDriver;
|
||||||
|
virSecretDriverPtr secretDriver;
|
||||||
|
virStorageDriverPtr storageDriver;
|
||||||
|
};
|
||||||
|
|
||||||
|
int virRegisterConnectDriver(virConnectDriverPtr driver,
|
||||||
|
bool setSharedDrivers) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
int virRegisterStateDriver(virStateDriverPtr driver) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
|
||||||
|
int virSetSharedInterfaceDriver(virInterfaceDriverPtr driver) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
int virSetSharedNetworkDriver(virNetworkDriverPtr driver) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
int virSetSharedNodeDeviceDriver(virNodeDeviceDriverPtr driver) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
int virSetSharedNWFilterDriver(virNWFilterDriverPtr driver) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
int virSetSharedSecretDriver(virSecretDriverPtr driver) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
int virSetSharedStorageDriver(virStorageDriverPtr driver) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
|
||||||
void *virDriverLoadModule(const char *name);
|
void *virDriverLoadModule(const char *name);
|
||||||
|
|
||||||
|
@ -1,74 +0,0 @@
|
|||||||
/*
|
|
||||||
* esx_device_monitor.c: device monitor functions for managing VMware ESX
|
|
||||||
* host devices
|
|
||||||
*
|
|
||||||
* Copyright (C) 2010-2011 Red Hat, Inc.
|
|
||||||
* Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
#include "viralloc.h"
|
|
||||||
#include "viruuid.h"
|
|
||||||
#include "esx_private.h"
|
|
||||||
#include "esx_device_monitor.h"
|
|
||||||
#include "esx_vi.h"
|
|
||||||
#include "esx_vi_methods.h"
|
|
||||||
#include "esx_util.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_ESX
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
esxNodeDeviceOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_ESX)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
esxNodeDeviceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virNodeDeviceDriver esxNodeDeviceDriver = {
|
|
||||||
.name = "ESX",
|
|
||||||
.nodeDeviceOpen = esxNodeDeviceOpen, /* 0.7.6 */
|
|
||||||
.nodeDeviceClose = esxNodeDeviceClose, /* 0.7.6 */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
esxDeviceRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterNodeDeviceDriver(&esxNodeDeviceDriver);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* esx_device_monitor.h: device monitor methods for managing VMware ESX
|
|
||||||
* host devices
|
|
||||||
*
|
|
||||||
* Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __ESX_DEVICE_MONITOR_H__
|
|
||||||
# define __ESX_DEVICE_MONITOR_H__
|
|
||||||
|
|
||||||
int esxDeviceRegister(void);
|
|
||||||
|
|
||||||
#endif /* __ESX_DEVICE_MONITOR_H__ */
|
|
@ -37,9 +37,6 @@
|
|||||||
#include "esx_interface_driver.h"
|
#include "esx_interface_driver.h"
|
||||||
#include "esx_network_driver.h"
|
#include "esx_network_driver.h"
|
||||||
#include "esx_storage_driver.h"
|
#include "esx_storage_driver.h"
|
||||||
#include "esx_device_monitor.h"
|
|
||||||
#include "esx_secret_driver.h"
|
|
||||||
#include "esx_nwfilter_driver.h"
|
|
||||||
#include "esx_private.h"
|
#include "esx_private.h"
|
||||||
#include "esx_vi.h"
|
#include "esx_vi.h"
|
||||||
#include "esx_vi_methods.h"
|
#include "esx_vi_methods.h"
|
||||||
@ -5151,8 +5148,7 @@ esxConnectListAllDomains(virConnectPtr conn,
|
|||||||
#undef MATCH
|
#undef MATCH
|
||||||
|
|
||||||
|
|
||||||
static virHypervisorDriver esxDriver = {
|
static virHypervisorDriver esxHypervisorDriver = {
|
||||||
.no = VIR_DRV_ESX,
|
|
||||||
.name = "ESX",
|
.name = "ESX",
|
||||||
.connectOpen = esxConnectOpen, /* 0.7.0 */
|
.connectOpen = esxConnectOpen, /* 0.7.0 */
|
||||||
.connectClose = esxConnectClose, /* 0.7.0 */
|
.connectClose = esxConnectClose, /* 0.7.0 */
|
||||||
@ -5233,19 +5229,16 @@ static virHypervisorDriver esxDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static virConnectDriver esxConnectDriver = {
|
||||||
|
.hypervisorDriver = &esxHypervisorDriver,
|
||||||
|
.interfaceDriver = &esxInterfaceDriver,
|
||||||
|
.networkDriver = &esxNetworkDriver,
|
||||||
|
.storageDriver = &esxStorageDriver,
|
||||||
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
esxRegister(void)
|
esxRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&esxDriver) < 0 ||
|
return virRegisterConnectDriver(&esxConnectDriver,
|
||||||
esxInterfaceRegister() < 0 ||
|
false);
|
||||||
esxNetworkRegister() < 0 ||
|
|
||||||
esxStorageRegister() < 0 ||
|
|
||||||
esxDeviceRegister() < 0 ||
|
|
||||||
esxSecretRegister() < 0 ||
|
|
||||||
esxNWFilterRegister() < 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
@ -38,30 +38,6 @@
|
|||||||
#define VIR_FROM_THIS VIR_FROM_ESX
|
#define VIR_FROM_THIS VIR_FROM_ESX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
esxInterfaceOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_ESX)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
esxInterfaceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
esxConnectNumOfInterfaces(virConnectPtr conn)
|
esxConnectNumOfInterfaces(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
@ -282,10 +258,7 @@ esxInterfaceIsActive(virInterfacePtr iface ATTRIBUTE_UNUSED)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virInterfaceDriver esxInterfaceDriver = {
|
virInterfaceDriver esxInterfaceDriver = {
|
||||||
.name = "ESX",
|
|
||||||
.interfaceOpen = esxInterfaceOpen, /* 0.7.6 */
|
|
||||||
.interfaceClose = esxInterfaceClose, /* 0.7.6 */
|
|
||||||
.connectNumOfInterfaces = esxConnectNumOfInterfaces, /* 0.10.0 */
|
.connectNumOfInterfaces = esxConnectNumOfInterfaces, /* 0.10.0 */
|
||||||
.connectListInterfaces = esxConnectListInterfaces, /* 0.10.0 */
|
.connectListInterfaces = esxConnectListInterfaces, /* 0.10.0 */
|
||||||
.connectNumOfDefinedInterfaces = esxConnectNumOfDefinedInterfaces, /* 0.10.0 */
|
.connectNumOfDefinedInterfaces = esxConnectNumOfDefinedInterfaces, /* 0.10.0 */
|
||||||
@ -295,11 +268,3 @@ static virInterfaceDriver esxInterfaceDriver = {
|
|||||||
.interfaceGetXMLDesc = esxInterfaceGetXMLDesc, /* 0.10.0 */
|
.interfaceGetXMLDesc = esxInterfaceGetXMLDesc, /* 0.10.0 */
|
||||||
.interfaceIsActive = esxInterfaceIsActive, /* 0.10.0 */
|
.interfaceIsActive = esxInterfaceIsActive, /* 0.10.0 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
esxInterfaceRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterInterfaceDriver(&esxInterfaceDriver);
|
|
||||||
}
|
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#ifndef __ESX_INTERFACE_DRIVER_H__
|
#ifndef __ESX_INTERFACE_DRIVER_H__
|
||||||
# define __ESX_INTERFACE_DRIVER_H__
|
# define __ESX_INTERFACE_DRIVER_H__
|
||||||
|
|
||||||
int esxInterfaceRegister(void);
|
# include "driver.h"
|
||||||
|
|
||||||
|
extern virInterfaceDriver esxInterfaceDriver;
|
||||||
|
|
||||||
#endif /* __ESX_INTERFACE_DRIVER_H__ */
|
#endif /* __ESX_INTERFACE_DRIVER_H__ */
|
||||||
|
@ -44,30 +44,6 @@
|
|||||||
verify(MD5_DIGEST_SIZE == VIR_UUID_BUFLEN);
|
verify(MD5_DIGEST_SIZE == VIR_UUID_BUFLEN);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
esxNetworkOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_ESX)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
esxNetworkClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
esxConnectNumOfNetworks(virConnectPtr conn)
|
esxConnectNumOfNetworks(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
@ -881,10 +857,7 @@ esxNetworkIsPersistent(virNetworkPtr network ATTRIBUTE_UNUSED)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virNetworkDriver esxNetworkDriver = {
|
virNetworkDriver esxNetworkDriver = {
|
||||||
.name = "ESX",
|
|
||||||
.networkOpen = esxNetworkOpen, /* 0.7.6 */
|
|
||||||
.networkClose = esxNetworkClose, /* 0.7.6 */
|
|
||||||
.connectNumOfNetworks = esxConnectNumOfNetworks, /* 0.10.0 */
|
.connectNumOfNetworks = esxConnectNumOfNetworks, /* 0.10.0 */
|
||||||
.connectListNetworks = esxConnectListNetworks, /* 0.10.0 */
|
.connectListNetworks = esxConnectListNetworks, /* 0.10.0 */
|
||||||
.connectNumOfDefinedNetworks = esxConnectNumOfDefinedNetworks, /* 0.10.0 */
|
.connectNumOfDefinedNetworks = esxConnectNumOfDefinedNetworks, /* 0.10.0 */
|
||||||
@ -899,11 +872,3 @@ static virNetworkDriver esxNetworkDriver = {
|
|||||||
.networkIsActive = esxNetworkIsActive, /* 0.10.0 */
|
.networkIsActive = esxNetworkIsActive, /* 0.10.0 */
|
||||||
.networkIsPersistent = esxNetworkIsPersistent, /* 0.10.0 */
|
.networkIsPersistent = esxNetworkIsPersistent, /* 0.10.0 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
esxNetworkRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterNetworkDriver(&esxNetworkDriver);
|
|
||||||
}
|
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#ifndef __ESX_NETWORK_DRIVER_H__
|
#ifndef __ESX_NETWORK_DRIVER_H__
|
||||||
# define __ESX_NETWORK_DRIVER_H__
|
# define __ESX_NETWORK_DRIVER_H__
|
||||||
|
|
||||||
int esxNetworkRegister(void);
|
# include "driver.h"
|
||||||
|
|
||||||
|
extern virNetworkDriver esxNetworkDriver;
|
||||||
|
|
||||||
#endif /* __ESX_NETWORK_DRIVER_H__ */
|
#endif /* __ESX_NETWORK_DRIVER_H__ */
|
||||||
|
@ -1,74 +0,0 @@
|
|||||||
/*
|
|
||||||
* esx_nwfilter_driver.c: nwfilter driver functions for managing VMware ESX
|
|
||||||
* firewall rules
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Red Hat, Inc.
|
|
||||||
* Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
#include "viralloc.h"
|
|
||||||
#include "viruuid.h"
|
|
||||||
#include "esx_private.h"
|
|
||||||
#include "esx_nwfilter_driver.h"
|
|
||||||
#include "esx_vi.h"
|
|
||||||
#include "esx_vi_methods.h"
|
|
||||||
#include "esx_util.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_ESX
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
esxNWFilterOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_ESX)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
esxNWFilterClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virNWFilterDriver esxNWFilterDriver = {
|
|
||||||
.name = "ESX",
|
|
||||||
.nwfilterOpen = esxNWFilterOpen, /* 0.8.1 */
|
|
||||||
.nwfilterClose = esxNWFilterClose, /* 0.8.1 */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
esxNWFilterRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterNWFilterDriver(&esxNWFilterDriver);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* esx_nwfilter_driver.h: nwfilter driver functions for managing VMware ESX
|
|
||||||
* firewall rules
|
|
||||||
*
|
|
||||||
* Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __ESX_NWFILTER_DRIVER_H__
|
|
||||||
# define __ESX_NWFILTER_DRIVER_H__
|
|
||||||
|
|
||||||
int esxNWFilterRegister(void);
|
|
||||||
|
|
||||||
#endif /* __ESX_NWFILTER_DRIVER_H__ */
|
|
@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* esx_secret_driver.c: secret driver functions for VMware ESX secret manipulation
|
|
||||||
*
|
|
||||||
* Copyright (C) 2010-2011 Red Hat, Inc.
|
|
||||||
* Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
#include "viralloc.h"
|
|
||||||
#include "viruuid.h"
|
|
||||||
#include "esx_private.h"
|
|
||||||
#include "esx_secret_driver.h"
|
|
||||||
#include "esx_vi.h"
|
|
||||||
#include "esx_vi_methods.h"
|
|
||||||
#include "esx_util.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_ESX
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
esxSecretOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_ESX)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
esxSecretClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virSecretDriver esxSecretDriver = {
|
|
||||||
.name = "ESX",
|
|
||||||
.secretOpen = esxSecretOpen, /* 0.7.6 */
|
|
||||||
.secretClose = esxSecretClose, /* 0.7.6 */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
esxSecretRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterSecretDriver(&esxSecretDriver);
|
|
||||||
}
|
|
@ -1,27 +0,0 @@
|
|||||||
/*
|
|
||||||
* esx_secret_driver.h: secret driver functions for VMware ESX secret manipulation
|
|
||||||
*
|
|
||||||
* Copyright (C) 2010 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __ESX_SECRET_DRIVER_H__
|
|
||||||
# define __ESX_SECRET_DRIVER_H__
|
|
||||||
|
|
||||||
int esxSecretRegister(void);
|
|
||||||
|
|
||||||
#endif /* __ESX_SECRET_DRIVER_H__ */
|
|
@ -52,30 +52,6 @@ static virStorageDriverPtr backends[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
esxStorageOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_ESX)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
esxStorageClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
esxConnectNumOfStoragePools(virConnectPtr conn)
|
esxConnectNumOfStoragePools(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
@ -541,10 +517,7 @@ esxStoragePoolIsPersistent(virStoragePoolPtr pool ATTRIBUTE_UNUSED)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virStorageDriver esxStorageDriver = {
|
virStorageDriver esxStorageDriver = {
|
||||||
.name = "ESX",
|
|
||||||
.storageOpen = esxStorageOpen, /* 0.7.6 */
|
|
||||||
.storageClose = esxStorageClose, /* 0.7.6 */
|
|
||||||
.connectNumOfStoragePools = esxConnectNumOfStoragePools, /* 0.8.2 */
|
.connectNumOfStoragePools = esxConnectNumOfStoragePools, /* 0.8.2 */
|
||||||
.connectListStoragePools = esxConnectListStoragePools, /* 0.8.2 */
|
.connectListStoragePools = esxConnectListStoragePools, /* 0.8.2 */
|
||||||
.connectNumOfDefinedStoragePools = esxConnectNumOfDefinedStoragePools, /* 0.8.2 */
|
.connectNumOfDefinedStoragePools = esxConnectNumOfDefinedStoragePools, /* 0.8.2 */
|
||||||
@ -572,11 +545,3 @@ static virStorageDriver esxStorageDriver = {
|
|||||||
.storagePoolIsActive = esxStoragePoolIsActive, /* 0.8.2 */
|
.storagePoolIsActive = esxStoragePoolIsActive, /* 0.8.2 */
|
||||||
.storagePoolIsPersistent = esxStoragePoolIsPersistent, /* 0.8.2 */
|
.storagePoolIsPersistent = esxStoragePoolIsPersistent, /* 0.8.2 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
esxStorageRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterStorageDriver(&esxStorageDriver);
|
|
||||||
}
|
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#ifndef __ESX_STORAGE_DRIVER_H__
|
#ifndef __ESX_STORAGE_DRIVER_H__
|
||||||
# define __ESX_STORAGE_DRIVER_H__
|
# define __ESX_STORAGE_DRIVER_H__
|
||||||
|
|
||||||
int esxStorageRegister(void);
|
# include "driver.h"
|
||||||
|
|
||||||
|
extern virStorageDriver esxStorageDriver;
|
||||||
|
|
||||||
#endif /* __ESX_STORAGE_DRIVER_H__ */
|
#endif /* __ESX_STORAGE_DRIVER_H__ */
|
||||||
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_device_monitor.c: device monitor functions for managing
|
|
||||||
* Microsoft Hyper-V host devices
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
#include "virerror.h"
|
|
||||||
#include "datatypes.h"
|
|
||||||
#include "viralloc.h"
|
|
||||||
#include "viruuid.h"
|
|
||||||
#include "hyperv_device_monitor.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_HYPERV
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
hypervNodeDeviceOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_HYPERV)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
hypervNodeDeviceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virNodeDeviceDriver hypervNodeDeviceDriver = {
|
|
||||||
"Hyper-V",
|
|
||||||
.nodeDeviceOpen = hypervNodeDeviceOpen, /* 0.9.5 */
|
|
||||||
.nodeDeviceClose = hypervNodeDeviceClose, /* 0.9.5 */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
hypervDeviceRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterNodeDeviceDriver(&hypervNodeDeviceDriver);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_device_monitor.h: device monitor functions for managing
|
|
||||||
* Microsoft Hyper-V host devices
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __HYPERV_DEVICE_MONITOR_H__
|
|
||||||
# define __HYPERV_DEVICE_MONITOR_H__
|
|
||||||
|
|
||||||
int hypervDeviceRegister(void);
|
|
||||||
|
|
||||||
#endif /* __HYPERV_DEVICE_MONITOR_H__ */
|
|
@ -30,12 +30,6 @@
|
|||||||
#include "virlog.h"
|
#include "virlog.h"
|
||||||
#include "viruuid.h"
|
#include "viruuid.h"
|
||||||
#include "hyperv_driver.h"
|
#include "hyperv_driver.h"
|
||||||
#include "hyperv_interface_driver.h"
|
|
||||||
#include "hyperv_network_driver.h"
|
|
||||||
#include "hyperv_storage_driver.h"
|
|
||||||
#include "hyperv_device_monitor.h"
|
|
||||||
#include "hyperv_secret_driver.h"
|
|
||||||
#include "hyperv_nwfilter_driver.h"
|
|
||||||
#include "hyperv_private.h"
|
#include "hyperv_private.h"
|
||||||
#include "hyperv_util.h"
|
#include "hyperv_util.h"
|
||||||
#include "hyperv_wmi.h"
|
#include "hyperv_wmi.h"
|
||||||
@ -1326,8 +1320,7 @@ hypervConnectListAllDomains(virConnectPtr conn,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virHypervisorDriver hypervDriver = {
|
static virHypervisorDriver hypervHypervisorDriver = {
|
||||||
.no = VIR_DRV_HYPERV,
|
|
||||||
.name = "Hyper-V",
|
.name = "Hyper-V",
|
||||||
.connectOpen = hypervConnectOpen, /* 0.9.5 */
|
.connectOpen = hypervConnectOpen, /* 0.9.5 */
|
||||||
.connectClose = hypervConnectClose, /* 0.9.5 */
|
.connectClose = hypervConnectClose, /* 0.9.5 */
|
||||||
@ -1386,22 +1379,16 @@ hypervDebugHandler(const char *message, debug_level_e level,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static virConnectDriver hypervConnectDriver = {
|
||||||
|
.hypervisorDriver = &hypervHypervisorDriver,
|
||||||
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
hypervRegister(void)
|
hypervRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&hypervDriver) < 0 ||
|
|
||||||
hypervInterfaceRegister() < 0 ||
|
|
||||||
hypervNetworkRegister() < 0 ||
|
|
||||||
hypervStorageRegister() < 0 ||
|
|
||||||
hypervDeviceRegister() < 0 ||
|
|
||||||
hypervSecretRegister() < 0 ||
|
|
||||||
hypervNWFilterRegister() < 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Forward openwsman errors and warnings to libvirt's logging */
|
/* Forward openwsman errors and warnings to libvirt's logging */
|
||||||
debug_add_handler(hypervDebugHandler, DEBUG_LEVEL_WARNING, NULL);
|
debug_add_handler(hypervDebugHandler, DEBUG_LEVEL_WARNING, NULL);
|
||||||
|
|
||||||
return 0;
|
return virRegisterConnectDriver(&hypervConnectDriver,
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_interface_driver.c: interface driver functions for managing
|
|
||||||
* Microsoft Hyper-V host interfaces
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
#include "virerror.h"
|
|
||||||
#include "datatypes.h"
|
|
||||||
#include "viralloc.h"
|
|
||||||
#include "viruuid.h"
|
|
||||||
#include "hyperv_interface_driver.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_HYPERV
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
hypervInterfaceOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_HYPERV)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
hypervInterfaceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virInterfaceDriver hypervInterfaceDriver = {
|
|
||||||
.name = "Hyper-V",
|
|
||||||
.interfaceOpen = hypervInterfaceOpen, /* 0.9.5 */
|
|
||||||
.interfaceClose = hypervInterfaceClose, /* 0.9.5 */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
hypervInterfaceRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterInterfaceDriver(&hypervInterfaceDriver);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_interface_driver.h: interface driver functions for managing
|
|
||||||
* Microsoft Hyper-V host interfaces
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __HYPERV_INTERFACE_DRIVER_H__
|
|
||||||
# define __HYPERV_INTERFACE_DRIVER_H__
|
|
||||||
|
|
||||||
int hypervInterfaceRegister(void);
|
|
||||||
|
|
||||||
#endif /* __HYPERV_INTERFACE_DRIVER_H__ */
|
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_network_driver.c: network driver functions for managing
|
|
||||||
* Microsoft Hyper-V host networks
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
#include "virerror.h"
|
|
||||||
#include "datatypes.h"
|
|
||||||
#include "viralloc.h"
|
|
||||||
#include "viruuid.h"
|
|
||||||
#include "hyperv_network_driver.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_HYPERV
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
hypervNetworkOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_HYPERV)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
hypervNetworkClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virNetworkDriver hypervNetworkDriver = {
|
|
||||||
.name = "Hyper-V",
|
|
||||||
.networkOpen = hypervNetworkOpen, /* 0.9.5 */
|
|
||||||
.networkClose = hypervNetworkClose, /* 0.9.5 */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
hypervNetworkRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterNetworkDriver(&hypervNetworkDriver);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_network_driver.h: network driver functions for managing
|
|
||||||
* Microsoft Hyper-V host networks
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __HYPERV_NETWORK_DRIVER_H__
|
|
||||||
# define __HYPERV_NETWORK_DRIVER_H__
|
|
||||||
|
|
||||||
int hypervNetworkRegister(void);
|
|
||||||
|
|
||||||
#endif /* __HYPERV_NETWORK_DRIVER_H__ */
|
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_nwfilter_driver.c: nwfilter driver functions for managing
|
|
||||||
* Microsoft Hyper-V firewall rules
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
#include "virerror.h"
|
|
||||||
#include "datatypes.h"
|
|
||||||
#include "viralloc.h"
|
|
||||||
#include "viruuid.h"
|
|
||||||
#include "hyperv_nwfilter_driver.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_HYPERV
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
hypervNWFilterOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_HYPERV)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
hypervNWFilterClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virNWFilterDriver hypervNWFilterDriver = {
|
|
||||||
.name = "Hyper-V",
|
|
||||||
.nwfilterOpen = hypervNWFilterOpen, /* 0.9.5 */
|
|
||||||
.nwfilterClose = hypervNWFilterClose, /* 0.9.5 */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
hypervNWFilterRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterNWFilterDriver(&hypervNWFilterDriver);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_nwfilter_driver.h: nwfilter driver functions for managing
|
|
||||||
* Microsoft Hyper-V firewall rules
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __HYPERV_NWFILTER_DRIVER_H__
|
|
||||||
# define __HYPERV_NWFILTER_DRIVER_H__
|
|
||||||
|
|
||||||
int hypervNWFilterRegister(void);
|
|
||||||
|
|
||||||
#endif /* __HYPERV_NWFILTER_DRIVER_H__ */
|
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_secret_driver.c: secret driver functions for Microsoft Hyper-V
|
|
||||||
* secret manipulation
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
#include "virerror.h"
|
|
||||||
#include "datatypes.h"
|
|
||||||
#include "viralloc.h"
|
|
||||||
#include "viruuid.h"
|
|
||||||
#include "hyperv_secret_driver.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_HYPERV
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
hypervSecretOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_HYPERV)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
hypervSecretClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virSecretDriver hypervSecretDriver = {
|
|
||||||
.name = "Hyper-V",
|
|
||||||
.secretOpen = hypervSecretOpen, /* 0.9.5 */
|
|
||||||
.secretClose = hypervSecretClose, /* 0.9.5 */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
hypervSecretRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterSecretDriver(&hypervSecretDriver);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_secret_driver.h: secret driver functions for Microsoft Hyper-V
|
|
||||||
* secret manipulation
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __HYPERV_SECRET_DRIVER_H__
|
|
||||||
# define __HYPERV_SECRET_DRIVER_H__
|
|
||||||
|
|
||||||
int hypervSecretRegister(void);
|
|
||||||
|
|
||||||
#endif /* __HYPERV_SECRET_DRIVER_H__ */
|
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_storage_driver.c: storage driver functions for managing
|
|
||||||
* Microsoft Hyper-V host storage
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <config.h>
|
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
#include "virerror.h"
|
|
||||||
#include "datatypes.h"
|
|
||||||
#include "viralloc.h"
|
|
||||||
#include "viruuid.h"
|
|
||||||
#include "hyperv_storage_driver.h"
|
|
||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_HYPERV
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
hypervStorageOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_HYPERV)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
hypervStorageClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virStorageDriver hypervStorageDriver = {
|
|
||||||
.name = "Hyper-V",
|
|
||||||
.storageOpen = hypervStorageOpen, /* 0.9.5*/
|
|
||||||
.storageClose = hypervStorageClose, /* 0.9.5 */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
hypervStorageRegister(void)
|
|
||||||
{
|
|
||||||
return virRegisterStorageDriver(&hypervStorageDriver);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* hyperv_storage_driver.h: storage driver methods for managing
|
|
||||||
* Microsoft Hyper-V host storage
|
|
||||||
*
|
|
||||||
* Copyright (C) 2011 Matthias Bolte <matthias.bolte@googlemail.com>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see
|
|
||||||
* <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __HYPERV_STORAGE_DRIVER_H__
|
|
||||||
# define __HYPERV_STORAGE_DRIVER_H__
|
|
||||||
|
|
||||||
int hypervStorageRegister(void);
|
|
||||||
|
|
||||||
#endif /* __HYPERV_STORAGE_DRIVER_H__ */
|
|
@ -264,25 +264,6 @@ netcfInterfaceObjIsActive(struct netcf_if *iface,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
netcfInterfaceOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (!driver)
|
|
||||||
return VIR_DRV_OPEN_ERROR;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
netcfInterfaceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int netcfConnectNumOfInterfacesImpl(virConnectPtr conn,
|
static int netcfConnectNumOfInterfacesImpl(virConnectPtr conn,
|
||||||
int status,
|
int status,
|
||||||
virInterfaceObjListFilter filter)
|
virInterfaceObjListFilter filter)
|
||||||
@ -1136,8 +1117,6 @@ static int netcfInterfaceChangeRollback(virConnectPtr conn, unsigned int flags)
|
|||||||
|
|
||||||
static virInterfaceDriver interfaceDriver = {
|
static virInterfaceDriver interfaceDriver = {
|
||||||
.name = INTERFACE_DRIVER_NAME,
|
.name = INTERFACE_DRIVER_NAME,
|
||||||
.interfaceOpen = netcfInterfaceOpen, /* 0.7.0 */
|
|
||||||
.interfaceClose = netcfInterfaceClose, /* 0.7.0 */
|
|
||||||
.connectNumOfInterfaces = netcfConnectNumOfInterfaces, /* 0.7.0 */
|
.connectNumOfInterfaces = netcfConnectNumOfInterfaces, /* 0.7.0 */
|
||||||
.connectListInterfaces = netcfConnectListInterfaces, /* 0.7.0 */
|
.connectListInterfaces = netcfConnectListInterfaces, /* 0.7.0 */
|
||||||
.connectNumOfDefinedInterfaces = netcfConnectNumOfDefinedInterfaces, /* 0.7.0 */
|
.connectNumOfDefinedInterfaces = netcfConnectNumOfDefinedInterfaces, /* 0.7.0 */
|
||||||
@ -1167,11 +1146,8 @@ static virStateDriver interfaceStateDriver = {
|
|||||||
|
|
||||||
int netcfIfaceRegister(void)
|
int netcfIfaceRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterInterfaceDriver(&interfaceDriver) < 0) {
|
if (virSetSharedInterfaceDriver(&interfaceDriver) < 0)
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("failed to register netcf interface driver"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
if (virRegisterStateDriver(&interfaceStateDriver) < 0)
|
if (virRegisterStateDriver(&interfaceStateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -135,25 +135,6 @@ udevGetDevices(struct udev *udev, virUdevStatus status)
|
|||||||
return enumerate;
|
return enumerate;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
udevInterfaceOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (!driver)
|
|
||||||
return VIR_DRV_OPEN_ERROR;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
udevInterfaceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
udevNumOfInterfacesByStatus(virConnectPtr conn, virUdevStatus status,
|
udevNumOfInterfacesByStatus(virConnectPtr conn, virUdevStatus status,
|
||||||
virInterfaceObjListFilter filter)
|
virInterfaceObjListFilter filter)
|
||||||
@ -1212,9 +1193,7 @@ udevStateCleanup(void)
|
|||||||
|
|
||||||
|
|
||||||
static virInterfaceDriver udevIfaceDriver = {
|
static virInterfaceDriver udevIfaceDriver = {
|
||||||
"udev",
|
.name = "udev",
|
||||||
.interfaceOpen = udevInterfaceOpen, /* 1.0.0 */
|
|
||||||
.interfaceClose = udevInterfaceClose, /* 1.0.0 */
|
|
||||||
.connectNumOfInterfaces = udevConnectNumOfInterfaces, /* 1.0.0 */
|
.connectNumOfInterfaces = udevConnectNumOfInterfaces, /* 1.0.0 */
|
||||||
.connectListInterfaces = udevConnectListInterfaces, /* 1.0.0 */
|
.connectListInterfaces = udevConnectListInterfaces, /* 1.0.0 */
|
||||||
.connectNumOfDefinedInterfaces = udevConnectNumOfDefinedInterfaces, /* 1.0.0 */
|
.connectNumOfDefinedInterfaces = udevConnectNumOfDefinedInterfaces, /* 1.0.0 */
|
||||||
@ -1235,7 +1214,7 @@ static virStateDriver interfaceStateDriver = {
|
|||||||
int
|
int
|
||||||
udevIfaceRegister(void)
|
udevIfaceRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterInterfaceDriver(&udevIfaceDriver) < 0) {
|
if (virSetSharedInterfaceDriver(&udevIfaceDriver) < 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("failed to register udev interface driver"));
|
_("failed to register udev interface driver"));
|
||||||
return -1;
|
return -1;
|
||||||
|
323
src/libvirt.c
323
src/libvirt.c
@ -111,33 +111,18 @@ VIR_LOG_INIT("libvirt");
|
|||||||
|
|
||||||
#define MAX_DRIVERS 20
|
#define MAX_DRIVERS 20
|
||||||
|
|
||||||
#define virDriverCheckTabMaxReturn(count, ret) \
|
static virConnectDriverPtr virConnectDriverTab[MAX_DRIVERS];
|
||||||
do { \
|
static int virConnectDriverTabCount;
|
||||||
if ((count) >= MAX_DRIVERS) { \
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, \
|
|
||||||
_("Too many drivers, cannot register %s"), \
|
|
||||||
driver->name); \
|
|
||||||
return ret; \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
static virHypervisorDriverPtr virHypervisorDriverTab[MAX_DRIVERS];
|
|
||||||
static int virHypervisorDriverTabCount;
|
|
||||||
static virNetworkDriverPtr virNetworkDriverTab[MAX_DRIVERS];
|
|
||||||
static int virNetworkDriverTabCount;
|
|
||||||
static virInterfaceDriverPtr virInterfaceDriverTab[MAX_DRIVERS];
|
|
||||||
static int virInterfaceDriverTabCount;
|
|
||||||
static virStorageDriverPtr virStorageDriverTab[MAX_DRIVERS];
|
|
||||||
static int virStorageDriverTabCount;
|
|
||||||
static virNodeDeviceDriverPtr virNodeDeviceDriverTab[MAX_DRIVERS];
|
|
||||||
static int virNodeDeviceDriverTabCount;
|
|
||||||
static virSecretDriverPtr virSecretDriverTab[MAX_DRIVERS];
|
|
||||||
static int virSecretDriverTabCount;
|
|
||||||
static virNWFilterDriverPtr virNWFilterDriverTab[MAX_DRIVERS];
|
|
||||||
static int virNWFilterDriverTabCount;
|
|
||||||
static virStateDriverPtr virStateDriverTab[MAX_DRIVERS];
|
static virStateDriverPtr virStateDriverTab[MAX_DRIVERS];
|
||||||
static int virStateDriverTabCount;
|
static int virStateDriverTabCount;
|
||||||
|
|
||||||
|
static virNetworkDriverPtr virSharedNetworkDriver;
|
||||||
|
static virInterfaceDriverPtr virSharedInterfaceDriver;
|
||||||
|
static virStorageDriverPtr virSharedStorageDriver;
|
||||||
|
static virNodeDeviceDriverPtr virSharedNodeDeviceDriver;
|
||||||
|
static virSecretDriverPtr virSharedSecretDriver;
|
||||||
|
static virNWFilterDriverPtr virSharedNWFilterDriver;
|
||||||
|
|
||||||
|
|
||||||
#if defined(POLKIT_AUTH)
|
#if defined(POLKIT_AUTH)
|
||||||
static int
|
static int
|
||||||
@ -533,29 +518,33 @@ DllMain(HINSTANCE instance ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virRegisterNetworkDriver:
|
* virSetSharedNetworkDriver:
|
||||||
* @driver: pointer to a network driver block
|
* @driver: pointer to a network driver block
|
||||||
*
|
*
|
||||||
* Register a network virtualization driver
|
* Register a network virtualization driver
|
||||||
*
|
*
|
||||||
* Returns the driver priority or -1 in case of error.
|
* Returns 0 on success, or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
virRegisterNetworkDriver(virNetworkDriverPtr driver)
|
virSetSharedNetworkDriver(virNetworkDriverPtr driver)
|
||||||
{
|
{
|
||||||
virCheckNonNullArgReturn(driver, -1);
|
virCheckNonNullArgReturn(driver, -1);
|
||||||
virDriverCheckTabMaxReturn(virNetworkDriverTabCount, -1);
|
|
||||||
|
|
||||||
VIR_DEBUG("registering %s as network driver %d",
|
if (virSharedNetworkDriver) {
|
||||||
driver->name, virNetworkDriverTabCount);
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("A network driver is already registered"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
virNetworkDriverTab[virNetworkDriverTabCount] = driver;
|
VIR_DEBUG("registering %s as network driver", driver->name);
|
||||||
return virNetworkDriverTabCount++;
|
|
||||||
|
virSharedNetworkDriver = driver;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virRegisterInterfaceDriver:
|
* virSetSharedInterfaceDriver:
|
||||||
* @driver: pointer to an interface driver block
|
* @driver: pointer to an interface driver block
|
||||||
*
|
*
|
||||||
* Register an interface virtualization driver
|
* Register an interface virtualization driver
|
||||||
@ -563,21 +552,25 @@ virRegisterNetworkDriver(virNetworkDriverPtr driver)
|
|||||||
* Returns the driver priority or -1 in case of error.
|
* Returns the driver priority or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
virRegisterInterfaceDriver(virInterfaceDriverPtr driver)
|
virSetSharedInterfaceDriver(virInterfaceDriverPtr driver)
|
||||||
{
|
{
|
||||||
virCheckNonNullArgReturn(driver, -1);
|
virCheckNonNullArgReturn(driver, -1);
|
||||||
virDriverCheckTabMaxReturn(virInterfaceDriverTabCount, -1);
|
|
||||||
|
|
||||||
VIR_DEBUG("registering %s as interface driver %d",
|
if (virSharedInterfaceDriver) {
|
||||||
driver->name, virInterfaceDriverTabCount);
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("A interface driver is already registered"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
virInterfaceDriverTab[virInterfaceDriverTabCount] = driver;
|
VIR_DEBUG("registering %s as interface driver", driver->name);
|
||||||
return virInterfaceDriverTabCount++;
|
|
||||||
|
virSharedInterfaceDriver = driver;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virRegisterStorageDriver:
|
* virSetSharedStorageDriver:
|
||||||
* @driver: pointer to a storage driver block
|
* @driver: pointer to a storage driver block
|
||||||
*
|
*
|
||||||
* Register a storage virtualization driver
|
* Register a storage virtualization driver
|
||||||
@ -585,21 +578,25 @@ virRegisterInterfaceDriver(virInterfaceDriverPtr driver)
|
|||||||
* Returns the driver priority or -1 in case of error.
|
* Returns the driver priority or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
virRegisterStorageDriver(virStorageDriverPtr driver)
|
virSetSharedStorageDriver(virStorageDriverPtr driver)
|
||||||
{
|
{
|
||||||
virCheckNonNullArgReturn(driver, -1);
|
virCheckNonNullArgReturn(driver, -1);
|
||||||
virDriverCheckTabMaxReturn(virStorageDriverTabCount, -1);
|
|
||||||
|
|
||||||
VIR_DEBUG("registering %s as storage driver %d",
|
if (virSharedStorageDriver) {
|
||||||
driver->name, virStorageDriverTabCount);
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("A storage driver is already registered"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
virStorageDriverTab[virStorageDriverTabCount] = driver;
|
VIR_DEBUG("registering %s as storage driver", driver->name);
|
||||||
return virStorageDriverTabCount++;
|
|
||||||
|
virSharedStorageDriver = driver;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virRegisterNodeDeviceDriver:
|
* virSetSharedNodeDeviceDriver:
|
||||||
* @driver: pointer to a device monitor block
|
* @driver: pointer to a device monitor block
|
||||||
*
|
*
|
||||||
* Register a device monitor
|
* Register a device monitor
|
||||||
@ -607,21 +604,25 @@ virRegisterStorageDriver(virStorageDriverPtr driver)
|
|||||||
* Returns the driver priority or -1 in case of error.
|
* Returns the driver priority or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
virRegisterNodeDeviceDriver(virNodeDeviceDriverPtr driver)
|
virSetSharedNodeDeviceDriver(virNodeDeviceDriverPtr driver)
|
||||||
{
|
{
|
||||||
virCheckNonNullArgReturn(driver, -1);
|
virCheckNonNullArgReturn(driver, -1);
|
||||||
virDriverCheckTabMaxReturn(virNodeDeviceDriverTabCount, -1);
|
|
||||||
|
|
||||||
VIR_DEBUG("registering %s as device driver %d",
|
if (virSharedNodeDeviceDriver) {
|
||||||
driver->name, virNodeDeviceDriverTabCount);
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("A node device driver is already registered"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
virNodeDeviceDriverTab[virNodeDeviceDriverTabCount] = driver;
|
VIR_DEBUG("registering %s as device driver", driver->name);
|
||||||
return virNodeDeviceDriverTabCount++;
|
|
||||||
|
virSharedNodeDeviceDriver = driver;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virRegisterSecretDriver:
|
* virSetSharedSecretDriver:
|
||||||
* @driver: pointer to a secret driver block
|
* @driver: pointer to a secret driver block
|
||||||
*
|
*
|
||||||
* Register a secret driver
|
* Register a secret driver
|
||||||
@ -629,21 +630,25 @@ virRegisterNodeDeviceDriver(virNodeDeviceDriverPtr driver)
|
|||||||
* Returns the driver priority or -1 in case of error.
|
* Returns the driver priority or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
virRegisterSecretDriver(virSecretDriverPtr driver)
|
virSetSharedSecretDriver(virSecretDriverPtr driver)
|
||||||
{
|
{
|
||||||
virCheckNonNullArgReturn(driver, -1);
|
virCheckNonNullArgReturn(driver, -1);
|
||||||
virDriverCheckTabMaxReturn(virSecretDriverTabCount, -1);
|
|
||||||
|
|
||||||
VIR_DEBUG("registering %s as secret driver %d",
|
if (virSharedSecretDriver) {
|
||||||
driver->name, virSecretDriverTabCount);
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("A secret driver is already registered"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
virSecretDriverTab[virSecretDriverTabCount] = driver;
|
VIR_DEBUG("registering %s as secret driver", driver->name);
|
||||||
return virSecretDriverTabCount++;
|
|
||||||
|
virSharedSecretDriver = driver;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virRegisterNWFilterDriver:
|
* virSetSharedNWFilterDriver:
|
||||||
* @driver: pointer to a network filter driver block
|
* @driver: pointer to a network filter driver block
|
||||||
*
|
*
|
||||||
* Register a network filter virtualization driver
|
* Register a network filter virtualization driver
|
||||||
@ -651,41 +656,68 @@ virRegisterSecretDriver(virSecretDriverPtr driver)
|
|||||||
* Returns the driver priority or -1 in case of error.
|
* Returns the driver priority or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
virRegisterNWFilterDriver(virNWFilterDriverPtr driver)
|
virSetSharedNWFilterDriver(virNWFilterDriverPtr driver)
|
||||||
{
|
{
|
||||||
virCheckNonNullArgReturn(driver, -1);
|
virCheckNonNullArgReturn(driver, -1);
|
||||||
virDriverCheckTabMaxReturn(virNWFilterDriverTabCount, -1);
|
|
||||||
|
|
||||||
VIR_DEBUG("registering %s as network filter driver %d",
|
if (virSharedNWFilterDriver) {
|
||||||
driver->name, virNWFilterDriverTabCount);
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
_("A network filter driver is already registered"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
virNWFilterDriverTab[virNWFilterDriverTabCount] = driver;
|
VIR_DEBUG("registering %s as network filter driver", driver->name);
|
||||||
return virNWFilterDriverTabCount++;
|
|
||||||
|
virSharedNWFilterDriver = driver;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virRegisterHypervisorDriver:
|
* virRegisterConnectDriver:
|
||||||
* @driver: pointer to a driver block
|
* @driver: pointer to a driver block
|
||||||
|
* @setSharedDrivers: populate shared drivers
|
||||||
*
|
*
|
||||||
* Register a virtualization driver
|
* Register a virtualization driver, optionally filling in
|
||||||
|
* any empty pointers for shared secondary drivers
|
||||||
*
|
*
|
||||||
* Returns the driver priority or -1 in case of error.
|
* Returns the driver priority or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
virRegisterHypervisorDriver(virHypervisorDriverPtr driver)
|
virRegisterConnectDriver(virConnectDriverPtr driver,
|
||||||
|
bool setSharedDrivers)
|
||||||
{
|
{
|
||||||
VIR_DEBUG("driver=%p name=%s", driver,
|
VIR_DEBUG("driver=%p name=%s", driver,
|
||||||
driver ? NULLSTR(driver->name) : "(null)");
|
driver ? NULLSTR(driver->hypervisorDriver->name) : "(null)");
|
||||||
|
|
||||||
virCheckNonNullArgReturn(driver, -1);
|
virCheckNonNullArgReturn(driver, -1);
|
||||||
virDriverCheckTabMaxReturn(virHypervisorDriverTabCount, -1);
|
if (virConnectDriverTabCount >= MAX_DRIVERS) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Too many drivers, cannot register %s"),
|
||||||
|
driver->hypervisorDriver->name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
VIR_DEBUG("registering %s as driver %d",
|
VIR_DEBUG("registering %s as driver %d",
|
||||||
driver->name, virHypervisorDriverTabCount);
|
driver->hypervisorDriver->name, virConnectDriverTabCount);
|
||||||
|
|
||||||
virHypervisorDriverTab[virHypervisorDriverTabCount] = driver;
|
if (setSharedDrivers) {
|
||||||
return virHypervisorDriverTabCount++;
|
if (driver->interfaceDriver == NULL)
|
||||||
|
driver->interfaceDriver = virSharedInterfaceDriver;
|
||||||
|
if (driver->networkDriver == NULL)
|
||||||
|
driver->networkDriver = virSharedNetworkDriver;
|
||||||
|
if (driver->nodeDeviceDriver == NULL)
|
||||||
|
driver->nodeDeviceDriver = virSharedNodeDeviceDriver;
|
||||||
|
if (driver->nwfilterDriver == NULL)
|
||||||
|
driver->nwfilterDriver = virSharedNWFilterDriver;
|
||||||
|
if (driver->secretDriver == NULL)
|
||||||
|
driver->secretDriver = virSharedSecretDriver;
|
||||||
|
if (driver->storageDriver == NULL)
|
||||||
|
driver->storageDriver = virSharedStorageDriver;
|
||||||
|
}
|
||||||
|
|
||||||
|
virConnectDriverTab[virConnectDriverTabCount] = driver;
|
||||||
|
return virConnectDriverTabCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -701,7 +733,13 @@ int
|
|||||||
virRegisterStateDriver(virStateDriverPtr driver)
|
virRegisterStateDriver(virStateDriverPtr driver)
|
||||||
{
|
{
|
||||||
virCheckNonNullArgReturn(driver, -1);
|
virCheckNonNullArgReturn(driver, -1);
|
||||||
virDriverCheckTabMaxReturn(virStateDriverTabCount, -1);
|
|
||||||
|
if (virStateDriverTabCount >= MAX_DRIVERS) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Too many drivers, cannot register %s"),
|
||||||
|
driver->name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
virStateDriverTab[virStateDriverTabCount] = driver;
|
virStateDriverTab[virStateDriverTabCount] = driver;
|
||||||
return virStateDriverTabCount++;
|
return virStateDriverTabCount++;
|
||||||
@ -1101,7 +1139,7 @@ do_open(const char *name,
|
|||||||
/* Cleansing flags */
|
/* Cleansing flags */
|
||||||
ret->flags = flags & VIR_CONNECT_RO;
|
ret->flags = flags & VIR_CONNECT_RO;
|
||||||
|
|
||||||
for (i = 0; i < virHypervisorDriverTabCount; i++) {
|
for (i = 0; i < virConnectDriverTabCount; i++) {
|
||||||
/* We're going to probe the remote driver next. So we have already
|
/* We're going to probe the remote driver next. So we have already
|
||||||
* probed all other client-side-only driver before, but none of them
|
* probed all other client-side-only driver before, but none of them
|
||||||
* accepted the URI.
|
* accepted the URI.
|
||||||
@ -1109,7 +1147,7 @@ do_open(const char *name,
|
|||||||
* driver then report a useful error, instead of a cryptic one about
|
* driver then report a useful error, instead of a cryptic one about
|
||||||
* not being able to connect to libvirtd or not being able to find
|
* not being able to connect to libvirtd or not being able to find
|
||||||
* certificates. */
|
* certificates. */
|
||||||
if (virHypervisorDriverTab[i]->no == VIR_DRV_REMOTE &&
|
if (STREQ(virConnectDriverTab[i]->hypervisorDriver->name, "remote") &&
|
||||||
ret->uri != NULL && ret->uri->scheme != NULL &&
|
ret->uri != NULL && ret->uri->scheme != NULL &&
|
||||||
(
|
(
|
||||||
#ifndef WITH_PHYP
|
#ifndef WITH_PHYP
|
||||||
@ -1137,22 +1175,37 @@ do_open(const char *name,
|
|||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("trying driver %zu (%s) ...", i, virHypervisorDriverTab[i]->name);
|
VIR_DEBUG("trying driver %zu (%s) ...",
|
||||||
ret->driver = virHypervisorDriverTab[i];
|
i, virConnectDriverTab[i]->hypervisorDriver->name);
|
||||||
res = virHypervisorDriverTab[i]->connectOpen(ret, auth, flags);
|
|
||||||
|
ret->driver = virConnectDriverTab[i]->hypervisorDriver;
|
||||||
|
ret->interfaceDriver = virConnectDriverTab[i]->interfaceDriver;
|
||||||
|
ret->networkDriver = virConnectDriverTab[i]->networkDriver;
|
||||||
|
ret->nodeDeviceDriver = virConnectDriverTab[i]->nodeDeviceDriver;
|
||||||
|
ret->nwfilterDriver = virConnectDriverTab[i]->nwfilterDriver;
|
||||||
|
ret->secretDriver = virConnectDriverTab[i]->secretDriver;
|
||||||
|
ret->storageDriver = virConnectDriverTab[i]->storageDriver;
|
||||||
|
|
||||||
|
res = virConnectDriverTab[i]->hypervisorDriver->connectOpen(ret, auth, flags);
|
||||||
VIR_DEBUG("driver %zu %s returned %s",
|
VIR_DEBUG("driver %zu %s returned %s",
|
||||||
i, virHypervisorDriverTab[i]->name,
|
i, virConnectDriverTab[i]->hypervisorDriver->name,
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
||||||
(res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
|
(res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
|
||||||
|
|
||||||
if (res == VIR_DRV_OPEN_SUCCESS) {
|
if (res == VIR_DRV_OPEN_SUCCESS) {
|
||||||
break;
|
break;
|
||||||
} else if (res == VIR_DRV_OPEN_ERROR) {
|
|
||||||
ret->driver = NULL;
|
|
||||||
goto failed;
|
|
||||||
} else {
|
} else {
|
||||||
ret->driver = NULL;
|
ret->driver = NULL;
|
||||||
|
ret->interfaceDriver = NULL;
|
||||||
|
ret->networkDriver = NULL;
|
||||||
|
ret->nodeDeviceDriver = NULL;
|
||||||
|
ret->nwfilterDriver = NULL;
|
||||||
|
ret->secretDriver = NULL;
|
||||||
|
ret->storageDriver = NULL;
|
||||||
|
|
||||||
|
if (res == VIR_DRV_OPEN_ERROR)
|
||||||
|
goto failed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1162,106 +1215,6 @@ do_open(const char *name,
|
|||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < virNetworkDriverTabCount; i++) {
|
|
||||||
res = virNetworkDriverTab[i]->networkOpen(ret, auth, flags);
|
|
||||||
VIR_DEBUG("network driver %zu %s returned %s",
|
|
||||||
i, virNetworkDriverTab[i]->name,
|
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
|
||||||
(res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
|
|
||||||
|
|
||||||
if (res == VIR_DRV_OPEN_SUCCESS) {
|
|
||||||
ret->networkDriver = virNetworkDriverTab[i];
|
|
||||||
break;
|
|
||||||
} else if (res == VIR_DRV_OPEN_ERROR) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < virInterfaceDriverTabCount; i++) {
|
|
||||||
res = virInterfaceDriverTab[i]->interfaceOpen(ret, auth, flags);
|
|
||||||
VIR_DEBUG("interface driver %zu %s returned %s",
|
|
||||||
i, virInterfaceDriverTab[i]->name,
|
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
|
||||||
(res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
|
|
||||||
|
|
||||||
if (res == VIR_DRV_OPEN_SUCCESS) {
|
|
||||||
ret->interfaceDriver = virInterfaceDriverTab[i];
|
|
||||||
break;
|
|
||||||
} else if (res == VIR_DRV_OPEN_ERROR) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Secondary driver for storage. Optional */
|
|
||||||
for (i = 0; i < virStorageDriverTabCount; i++) {
|
|
||||||
res = virStorageDriverTab[i]->storageOpen(ret, auth, flags);
|
|
||||||
VIR_DEBUG("storage driver %zu %s returned %s",
|
|
||||||
i, virStorageDriverTab[i]->name,
|
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
|
||||||
(res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
|
|
||||||
|
|
||||||
if (res == VIR_DRV_OPEN_SUCCESS) {
|
|
||||||
ret->storageDriver = virStorageDriverTab[i];
|
|
||||||
break;
|
|
||||||
} else if (res == VIR_DRV_OPEN_ERROR) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Node driver (optional) */
|
|
||||||
for (i = 0; i < virNodeDeviceDriverTabCount; i++) {
|
|
||||||
res = virNodeDeviceDriverTab[i]->nodeDeviceOpen(ret, auth, flags);
|
|
||||||
VIR_DEBUG("node driver %zu %s returned %s",
|
|
||||||
i, virNodeDeviceDriverTab[i]->name,
|
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
|
||||||
(res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
|
|
||||||
|
|
||||||
if (res == VIR_DRV_OPEN_SUCCESS) {
|
|
||||||
ret->nodeDeviceDriver = virNodeDeviceDriverTab[i];
|
|
||||||
break;
|
|
||||||
} else if (res == VIR_DRV_OPEN_ERROR) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Secret manipulation driver. Optional */
|
|
||||||
for (i = 0; i < virSecretDriverTabCount; i++) {
|
|
||||||
res = virSecretDriverTab[i]->secretOpen(ret, auth, flags);
|
|
||||||
VIR_DEBUG("secret driver %zu %s returned %s",
|
|
||||||
i, virSecretDriverTab[i]->name,
|
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
|
||||||
(res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
|
|
||||||
|
|
||||||
if (res == VIR_DRV_OPEN_SUCCESS) {
|
|
||||||
ret->secretDriver = virSecretDriverTab[i];
|
|
||||||
break;
|
|
||||||
} else if (res == VIR_DRV_OPEN_ERROR) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Network filter driver. Optional */
|
|
||||||
for (i = 0; i < virNWFilterDriverTabCount; i++) {
|
|
||||||
res = virNWFilterDriverTab[i]->nwfilterOpen(ret, auth, flags);
|
|
||||||
VIR_DEBUG("nwfilter driver %zu %s returned %s",
|
|
||||||
i, virNWFilterDriverTab[i]->name,
|
|
||||||
res == VIR_DRV_OPEN_SUCCESS ? "SUCCESS" :
|
|
||||||
(res == VIR_DRV_OPEN_DECLINED ? "DECLINED" :
|
|
||||||
(res == VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown status")));
|
|
||||||
|
|
||||||
if (res == VIR_DRV_OPEN_SUCCESS) {
|
|
||||||
ret->nwfilterDriver = virNWFilterDriverTab[i];
|
|
||||||
break;
|
|
||||||
} else if (res == VIR_DRV_OPEN_ERROR) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
virConfFree(conf);
|
virConfFree(conf);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -883,14 +883,14 @@ virDomainMigratePrepare3Params;
|
|||||||
virDomainMigratePrepareTunnel;
|
virDomainMigratePrepareTunnel;
|
||||||
virDomainMigratePrepareTunnel3;
|
virDomainMigratePrepareTunnel3;
|
||||||
virDomainMigratePrepareTunnel3Params;
|
virDomainMigratePrepareTunnel3Params;
|
||||||
virRegisterHypervisorDriver;
|
virRegisterConnectDriver;
|
||||||
virRegisterInterfaceDriver;
|
|
||||||
virRegisterNetworkDriver;
|
|
||||||
virRegisterNodeDeviceDriver;
|
|
||||||
virRegisterNWFilterDriver;
|
|
||||||
virRegisterSecretDriver;
|
|
||||||
virRegisterStateDriver;
|
virRegisterStateDriver;
|
||||||
virRegisterStorageDriver;
|
virSetSharedInterfaceDriver;
|
||||||
|
virSetSharedNetworkDriver;
|
||||||
|
virSetSharedNodeDeviceDriver;
|
||||||
|
virSetSharedNWFilterDriver;
|
||||||
|
virSetSharedSecretDriver;
|
||||||
|
virSetSharedStorageDriver;
|
||||||
virStateCleanup;
|
virStateCleanup;
|
||||||
virStateInitialize;
|
virStateInitialize;
|
||||||
virStateReload;
|
virStateReload;
|
||||||
|
@ -4749,8 +4749,7 @@ libxlDomainMigrateConfirm3Params(virDomainPtr domain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virHypervisorDriver libxlDriver = {
|
static virHypervisorDriver libxlHypervisorDriver = {
|
||||||
.no = VIR_DRV_LIBXL,
|
|
||||||
.name = LIBXL_DRIVER_NAME,
|
.name = LIBXL_DRIVER_NAME,
|
||||||
.connectOpen = libxlConnectOpen, /* 0.9.0 */
|
.connectOpen = libxlConnectOpen, /* 0.9.0 */
|
||||||
.connectClose = libxlConnectClose, /* 0.9.0 */
|
.connectClose = libxlConnectClose, /* 0.9.0 */
|
||||||
@ -4846,6 +4845,10 @@ static virHypervisorDriver libxlDriver = {
|
|||||||
.domainMigrateConfirm3Params = libxlDomainMigrateConfirm3Params, /* 1.2.6 */
|
.domainMigrateConfirm3Params = libxlDomainMigrateConfirm3Params, /* 1.2.6 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virConnectDriver libxlConnectDriver = {
|
||||||
|
.hypervisorDriver = &libxlHypervisorDriver,
|
||||||
|
};
|
||||||
|
|
||||||
static virStateDriver libxlStateDriver = {
|
static virStateDriver libxlStateDriver = {
|
||||||
.name = "LIBXL",
|
.name = "LIBXL",
|
||||||
.stateInitialize = libxlStateInitialize,
|
.stateInitialize = libxlStateInitialize,
|
||||||
@ -4858,7 +4861,8 @@ static virStateDriver libxlStateDriver = {
|
|||||||
int
|
int
|
||||||
libxlRegister(void)
|
libxlRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&libxlDriver) < 0)
|
if (virRegisterConnectDriver(&libxlConnectDriver,
|
||||||
|
true) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&libxlStateDriver) < 0)
|
if (virRegisterStateDriver(&libxlStateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -5727,8 +5727,7 @@ lxcNodeAllocPages(virConnectPtr conn,
|
|||||||
|
|
||||||
|
|
||||||
/* Function Tables */
|
/* Function Tables */
|
||||||
static virHypervisorDriver lxcDriver = {
|
static virHypervisorDriver lxcHypervisorDriver = {
|
||||||
.no = VIR_DRV_LXC,
|
|
||||||
.name = LXC_DRIVER_NAME,
|
.name = LXC_DRIVER_NAME,
|
||||||
.connectOpen = lxcConnectOpen, /* 0.4.2 */
|
.connectOpen = lxcConnectOpen, /* 0.4.2 */
|
||||||
.connectClose = lxcConnectClose, /* 0.4.2 */
|
.connectClose = lxcConnectClose, /* 0.4.2 */
|
||||||
@ -5821,6 +5820,10 @@ static virHypervisorDriver lxcDriver = {
|
|||||||
.nodeAllocPages = lxcNodeAllocPages, /* 1.2.9 */
|
.nodeAllocPages = lxcNodeAllocPages, /* 1.2.9 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virConnectDriver lxcConnectDriver = {
|
||||||
|
.hypervisorDriver = &lxcHypervisorDriver,
|
||||||
|
};
|
||||||
|
|
||||||
static virStateDriver lxcStateDriver = {
|
static virStateDriver lxcStateDriver = {
|
||||||
.name = LXC_DRIVER_NAME,
|
.name = LXC_DRIVER_NAME,
|
||||||
.stateInitialize = lxcStateInitialize,
|
.stateInitialize = lxcStateInitialize,
|
||||||
@ -5831,7 +5834,8 @@ static virStateDriver lxcStateDriver = {
|
|||||||
|
|
||||||
int lxcRegister(void)
|
int lxcRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&lxcDriver) < 0)
|
if (virRegisterConnectDriver(&lxcConnectDriver,
|
||||||
|
true) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&lxcStateDriver) < 0)
|
if (virRegisterStateDriver(&lxcStateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2514,23 +2514,6 @@ static virNetworkPtr networkLookupByName(virConnectPtr conn,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus networkOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (!driver)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int networkClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int networkConnectNumOfNetworks(virConnectPtr conn)
|
static int networkConnectNumOfNetworks(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
int nactive = 0;
|
int nactive = 0;
|
||||||
@ -3670,9 +3653,7 @@ networkGetDHCPLeases(virNetworkPtr network,
|
|||||||
|
|
||||||
|
|
||||||
static virNetworkDriver networkDriver = {
|
static virNetworkDriver networkDriver = {
|
||||||
"Network",
|
.name = "bridge",
|
||||||
.networkOpen = networkOpen, /* 0.2.0 */
|
|
||||||
.networkClose = networkClose, /* 0.2.0 */
|
|
||||||
.connectNumOfNetworks = networkConnectNumOfNetworks, /* 0.2.0 */
|
.connectNumOfNetworks = networkConnectNumOfNetworks, /* 0.2.0 */
|
||||||
.connectListNetworks = networkConnectListNetworks, /* 0.2.0 */
|
.connectListNetworks = networkConnectListNetworks, /* 0.2.0 */
|
||||||
.connectNumOfDefinedNetworks = networkConnectNumOfDefinedNetworks, /* 0.2.0 */
|
.connectNumOfDefinedNetworks = networkConnectNumOfDefinedNetworks, /* 0.2.0 */
|
||||||
@ -3698,7 +3679,7 @@ static virNetworkDriver networkDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virStateDriver networkStateDriver = {
|
static virStateDriver networkStateDriver = {
|
||||||
.name = "Network",
|
.name = "bridge",
|
||||||
.stateInitialize = networkStateInitialize,
|
.stateInitialize = networkStateInitialize,
|
||||||
.stateAutoStart = networkStateAutoStart,
|
.stateAutoStart = networkStateAutoStart,
|
||||||
.stateCleanup = networkStateCleanup,
|
.stateCleanup = networkStateCleanup,
|
||||||
@ -3707,7 +3688,7 @@ static virStateDriver networkStateDriver = {
|
|||||||
|
|
||||||
int networkRegister(void)
|
int networkRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterNetworkDriver(&networkDriver) < 0)
|
if (virSetSharedNetworkDriver(&networkDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&networkStateDriver) < 0)
|
if (virRegisterStateDriver(&networkStateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -616,17 +616,11 @@ nodeDeviceDestroy(virNodeDevicePtr dev)
|
|||||||
|
|
||||||
int nodedevRegister(void)
|
int nodedevRegister(void)
|
||||||
{
|
{
|
||||||
#if defined(WITH_HAL) && defined(WITH_UDEV)
|
#ifdef WITH_UDEV
|
||||||
/* Register only one of these two - they conflict */
|
return udevNodeRegister();
|
||||||
if (udevNodeRegister() == -1)
|
|
||||||
return halNodeRegister();
|
|
||||||
return 0;
|
|
||||||
#else
|
#else
|
||||||
# ifdef WITH_HAL
|
# ifdef WITH_HAL
|
||||||
return halNodeRegister();
|
return halNodeRegister();
|
||||||
# endif
|
# endif
|
||||||
# ifdef WITH_UDEV
|
|
||||||
return udevNodeRegister();
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -777,30 +777,8 @@ nodeStateReload(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
nodeDeviceOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (driver == NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
nodeDeviceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static virNodeDeviceDriver halNodeDeviceDriver = {
|
static virNodeDeviceDriver halNodeDeviceDriver = {
|
||||||
.name = "halNodeDeviceDriver",
|
.name = "HAL",
|
||||||
.nodeDeviceOpen = nodeDeviceOpen, /* 0.5.0 */
|
|
||||||
.nodeDeviceClose = nodeDeviceClose, /* 0.5.0 */
|
|
||||||
.nodeNumOfDevices = nodeNumOfDevices, /* 0.5.0 */
|
.nodeNumOfDevices = nodeNumOfDevices, /* 0.5.0 */
|
||||||
.nodeListDevices = nodeListDevices, /* 0.5.0 */
|
.nodeListDevices = nodeListDevices, /* 0.5.0 */
|
||||||
.connectListAllNodeDevices = nodeConnectListAllNodeDevices, /* 0.10.2 */
|
.connectListAllNodeDevices = nodeConnectListAllNodeDevices, /* 0.10.2 */
|
||||||
@ -825,7 +803,7 @@ static virStateDriver halStateDriver = {
|
|||||||
int
|
int
|
||||||
halNodeRegister(void)
|
halNodeRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterNodeDeviceDriver(&halNodeDeviceDriver) < 0)
|
if (virSetSharedNodeDeviceDriver(&halNodeDeviceDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
return virRegisterStateDriver(&halStateDriver);
|
return virRegisterStateDriver(&halStateDriver);
|
||||||
}
|
}
|
||||||
|
@ -1821,27 +1821,8 @@ static int nodeStateReload(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus nodeDeviceOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (driver == NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int nodeDeviceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static virNodeDeviceDriver udevNodeDeviceDriver = {
|
static virNodeDeviceDriver udevNodeDeviceDriver = {
|
||||||
.name = "udevNodeDeviceDriver",
|
.name = "udev",
|
||||||
.nodeDeviceOpen = nodeDeviceOpen, /* 0.7.3 */
|
|
||||||
.nodeDeviceClose = nodeDeviceClose, /* 0.7.3 */
|
|
||||||
.nodeNumOfDevices = nodeNumOfDevices, /* 0.7.3 */
|
.nodeNumOfDevices = nodeNumOfDevices, /* 0.7.3 */
|
||||||
.nodeListDevices = nodeListDevices, /* 0.7.3 */
|
.nodeListDevices = nodeListDevices, /* 0.7.3 */
|
||||||
.connectListAllNodeDevices = nodeConnectListAllNodeDevices, /* 0.10.2 */
|
.connectListAllNodeDevices = nodeConnectListAllNodeDevices, /* 0.10.2 */
|
||||||
@ -1866,7 +1847,7 @@ int udevNodeRegister(void)
|
|||||||
{
|
{
|
||||||
VIR_DEBUG("Registering udev node device backend");
|
VIR_DEBUG("Registering udev node device backend");
|
||||||
|
|
||||||
if (virRegisterNodeDeviceDriver(&udevNodeDeviceDriver) < 0)
|
if (virSetSharedNodeDeviceDriver(&udevNodeDeviceDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return virRegisterStateDriver(&udevStateDriver);
|
return virRegisterStateDriver(&udevStateDriver);
|
||||||
|
@ -413,27 +413,6 @@ nwfilterLookupByName(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
nwfilterOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (!driver)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
nwfilterClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
nwfilterConnectNumOfNWFilters(virConnectPtr conn)
|
nwfilterConnectNumOfNWFilters(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
@ -686,8 +665,6 @@ nwfilterTeardownFilter(virDomainNetDefPtr net)
|
|||||||
|
|
||||||
static virNWFilterDriver nwfilterDriver = {
|
static virNWFilterDriver nwfilterDriver = {
|
||||||
.name = "nwfilter",
|
.name = "nwfilter",
|
||||||
.nwfilterOpen = nwfilterOpen, /* 0.8.0 */
|
|
||||||
.nwfilterClose = nwfilterClose, /* 0.8.0 */
|
|
||||||
.connectNumOfNWFilters = nwfilterConnectNumOfNWFilters, /* 0.8.0 */
|
.connectNumOfNWFilters = nwfilterConnectNumOfNWFilters, /* 0.8.0 */
|
||||||
.connectListNWFilters = nwfilterConnectListNWFilters, /* 0.8.0 */
|
.connectListNWFilters = nwfilterConnectListNWFilters, /* 0.8.0 */
|
||||||
.connectListAllNWFilters = nwfilterConnectListAllNWFilters, /* 0.10.2 */
|
.connectListAllNWFilters = nwfilterConnectListAllNWFilters, /* 0.10.2 */
|
||||||
@ -715,7 +692,7 @@ static virDomainConfNWFilterDriver domainNWFilterDriver = {
|
|||||||
|
|
||||||
int nwfilterRegister(void)
|
int nwfilterRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterNWFilterDriver(&nwfilterDriver) < 0)
|
if (virSetSharedNWFilterDriver(&nwfilterDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&stateDriver) < 0)
|
if (virRegisterStateDriver(&stateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2568,8 +2568,7 @@ openvzDomainMigrateConfirm3Params(virDomainPtr domain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virHypervisorDriver openvzDriver = {
|
static virHypervisorDriver openvzHypervisorDriver = {
|
||||||
.no = VIR_DRV_OPENVZ,
|
|
||||||
.name = "OPENVZ",
|
.name = "OPENVZ",
|
||||||
.connectOpen = openvzConnectOpen, /* 0.3.1 */
|
.connectOpen = openvzConnectOpen, /* 0.3.1 */
|
||||||
.connectClose = openvzConnectClose, /* 0.3.1 */
|
.connectClose = openvzConnectClose, /* 0.3.1 */
|
||||||
@ -2635,9 +2634,12 @@ static virHypervisorDriver openvzDriver = {
|
|||||||
.domainMigrateConfirm3Params = openvzDomainMigrateConfirm3Params, /* 1.2.8 */
|
.domainMigrateConfirm3Params = openvzDomainMigrateConfirm3Params, /* 1.2.8 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virConnectDriver openvzConnectDriver = {
|
||||||
|
.hypervisorDriver = &openvzHypervisorDriver,
|
||||||
|
};
|
||||||
|
|
||||||
int openvzRegister(void)
|
int openvzRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&openvzDriver) < 0)
|
return virRegisterConnectDriver(&openvzConnectDriver,
|
||||||
return -1;
|
false);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,9 @@ parallelsConnectOpen(virConnectPtr conn,
|
|||||||
return VIR_DRV_OPEN_ERROR;
|
return VIR_DRV_OPEN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = parallelsOpenDefault(conn)) != VIR_DRV_OPEN_SUCCESS)
|
if ((ret = parallelsOpenDefault(conn)) != VIR_DRV_OPEN_SUCCESS ||
|
||||||
|
(ret = parallelsStorageOpen(conn, flags)) != VIR_DRV_OPEN_SUCCESS ||
|
||||||
|
(ret = parallelsNetworkOpen(conn, flags)) != VIR_DRV_OPEN_SUCCESS)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
return VIR_DRV_OPEN_SUCCESS;
|
||||||
@ -273,6 +275,9 @@ parallelsConnectClose(virConnectPtr conn)
|
|||||||
{
|
{
|
||||||
parallelsConnPtr privconn = conn->privateData;
|
parallelsConnPtr privconn = conn->privateData;
|
||||||
|
|
||||||
|
parallelsNetworkClose(conn);
|
||||||
|
parallelsStorageClose(conn);
|
||||||
|
|
||||||
parallelsDriverLock(privconn);
|
parallelsDriverLock(privconn);
|
||||||
prlsdkUnsubscribeFromPCSEvents(privconn);
|
prlsdkUnsubscribeFromPCSEvents(privconn);
|
||||||
virObjectUnref(privconn->caps);
|
virObjectUnref(privconn->caps);
|
||||||
@ -952,7 +957,6 @@ parallelsDomainUndefine(virDomainPtr domain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static virHypervisorDriver parallelsDriver = {
|
static virHypervisorDriver parallelsDriver = {
|
||||||
.no = VIR_DRV_PARALLELS,
|
|
||||||
.name = "Parallels",
|
.name = "Parallels",
|
||||||
.connectOpen = parallelsConnectOpen, /* 0.10.0 */
|
.connectOpen = parallelsConnectOpen, /* 0.10.0 */
|
||||||
.connectClose = parallelsConnectClose, /* 0.10.0 */
|
.connectClose = parallelsConnectClose, /* 0.10.0 */
|
||||||
@ -995,6 +999,12 @@ static virHypervisorDriver parallelsDriver = {
|
|||||||
.connectIsAlive = parallelsConnectIsAlive, /* 1.2.5 */
|
.connectIsAlive = parallelsConnectIsAlive, /* 1.2.5 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virConnectDriver parallelsConnectDriver = {
|
||||||
|
.hypervisorDriver = ¶llelsDriver,
|
||||||
|
.storageDriver = ¶llelsStorageDriver,
|
||||||
|
.networkDriver = ¶llelsNetworkDriver,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parallelsRegister:
|
* parallelsRegister:
|
||||||
*
|
*
|
||||||
@ -1013,11 +1023,7 @@ parallelsRegister(void)
|
|||||||
|
|
||||||
VIR_FREE(prlctl_path);
|
VIR_FREE(prlctl_path);
|
||||||
|
|
||||||
if (virRegisterHypervisorDriver(¶llelsDriver) < 0)
|
if (virRegisterConnectDriver(¶llelsConnectDriver, false) < 0)
|
||||||
return -1;
|
|
||||||
if (parallelsStorageRegister())
|
|
||||||
return -1;
|
|
||||||
if (parallelsNetworkRegister())
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -318,9 +318,8 @@ static int parallelsLoadNetworks(parallelsConnPtr privconn)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus
|
virDrvOpenStatus
|
||||||
parallelsNetworkOpen(virConnectPtr conn,
|
parallelsNetworkOpen(virConnectPtr conn,
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
||||||
@ -334,7 +333,7 @@ parallelsNetworkOpen(virConnectPtr conn,
|
|||||||
return VIR_DRV_OPEN_SUCCESS;
|
return VIR_DRV_OPEN_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int parallelsNetworkClose(virConnectPtr conn)
|
int parallelsNetworkClose(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
parallelsConnPtr privconn = conn->privateData;
|
parallelsConnPtr privconn = conn->privateData;
|
||||||
parallelsDriverLock(privconn);
|
parallelsDriverLock(privconn);
|
||||||
@ -597,10 +596,9 @@ static int parallelsNetworkGetAutostart(virNetworkPtr net,
|
|||||||
virNetworkObjUnlock(network);
|
virNetworkObjUnlock(network);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
static virNetworkDriver parallelsNetworkDriver = {
|
|
||||||
"Parallels",
|
virNetworkDriver parallelsNetworkDriver = {
|
||||||
.networkOpen = parallelsNetworkOpen, /* 1.0.1 */
|
.name = "Parallels",
|
||||||
.networkClose = parallelsNetworkClose, /* 1.0.1 */
|
|
||||||
.connectNumOfNetworks = parallelsConnectNumOfNetworks, /* 1.0.1 */
|
.connectNumOfNetworks = parallelsConnectNumOfNetworks, /* 1.0.1 */
|
||||||
.connectListNetworks = parallelsConnectListNetworks, /* 1.0.1 */
|
.connectListNetworks = parallelsConnectListNetworks, /* 1.0.1 */
|
||||||
.connectNumOfDefinedNetworks = parallelsConnectNumOfDefinedNetworks, /* 1.0.1 */
|
.connectNumOfDefinedNetworks = parallelsConnectNumOfDefinedNetworks, /* 1.0.1 */
|
||||||
@ -613,12 +611,3 @@ static virNetworkDriver parallelsNetworkDriver = {
|
|||||||
.networkIsActive = parallelsNetworkIsActive, /* 1.0.1 */
|
.networkIsActive = parallelsNetworkIsActive, /* 1.0.1 */
|
||||||
.networkIsPersistent = parallelsNetworkIsPersistent, /* 1.0.1 */
|
.networkIsPersistent = parallelsNetworkIsPersistent, /* 1.0.1 */
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
|
||||||
parallelsNetworkRegister(void)
|
|
||||||
{
|
|
||||||
if (virRegisterNetworkDriver(¶llelsNetworkDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
@ -67,7 +67,7 @@ parallelsStorageUnlock(virStorageDriverStatePtr driver)
|
|||||||
virMutexUnlock(&driver->lock);
|
virMutexUnlock(&driver->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
int
|
||||||
parallelsStorageClose(virConnectPtr conn)
|
parallelsStorageClose(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
parallelsConnPtr privconn = conn->privateData;
|
parallelsConnPtr privconn = conn->privateData;
|
||||||
@ -456,9 +456,8 @@ static int parallelsLoadPools(virConnectPtr conn)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus
|
virDrvOpenStatus
|
||||||
parallelsStorageOpen(virConnectPtr conn,
|
parallelsStorageOpen(virConnectPtr conn,
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
parallelsConnPtr privconn = conn->privateData;
|
parallelsConnPtr privconn = conn->privateData;
|
||||||
@ -1612,10 +1611,8 @@ parallelsStorageVolGetPath(virStorageVolPtr vol)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virStorageDriver parallelsStorageDriver = {
|
virStorageDriver parallelsStorageDriver = {
|
||||||
.name = "Parallels",
|
.name = "Parallels",
|
||||||
.storageOpen = parallelsStorageOpen, /* 0.10.0 */
|
|
||||||
.storageClose = parallelsStorageClose, /* 0.10.0 */
|
|
||||||
|
|
||||||
.connectNumOfStoragePools = parallelsConnectNumOfStoragePools, /* 0.10.0 */
|
.connectNumOfStoragePools = parallelsConnectNumOfStoragePools, /* 0.10.0 */
|
||||||
.connectListStoragePools = parallelsConnectListStoragePools, /* 0.10.0 */
|
.connectListStoragePools = parallelsConnectListStoragePools, /* 0.10.0 */
|
||||||
@ -1648,12 +1645,3 @@ static virStorageDriver parallelsStorageDriver = {
|
|||||||
.storagePoolIsActive = parallelsStoragePoolIsActive, /* 0.10.0 */
|
.storagePoolIsActive = parallelsStoragePoolIsActive, /* 0.10.0 */
|
||||||
.storagePoolIsPersistent = parallelsStoragePoolIsPersistent, /* 0.10.0 */
|
.storagePoolIsPersistent = parallelsStoragePoolIsPersistent, /* 0.10.0 */
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
|
||||||
parallelsStorageRegister(void)
|
|
||||||
{
|
|
||||||
if (virRegisterStorageDriver(¶llelsStorageDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
@ -75,8 +75,13 @@ struct parallelsDomObj {
|
|||||||
|
|
||||||
typedef struct parallelsDomObj *parallelsDomObjPtr;
|
typedef struct parallelsDomObj *parallelsDomObjPtr;
|
||||||
|
|
||||||
int parallelsStorageRegister(void);
|
virDrvOpenStatus parallelsStorageOpen(virConnectPtr conn, unsigned int flags);
|
||||||
int parallelsNetworkRegister(void);
|
int parallelsStorageClose(virConnectPtr conn);
|
||||||
|
extern virStorageDriver parallelsStorageDriver;
|
||||||
|
|
||||||
|
virDrvOpenStatus parallelsNetworkOpen(virConnectPtr conn, unsigned int flags);
|
||||||
|
int parallelsNetworkClose(virConnectPtr conn);
|
||||||
|
extern virNetworkDriver parallelsNetworkDriver;
|
||||||
|
|
||||||
virJSONValuePtr parallelsParseOutput(const char *binary, ...)
|
virJSONValuePtr parallelsParseOutput(const char *binary, ...)
|
||||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
|
||||||
|
@ -3669,46 +3669,7 @@ phypDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus)
|
|||||||
return phypDomainSetVcpusFlags(dom, nvcpus, VIR_DOMAIN_VCPU_LIVE);
|
return phypDomainSetVcpusFlags(dom, nvcpus, VIR_DOMAIN_VCPU_LIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus
|
static virHypervisorDriver phypHypervisorDriver = {
|
||||||
phypStorageOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_PHYP)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
phypStorageClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
phypInterfaceOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (conn->driver->no != VIR_DRV_PHYP)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
phypInterfaceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static virHypervisorDriver phypDriver = {
|
|
||||||
.no = VIR_DRV_PHYP,
|
|
||||||
.name = "PHYP",
|
.name = "PHYP",
|
||||||
.connectOpen = phypConnectOpen, /* 0.7.0 */
|
.connectOpen = phypConnectOpen, /* 0.7.0 */
|
||||||
.connectClose = phypConnectClose, /* 0.7.0 */
|
.connectClose = phypConnectClose, /* 0.7.0 */
|
||||||
@ -3740,10 +3701,6 @@ static virHypervisorDriver phypDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virStorageDriver phypStorageDriver = {
|
static virStorageDriver phypStorageDriver = {
|
||||||
.name = "PHYP",
|
|
||||||
.storageOpen = phypStorageOpen, /* 0.8.2 */
|
|
||||||
.storageClose = phypStorageClose, /* 0.8.2 */
|
|
||||||
|
|
||||||
.connectNumOfStoragePools = phypConnectNumOfStoragePools, /* 0.8.2 */
|
.connectNumOfStoragePools = phypConnectNumOfStoragePools, /* 0.8.2 */
|
||||||
.connectListStoragePools = phypConnectListStoragePools, /* 0.8.2 */
|
.connectListStoragePools = phypConnectListStoragePools, /* 0.8.2 */
|
||||||
.storagePoolLookupByName = phypStoragePoolLookupByName, /* 0.8.2 */
|
.storagePoolLookupByName = phypStoragePoolLookupByName, /* 0.8.2 */
|
||||||
@ -3762,9 +3719,6 @@ static virStorageDriver phypStorageDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virInterfaceDriver phypInterfaceDriver = {
|
static virInterfaceDriver phypInterfaceDriver = {
|
||||||
.name = "PHYP",
|
|
||||||
.interfaceOpen = phypInterfaceOpen, /* 0.9.1 */
|
|
||||||
.interfaceClose = phypInterfaceClose, /* 0.9.1 */
|
|
||||||
.connectNumOfInterfaces = phypConnectNumOfInterfaces, /* 0.9.1 */
|
.connectNumOfInterfaces = phypConnectNumOfInterfaces, /* 0.9.1 */
|
||||||
.connectListInterfaces = phypConnectListInterfaces, /* 0.9.1 */
|
.connectListInterfaces = phypConnectListInterfaces, /* 0.9.1 */
|
||||||
.interfaceLookupByName = phypInterfaceLookupByName, /* 0.9.1 */
|
.interfaceLookupByName = phypInterfaceLookupByName, /* 0.9.1 */
|
||||||
@ -3773,15 +3727,15 @@ static virInterfaceDriver phypInterfaceDriver = {
|
|||||||
.interfaceIsActive = phypInterfaceIsActive /* 0.9.1 */
|
.interfaceIsActive = phypInterfaceIsActive /* 0.9.1 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virConnectDriver phypConnectDriver = {
|
||||||
|
.hypervisorDriver = &phypHypervisorDriver,
|
||||||
|
.interfaceDriver = &phypInterfaceDriver,
|
||||||
|
.storageDriver = &phypStorageDriver,
|
||||||
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
phypRegister(void)
|
phypRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&phypDriver) < 0)
|
return virRegisterConnectDriver(&phypConnectDriver,
|
||||||
return -1;
|
false);
|
||||||
if (virRegisterStorageDriver(&phypStorageDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterInterfaceDriver(&phypInterfaceDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
@ -18934,8 +18934,7 @@ qemuDomainGetFSInfo(virDomainPtr dom,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virHypervisorDriver qemuDriver = {
|
static virHypervisorDriver qemuHypervisorDriver = {
|
||||||
.no = VIR_DRV_QEMU,
|
|
||||||
.name = QEMU_DRIVER_NAME,
|
.name = QEMU_DRIVER_NAME,
|
||||||
.connectOpen = qemuConnectOpen, /* 0.2.0 */
|
.connectOpen = qemuConnectOpen, /* 0.2.0 */
|
||||||
.connectClose = qemuConnectClose, /* 0.2.0 */
|
.connectClose = qemuConnectClose, /* 0.2.0 */
|
||||||
@ -19139,6 +19138,10 @@ static virHypervisorDriver qemuDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static virConnectDriver qemuConnectDriver = {
|
||||||
|
.hypervisorDriver = &qemuHypervisorDriver,
|
||||||
|
};
|
||||||
|
|
||||||
static virStateDriver qemuStateDriver = {
|
static virStateDriver qemuStateDriver = {
|
||||||
.name = QEMU_DRIVER_NAME,
|
.name = QEMU_DRIVER_NAME,
|
||||||
.stateInitialize = qemuStateInitialize,
|
.stateInitialize = qemuStateInitialize,
|
||||||
@ -19150,7 +19153,8 @@ static virStateDriver qemuStateDriver = {
|
|||||||
|
|
||||||
int qemuRegister(void)
|
int qemuRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&qemuDriver) < 0)
|
if (virRegisterConnectDriver(&qemuConnectDriver,
|
||||||
|
true) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&qemuStateDriver) < 0)
|
if (virRegisterStateDriver(&qemuStateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3527,69 +3527,6 @@ remoteConnectListAllSecrets(virConnectPtr conn,
|
|||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
|
|
||||||
static virDrvOpenStatus ATTRIBUTE_NONNULL(1)
|
|
||||||
remoteGenericOpen(virConnectPtr conn)
|
|
||||||
{
|
|
||||||
if (inside_daemon)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if (conn->driver &&
|
|
||||||
STREQ(conn->driver->name, "remote")) {
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static virDrvOpenStatus ATTRIBUTE_NONNULL(1)
|
|
||||||
remoteNetworkOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
return remoteGenericOpen(conn);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
remoteNetworkClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
static virDrvOpenStatus ATTRIBUTE_NONNULL(1)
|
|
||||||
remoteInterfaceOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
return remoteGenericOpen(conn);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
remoteInterfaceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
static virDrvOpenStatus ATTRIBUTE_NONNULL(1)
|
|
||||||
remoteStorageOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
return remoteGenericOpen(conn);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
remoteStorageClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
remoteConnectFindStoragePoolSources(virConnectPtr conn,
|
remoteConnectFindStoragePoolSources(virConnectPtr conn,
|
||||||
const char *type,
|
const char *type,
|
||||||
@ -3757,21 +3694,6 @@ remoteStoragePoolListAllVolumes(virStoragePoolPtr pool,
|
|||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
|
|
||||||
static virDrvOpenStatus ATTRIBUTE_NONNULL(1)
|
|
||||||
remoteNodeDeviceOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
return remoteGenericOpen(conn);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
remoteNodeDeviceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
remoteNodeDeviceDettach(virNodeDevicePtr dev)
|
remoteNodeDeviceDettach(virNodeDevicePtr dev)
|
||||||
{
|
{
|
||||||
@ -3870,22 +3792,6 @@ remoteNodeDeviceReset(virNodeDevicePtr dev)
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
|
||||||
|
|
||||||
static virDrvOpenStatus ATTRIBUTE_NONNULL(1)
|
|
||||||
remoteNWFilterOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
return remoteGenericOpen(conn);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
remoteNWFilterClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -5551,21 +5457,6 @@ remoteDomainBuildQemuMonitorEvent(virNetClientProgramPtr prog ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus ATTRIBUTE_NONNULL(1)
|
|
||||||
remoteSecretOpen(virConnectPtr conn, virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
return remoteGenericOpen(conn);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
remoteSecretClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static unsigned char *
|
static unsigned char *
|
||||||
remoteSecretGetValue(virSecretPtr secret, size_t *value_size,
|
remoteSecretGetValue(virSecretPtr secret, size_t *value_size,
|
||||||
unsigned int flags, unsigned int internalFlags)
|
unsigned int flags, unsigned int internalFlags)
|
||||||
@ -8074,7 +7965,6 @@ unsigned long remoteVersion(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static virHypervisorDriver hypervisor_driver = {
|
static virHypervisorDriver hypervisor_driver = {
|
||||||
.no = VIR_DRV_REMOTE,
|
|
||||||
.name = "remote",
|
.name = "remote",
|
||||||
.connectOpen = remoteConnectOpen, /* 0.3.0 */
|
.connectOpen = remoteConnectOpen, /* 0.3.0 */
|
||||||
.connectClose = remoteConnectClose, /* 0.3.0 */
|
.connectClose = remoteConnectClose, /* 0.3.0 */
|
||||||
@ -8287,9 +8177,6 @@ static virHypervisorDriver hypervisor_driver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virNetworkDriver network_driver = {
|
static virNetworkDriver network_driver = {
|
||||||
.name = "remote",
|
|
||||||
.networkOpen = remoteNetworkOpen, /* 0.3.0 */
|
|
||||||
.networkClose = remoteNetworkClose, /* 0.3.0 */
|
|
||||||
.connectNumOfNetworks = remoteConnectNumOfNetworks, /* 0.3.0 */
|
.connectNumOfNetworks = remoteConnectNumOfNetworks, /* 0.3.0 */
|
||||||
.connectListNetworks = remoteConnectListNetworks, /* 0.3.0 */
|
.connectListNetworks = remoteConnectListNetworks, /* 0.3.0 */
|
||||||
.connectNumOfDefinedNetworks = remoteConnectNumOfDefinedNetworks, /* 0.3.0 */
|
.connectNumOfDefinedNetworks = remoteConnectNumOfDefinedNetworks, /* 0.3.0 */
|
||||||
@ -8315,9 +8202,6 @@ static virNetworkDriver network_driver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virInterfaceDriver interface_driver = {
|
static virInterfaceDriver interface_driver = {
|
||||||
.name = "remote",
|
|
||||||
.interfaceOpen = remoteInterfaceOpen, /* 0.7.2 */
|
|
||||||
.interfaceClose = remoteInterfaceClose, /* 0.7.2 */
|
|
||||||
.connectNumOfInterfaces = remoteConnectNumOfInterfaces, /* 0.7.2 */
|
.connectNumOfInterfaces = remoteConnectNumOfInterfaces, /* 0.7.2 */
|
||||||
.connectListInterfaces = remoteConnectListInterfaces, /* 0.7.2 */
|
.connectListInterfaces = remoteConnectListInterfaces, /* 0.7.2 */
|
||||||
.connectNumOfDefinedInterfaces = remoteConnectNumOfDefinedInterfaces, /* 0.7.2 */
|
.connectNumOfDefinedInterfaces = remoteConnectNumOfDefinedInterfaces, /* 0.7.2 */
|
||||||
@ -8337,9 +8221,6 @@ static virInterfaceDriver interface_driver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virStorageDriver storage_driver = {
|
static virStorageDriver storage_driver = {
|
||||||
.name = "remote",
|
|
||||||
.storageOpen = remoteStorageOpen, /* 0.4.1 */
|
|
||||||
.storageClose = remoteStorageClose, /* 0.4.1 */
|
|
||||||
.connectNumOfStoragePools = remoteConnectNumOfStoragePools, /* 0.4.1 */
|
.connectNumOfStoragePools = remoteConnectNumOfStoragePools, /* 0.4.1 */
|
||||||
.connectListStoragePools = remoteConnectListStoragePools, /* 0.4.1 */
|
.connectListStoragePools = remoteConnectListStoragePools, /* 0.4.1 */
|
||||||
.connectNumOfDefinedStoragePools = remoteConnectNumOfDefinedStoragePools, /* 0.4.1 */
|
.connectNumOfDefinedStoragePools = remoteConnectNumOfDefinedStoragePools, /* 0.4.1 */
|
||||||
@ -8384,9 +8265,6 @@ static virStorageDriver storage_driver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virSecretDriver secret_driver = {
|
static virSecretDriver secret_driver = {
|
||||||
.name = "remote",
|
|
||||||
.secretOpen = remoteSecretOpen, /* 0.7.1 */
|
|
||||||
.secretClose = remoteSecretClose, /* 0.7.1 */
|
|
||||||
.connectNumOfSecrets = remoteConnectNumOfSecrets, /* 0.7.1 */
|
.connectNumOfSecrets = remoteConnectNumOfSecrets, /* 0.7.1 */
|
||||||
.connectListSecrets = remoteConnectListSecrets, /* 0.7.1 */
|
.connectListSecrets = remoteConnectListSecrets, /* 0.7.1 */
|
||||||
.connectListAllSecrets = remoteConnectListAllSecrets, /* 0.10.2 */
|
.connectListAllSecrets = remoteConnectListAllSecrets, /* 0.10.2 */
|
||||||
@ -8400,9 +8278,6 @@ static virSecretDriver secret_driver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virNodeDeviceDriver node_device_driver = {
|
static virNodeDeviceDriver node_device_driver = {
|
||||||
.name = "remote",
|
|
||||||
.nodeDeviceOpen = remoteNodeDeviceOpen, /* 0.5.0 */
|
|
||||||
.nodeDeviceClose = remoteNodeDeviceClose, /* 0.5.0 */
|
|
||||||
.nodeNumOfDevices = remoteNodeNumOfDevices, /* 0.5.0 */
|
.nodeNumOfDevices = remoteNodeNumOfDevices, /* 0.5.0 */
|
||||||
.nodeListDevices = remoteNodeListDevices, /* 0.5.0 */
|
.nodeListDevices = remoteNodeListDevices, /* 0.5.0 */
|
||||||
.connectListAllNodeDevices = remoteConnectListAllNodeDevices, /* 0.10.2 */
|
.connectListAllNodeDevices = remoteConnectListAllNodeDevices, /* 0.10.2 */
|
||||||
@ -8417,9 +8292,6 @@ static virNodeDeviceDriver node_device_driver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virNWFilterDriver nwfilter_driver = {
|
static virNWFilterDriver nwfilter_driver = {
|
||||||
.name = "remote",
|
|
||||||
.nwfilterOpen = remoteNWFilterOpen, /* 0.8.0 */
|
|
||||||
.nwfilterClose = remoteNWFilterClose, /* 0.8.0 */
|
|
||||||
.nwfilterLookupByUUID = remoteNWFilterLookupByUUID, /* 0.8.0 */
|
.nwfilterLookupByUUID = remoteNWFilterLookupByUUID, /* 0.8.0 */
|
||||||
.nwfilterLookupByName = remoteNWFilterLookupByName, /* 0.8.0 */
|
.nwfilterLookupByName = remoteNWFilterLookupByName, /* 0.8.0 */
|
||||||
.nwfilterGetXMLDesc = remoteNWFilterGetXMLDesc, /* 0.8.0 */
|
.nwfilterGetXMLDesc = remoteNWFilterGetXMLDesc, /* 0.8.0 */
|
||||||
@ -8430,6 +8302,15 @@ static virNWFilterDriver nwfilter_driver = {
|
|||||||
.connectListAllNWFilters = remoteConnectListAllNWFilters, /* 0.10.2 */
|
.connectListAllNWFilters = remoteConnectListAllNWFilters, /* 0.10.2 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virConnectDriver connect_driver = {
|
||||||
|
.hypervisorDriver = &hypervisor_driver,
|
||||||
|
.interfaceDriver = &interface_driver,
|
||||||
|
.networkDriver = &network_driver,
|
||||||
|
.nodeDeviceDriver = &node_device_driver,
|
||||||
|
.nwfilterDriver = &nwfilter_driver,
|
||||||
|
.secretDriver = &secret_driver,
|
||||||
|
.storageDriver = &storage_driver,
|
||||||
|
};
|
||||||
|
|
||||||
static virStateDriver state_driver = {
|
static virStateDriver state_driver = {
|
||||||
.name = "Remote",
|
.name = "Remote",
|
||||||
@ -8446,19 +8327,8 @@ static virStateDriver state_driver = {
|
|||||||
int
|
int
|
||||||
remoteRegister(void)
|
remoteRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&hypervisor_driver) < 0)
|
if (virRegisterConnectDriver(&connect_driver,
|
||||||
return -1;
|
false) < 0)
|
||||||
if (virRegisterNetworkDriver(&network_driver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterInterfaceDriver(&interface_driver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterStorageDriver(&storage_driver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterNodeDeviceDriver(&node_device_driver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterSecretDriver(&secret_driver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterNWFilterDriver(&nwfilter_driver) < 0)
|
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&state_driver) < 0)
|
if (virRegisterStateDriver(&state_driver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -514,25 +514,6 @@ loadSecrets(virSecretEntryPtr *dest)
|
|||||||
|
|
||||||
/* Driver functions */
|
/* Driver functions */
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
secretOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (driver == NULL)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
secretClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
secretConnectNumOfSecrets(virConnectPtr conn)
|
secretConnectNumOfSecrets(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
@ -1152,8 +1133,6 @@ secretStateReload(void)
|
|||||||
|
|
||||||
static virSecretDriver secretDriver = {
|
static virSecretDriver secretDriver = {
|
||||||
.name = "secret",
|
.name = "secret",
|
||||||
.secretOpen = secretOpen, /* 0.7.1 */
|
|
||||||
.secretClose = secretClose, /* 0.7.1 */
|
|
||||||
.connectNumOfSecrets = secretConnectNumOfSecrets, /* 0.7.1 */
|
.connectNumOfSecrets = secretConnectNumOfSecrets, /* 0.7.1 */
|
||||||
.connectListSecrets = secretConnectListSecrets, /* 0.7.1 */
|
.connectListSecrets = secretConnectListSecrets, /* 0.7.1 */
|
||||||
.connectListAllSecrets = secretConnectListAllSecrets, /* 0.10.2 */
|
.connectListAllSecrets = secretConnectListAllSecrets, /* 0.10.2 */
|
||||||
@ -1167,7 +1146,7 @@ static virSecretDriver secretDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virStateDriver stateDriver = {
|
static virStateDriver stateDriver = {
|
||||||
.name = "Secret",
|
.name = "secret",
|
||||||
.stateInitialize = secretStateInitialize,
|
.stateInitialize = secretStateInitialize,
|
||||||
.stateCleanup = secretStateCleanup,
|
.stateCleanup = secretStateCleanup,
|
||||||
.stateReload = secretStateReload,
|
.stateReload = secretStateReload,
|
||||||
@ -1176,7 +1155,7 @@ static virStateDriver stateDriver = {
|
|||||||
int
|
int
|
||||||
secretRegister(void)
|
secretRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterSecretDriver(&secretDriver) < 0)
|
if (virSetSharedSecretDriver(&secretDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&stateDriver) < 0)
|
if (virRegisterStateDriver(&stateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -355,25 +355,6 @@ storagePoolLookupByVolume(virStorageVolPtr vol)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
storageOpen(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (!driver)
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
storageClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
storageConnectNumOfStoragePools(virConnectPtr conn)
|
storageConnectNumOfStoragePools(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
@ -2389,8 +2370,6 @@ storageConnectListAllStoragePools(virConnectPtr conn,
|
|||||||
|
|
||||||
static virStorageDriver storageDriver = {
|
static virStorageDriver storageDriver = {
|
||||||
.name = "storage",
|
.name = "storage",
|
||||||
.storageOpen = storageOpen, /* 0.4.0 */
|
|
||||||
.storageClose = storageClose, /* 0.4.0 */
|
|
||||||
.connectNumOfStoragePools = storageConnectNumOfStoragePools, /* 0.4.0 */
|
.connectNumOfStoragePools = storageConnectNumOfStoragePools, /* 0.4.0 */
|
||||||
.connectListStoragePools = storageConnectListStoragePools, /* 0.4.0 */
|
.connectListStoragePools = storageConnectListStoragePools, /* 0.4.0 */
|
||||||
.connectNumOfDefinedStoragePools = storageConnectNumOfDefinedStoragePools, /* 0.4.0 */
|
.connectNumOfDefinedStoragePools = storageConnectNumOfDefinedStoragePools, /* 0.4.0 */
|
||||||
@ -2437,7 +2416,7 @@ static virStorageDriver storageDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virStateDriver stateDriver = {
|
static virStateDriver stateDriver = {
|
||||||
.name = "Storage",
|
.name = "storage",
|
||||||
.stateInitialize = storageStateInitialize,
|
.stateInitialize = storageStateInitialize,
|
||||||
.stateAutoStart = storageStateAutoStart,
|
.stateAutoStart = storageStateAutoStart,
|
||||||
.stateCleanup = storageStateCleanup,
|
.stateCleanup = storageStateCleanup,
|
||||||
@ -2446,7 +2425,7 @@ static virStateDriver stateDriver = {
|
|||||||
|
|
||||||
int storageRegister(void)
|
int storageRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterStorageDriver(&storageDriver) < 0)
|
if (virSetSharedStorageDriver(&storageDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&stateDriver) < 0)
|
if (virRegisterStateDriver(&stateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3485,23 +3485,6 @@ static int testDomainInterfaceStats(virDomainPtr domain,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus testNetworkOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (STRNEQ(conn->driver->name, "Test"))
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int testNetworkClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static virNetworkPtr testNetworkLookupByUUID(virConnectPtr conn,
|
static virNetworkPtr testNetworkLookupByUUID(virConnectPtr conn,
|
||||||
const unsigned char *uuid)
|
const unsigned char *uuid)
|
||||||
@ -4043,23 +4026,6 @@ static int testNetworkSetAutostart(virNetworkPtr network,
|
|||||||
* Physical host interface routines
|
* Physical host interface routines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static virDrvOpenStatus testInterfaceOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (STRNEQ(conn->driver->name, "Test"))
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int testInterfaceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int testConnectNumOfInterfaces(virConnectPtr conn)
|
static int testConnectNumOfInterfaces(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
@ -4478,23 +4444,6 @@ static int testStoragePoolObjSetDefaults(virStoragePoolObjPtr pool)
|
|||||||
return VIR_STRDUP(pool->configFile, "");
|
return VIR_STRDUP(pool->configFile, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus testStorageOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (STRNEQ(conn->driver->name, "Test"))
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int testStorageClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static virStoragePoolPtr
|
static virStoragePoolPtr
|
||||||
testStoragePoolLookupByUUID(virConnectPtr conn,
|
testStoragePoolLookupByUUID(virConnectPtr conn,
|
||||||
@ -5816,22 +5765,6 @@ testStorageVolGetPath(virStorageVolPtr vol)
|
|||||||
|
|
||||||
|
|
||||||
/* Node device implementations */
|
/* Node device implementations */
|
||||||
static virDrvOpenStatus testNodeDeviceOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (STRNEQ(conn->driver->name, "Test"))
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int testNodeDeviceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
testNodeNumOfDevices(virConnectPtr conn,
|
testNodeNumOfDevices(virConnectPtr conn,
|
||||||
@ -6281,41 +6214,6 @@ static void testObjectEventQueue(testConnPtr driver,
|
|||||||
virObjectEventStateQueue(driver->eventState, event);
|
virObjectEventStateQueue(driver->eventState, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus testSecretOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (STRNEQ(conn->driver->name, "Test"))
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int testSecretClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static virDrvOpenStatus testNWFilterOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (STRNEQ(conn->driver->name, "Test"))
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int testNWFilterClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int testConnectListAllDomains(virConnectPtr conn,
|
static int testConnectListAllDomains(virConnectPtr conn,
|
||||||
virDomainPtr **domains,
|
virDomainPtr **domains,
|
||||||
@ -7344,8 +7242,7 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virHypervisorDriver testDriver = {
|
static virHypervisorDriver testHypervisorDriver = {
|
||||||
.no = VIR_DRV_TEST,
|
|
||||||
.name = "Test",
|
.name = "Test",
|
||||||
.connectOpen = testConnectOpen, /* 0.1.1 */
|
.connectOpen = testConnectOpen, /* 0.1.1 */
|
||||||
.connectClose = testConnectClose, /* 0.1.1 */
|
.connectClose = testConnectClose, /* 0.1.1 */
|
||||||
@ -7444,9 +7341,6 @@ static virHypervisorDriver testDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virNetworkDriver testNetworkDriver = {
|
static virNetworkDriver testNetworkDriver = {
|
||||||
"Test",
|
|
||||||
.networkOpen = testNetworkOpen, /* 0.3.2 */
|
|
||||||
.networkClose = testNetworkClose, /* 0.3.2 */
|
|
||||||
.connectNumOfNetworks = testConnectNumOfNetworks, /* 0.3.2 */
|
.connectNumOfNetworks = testConnectNumOfNetworks, /* 0.3.2 */
|
||||||
.connectListNetworks = testConnectListNetworks, /* 0.3.2 */
|
.connectListNetworks = testConnectListNetworks, /* 0.3.2 */
|
||||||
.connectNumOfDefinedNetworks = testConnectNumOfDefinedNetworks, /* 0.3.2 */
|
.connectNumOfDefinedNetworks = testConnectNumOfDefinedNetworks, /* 0.3.2 */
|
||||||
@ -7471,9 +7365,6 @@ static virNetworkDriver testNetworkDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virInterfaceDriver testInterfaceDriver = {
|
static virInterfaceDriver testInterfaceDriver = {
|
||||||
"Test", /* name */
|
|
||||||
.interfaceOpen = testInterfaceOpen, /* 0.7.0 */
|
|
||||||
.interfaceClose = testInterfaceClose, /* 0.7.0 */
|
|
||||||
.connectNumOfInterfaces = testConnectNumOfInterfaces, /* 0.7.0 */
|
.connectNumOfInterfaces = testConnectNumOfInterfaces, /* 0.7.0 */
|
||||||
.connectListInterfaces = testConnectListInterfaces, /* 0.7.0 */
|
.connectListInterfaces = testConnectListInterfaces, /* 0.7.0 */
|
||||||
.connectNumOfDefinedInterfaces = testConnectNumOfDefinedInterfaces, /* 0.7.0 */
|
.connectNumOfDefinedInterfaces = testConnectNumOfDefinedInterfaces, /* 0.7.0 */
|
||||||
@ -7493,10 +7384,6 @@ static virInterfaceDriver testInterfaceDriver = {
|
|||||||
|
|
||||||
|
|
||||||
static virStorageDriver testStorageDriver = {
|
static virStorageDriver testStorageDriver = {
|
||||||
.name = "Test",
|
|
||||||
.storageOpen = testStorageOpen, /* 0.4.1 */
|
|
||||||
.storageClose = testStorageClose, /* 0.4.1 */
|
|
||||||
|
|
||||||
.connectNumOfStoragePools = testConnectNumOfStoragePools, /* 0.5.0 */
|
.connectNumOfStoragePools = testConnectNumOfStoragePools, /* 0.5.0 */
|
||||||
.connectListStoragePools = testConnectListStoragePools, /* 0.5.0 */
|
.connectListStoragePools = testConnectListStoragePools, /* 0.5.0 */
|
||||||
.connectNumOfDefinedStoragePools = testConnectNumOfDefinedStoragePools, /* 0.5.0 */
|
.connectNumOfDefinedStoragePools = testConnectNumOfDefinedStoragePools, /* 0.5.0 */
|
||||||
@ -7536,10 +7423,6 @@ static virStorageDriver testStorageDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static virNodeDeviceDriver testNodeDeviceDriver = {
|
static virNodeDeviceDriver testNodeDeviceDriver = {
|
||||||
.name = "Test",
|
|
||||||
.nodeDeviceOpen = testNodeDeviceOpen, /* 0.6.0 */
|
|
||||||
.nodeDeviceClose = testNodeDeviceClose, /* 0.6.0 */
|
|
||||||
|
|
||||||
.nodeNumOfDevices = testNodeNumOfDevices, /* 0.7.2 */
|
.nodeNumOfDevices = testNodeNumOfDevices, /* 0.7.2 */
|
||||||
.nodeListDevices = testNodeListDevices, /* 0.7.2 */
|
.nodeListDevices = testNodeListDevices, /* 0.7.2 */
|
||||||
.nodeDeviceLookupByName = testNodeDeviceLookupByName, /* 0.7.2 */
|
.nodeDeviceLookupByName = testNodeDeviceLookupByName, /* 0.7.2 */
|
||||||
@ -7551,17 +7434,14 @@ static virNodeDeviceDriver testNodeDeviceDriver = {
|
|||||||
.nodeDeviceDestroy = testNodeDeviceDestroy, /* 0.7.3 */
|
.nodeDeviceDestroy = testNodeDeviceDestroy, /* 0.7.3 */
|
||||||
};
|
};
|
||||||
|
|
||||||
static virSecretDriver testSecretDriver = {
|
static virConnectDriver testConnectDriver = {
|
||||||
.name = "Test",
|
.hypervisorDriver = &testHypervisorDriver,
|
||||||
.secretOpen = testSecretOpen, /* 0.7.1 */
|
.interfaceDriver = &testInterfaceDriver,
|
||||||
.secretClose = testSecretClose, /* 0.7.1 */
|
.networkDriver = &testNetworkDriver,
|
||||||
};
|
.nodeDeviceDriver = &testNodeDeviceDriver,
|
||||||
|
.nwfilterDriver = NULL,
|
||||||
|
.secretDriver = NULL,
|
||||||
static virNWFilterDriver testNWFilterDriver = {
|
.storageDriver = &testStorageDriver,
|
||||||
.name = "Test",
|
|
||||||
.nwfilterOpen = testNWFilterOpen, /* 0.8.0 */
|
|
||||||
.nwfilterClose = testNWFilterClose, /* 0.8.0 */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -7572,20 +7452,6 @@ static virNWFilterDriver testNWFilterDriver = {
|
|||||||
int
|
int
|
||||||
testRegister(void)
|
testRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&testDriver) < 0)
|
return virRegisterConnectDriver(&testConnectDriver,
|
||||||
return -1;
|
false);
|
||||||
if (virRegisterNetworkDriver(&testNetworkDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterInterfaceDriver(&testInterfaceDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterStorageDriver(&testStorageDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterNodeDeviceDriver(&testNodeDeviceDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterSecretDriver(&testSecretDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virRegisterNWFilterDriver(&testNWFilterDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
@ -2943,8 +2943,7 @@ umlNodeAllocPages(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virHypervisorDriver umlDriver = {
|
static virHypervisorDriver umlHypervisorDriver = {
|
||||||
.no = VIR_DRV_UML,
|
|
||||||
.name = "UML",
|
.name = "UML",
|
||||||
.connectOpen = umlConnectOpen, /* 0.5.0 */
|
.connectOpen = umlConnectOpen, /* 0.5.0 */
|
||||||
.connectClose = umlConnectClose, /* 0.5.0 */
|
.connectClose = umlConnectClose, /* 0.5.0 */
|
||||||
@ -3009,6 +3008,10 @@ static virHypervisorDriver umlDriver = {
|
|||||||
.nodeAllocPages = umlNodeAllocPages, /* 1.2.9 */
|
.nodeAllocPages = umlNodeAllocPages, /* 1.2.9 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virConnectDriver umlConnectDriver = {
|
||||||
|
.hypervisorDriver = ¨HypervisorDriver,
|
||||||
|
};
|
||||||
|
|
||||||
static virStateDriver umlStateDriver = {
|
static virStateDriver umlStateDriver = {
|
||||||
.name = "UML",
|
.name = "UML",
|
||||||
.stateInitialize = umlStateInitialize,
|
.stateInitialize = umlStateInitialize,
|
||||||
@ -3019,7 +3022,8 @@ static virStateDriver umlStateDriver = {
|
|||||||
|
|
||||||
int umlRegister(void)
|
int umlRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(¨Driver) < 0)
|
if (virRegisterConnectDriver(¨ConnectDriver,
|
||||||
|
true) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(¨StateDriver) < 0)
|
if (virRegisterStateDriver(¨StateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -7594,7 +7594,6 @@ vboxNodeAllocPages(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virHypervisorDriver vboxCommonDriver = {
|
virHypervisorDriver vboxCommonDriver = {
|
||||||
.no = VIR_DRV_VBOX,
|
|
||||||
.name = "VBOX",
|
.name = "VBOX",
|
||||||
.connectOpen = vboxConnectOpen, /* 0.6.3 */
|
.connectOpen = vboxConnectOpen, /* 0.6.3 */
|
||||||
.connectClose = vboxConnectClose, /* 0.6.3 */
|
.connectClose = vboxConnectClose, /* 0.6.3 */
|
||||||
|
@ -50,36 +50,6 @@ VIR_LOG_INIT("vbox.vbox_driver");
|
|||||||
|
|
||||||
#define VIR_FROM_THIS VIR_FROM_VBOX
|
#define VIR_FROM_THIS VIR_FROM_VBOX
|
||||||
|
|
||||||
#if !defined(WITH_DRIVER_MODULES) || defined(VBOX_NETWORK_DRIVER)
|
|
||||||
int vboxNetworkRegister(void)
|
|
||||||
{
|
|
||||||
virNetworkDriverPtr networkDriver = NULL;
|
|
||||||
uint32_t uVersion;
|
|
||||||
|
|
||||||
if (VBoxCGlueInit(&uVersion) == 0)
|
|
||||||
networkDriver = vboxGetNetworkDriver(uVersion);
|
|
||||||
|
|
||||||
if (networkDriver && virRegisterNetworkDriver(networkDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(WITH_DRIVER_MODULES) || defined(VBOX_STORAGE_DRIVER)
|
|
||||||
int vboxStorageRegister(void)
|
|
||||||
{
|
|
||||||
virStorageDriverPtr storageDriver = NULL;
|
|
||||||
uint32_t uVersion;
|
|
||||||
|
|
||||||
if (VBoxCGlueInit(&uVersion) == 0)
|
|
||||||
storageDriver = vboxGetStorageDriver(uVersion);
|
|
||||||
|
|
||||||
if (storageDriver && virRegisterStorageDriver(storageDriver) < 0)
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(WITH_DRIVER_MODULES) || defined(VBOX_DRIVER)
|
#if !defined(WITH_DRIVER_MODULES) || defined(VBOX_DRIVER)
|
||||||
static virDrvOpenStatus dummyConnectOpen(virConnectPtr conn,
|
static virDrvOpenStatus dummyConnectOpen(virConnectPtr conn,
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
||||||
@ -122,23 +92,28 @@ static virDrvOpenStatus dummyConnectOpen(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static virHypervisorDriver vboxDriverDummy = {
|
static virHypervisorDriver vboxDriverDummy = {
|
||||||
VIR_DRV_VBOX,
|
|
||||||
"VBOX",
|
"VBOX",
|
||||||
.connectOpen = dummyConnectOpen, /* 0.6.3 */
|
.connectOpen = dummyConnectOpen, /* 0.6.3 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virConnectDriver vboxConnectDriver;
|
||||||
|
|
||||||
int vboxRegister(void)
|
int vboxRegister(void)
|
||||||
{
|
{
|
||||||
virHypervisorDriverPtr driver = NULL;
|
|
||||||
uint32_t uVersion;
|
uint32_t uVersion;
|
||||||
|
|
||||||
if (VBoxCGlueInit(&uVersion) == 0)
|
if (VBoxCGlueInit(&uVersion) == 0)
|
||||||
driver = vboxGetHypervisorDriver(uVersion);
|
vboxConnectDriver.hypervisorDriver = vboxGetHypervisorDriver(uVersion);
|
||||||
|
|
||||||
if (!driver)
|
if (vboxConnectDriver.hypervisorDriver) {
|
||||||
driver = &vboxDriverDummy;
|
vboxConnectDriver.networkDriver = vboxGetNetworkDriver(uVersion);
|
||||||
|
vboxConnectDriver.storageDriver = vboxGetStorageDriver(uVersion);
|
||||||
|
} else {
|
||||||
|
vboxConnectDriver.hypervisorDriver = &vboxDriverDummy;
|
||||||
|
}
|
||||||
|
|
||||||
if (virRegisterHypervisorDriver(driver) < 0)
|
if (virRegisterConnectDriver(&vboxConnectDriver,
|
||||||
|
false) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -86,35 +86,6 @@ static vboxUniformedAPI gVBoxAPI;
|
|||||||
* The Network Functions here on
|
* The Network Functions here on
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
vboxNetworkOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
vboxGlobalData *data = conn->privateData;
|
|
||||||
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (STRNEQ(conn->driver->name, "VBOX"))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (!data->pFuncs || !data->vboxObj || !data->vboxSession)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
VIR_DEBUG("network initialized");
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int vboxNetworkClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
VIR_DEBUG("network uninitialized");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int vboxConnectNumOfNetworks(virConnectPtr conn)
|
static int vboxConnectNumOfNetworks(virConnectPtr conn)
|
||||||
{
|
{
|
||||||
@ -998,9 +969,6 @@ static char *vboxNetworkGetXMLDesc(virNetworkPtr network, unsigned int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
virNetworkDriver vboxNetworkDriver = {
|
virNetworkDriver vboxNetworkDriver = {
|
||||||
"VBOX",
|
|
||||||
.networkOpen = vboxNetworkOpen, /* 0.6.4 */
|
|
||||||
.networkClose = vboxNetworkClose, /* 0.6.4 */
|
|
||||||
.connectNumOfNetworks = vboxConnectNumOfNetworks, /* 0.6.4 */
|
.connectNumOfNetworks = vboxConnectNumOfNetworks, /* 0.6.4 */
|
||||||
.connectListNetworks = vboxConnectListNetworks, /* 0.6.4 */
|
.connectListNetworks = vboxConnectListNetworks, /* 0.6.4 */
|
||||||
.connectNumOfDefinedNetworks = vboxConnectNumOfDefinedNetworks, /* 0.6.4 */
|
.connectNumOfDefinedNetworks = vboxConnectNumOfDefinedNetworks, /* 0.6.4 */
|
||||||
|
@ -42,33 +42,6 @@ static vboxUniformedAPI gVBoxAPI;
|
|||||||
* The Storage Functions here on
|
* The Storage Functions here on
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static virDrvOpenStatus
|
|
||||||
vboxStorageOpen(virConnectPtr conn,
|
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
|
||||||
unsigned int flags)
|
|
||||||
{
|
|
||||||
vboxGlobalData *data = conn->privateData;
|
|
||||||
|
|
||||||
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
|
|
||||||
|
|
||||||
if (STRNEQ(conn->driver->name, "VBOX"))
|
|
||||||
return VIR_DRV_OPEN_DECLINED;
|
|
||||||
|
|
||||||
if ((!data->pFuncs) || (!data->vboxObj) || (!data->vboxSession))
|
|
||||||
return VIR_DRV_OPEN_ERROR;
|
|
||||||
|
|
||||||
VIR_DEBUG("vbox storage initialized");
|
|
||||||
|
|
||||||
return VIR_DRV_OPEN_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int vboxStorageClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
VIR_DEBUG("vbox storage uninitialized");
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int vboxConnectNumOfStoragePools(virConnectPtr conn ATTRIBUTE_UNUSED)
|
static int vboxConnectNumOfStoragePools(virConnectPtr conn ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -894,9 +867,6 @@ static char *vboxStorageVolGetPath(virStorageVolPtr vol)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
virStorageDriver vboxStorageDriver = {
|
virStorageDriver vboxStorageDriver = {
|
||||||
.name = "VBOX",
|
|
||||||
.storageOpen = vboxStorageOpen, /* 0.7.1 */
|
|
||||||
.storageClose = vboxStorageClose, /* 0.7.1 */
|
|
||||||
.connectNumOfStoragePools = vboxConnectNumOfStoragePools, /* 0.7.1 */
|
.connectNumOfStoragePools = vboxConnectNumOfStoragePools, /* 0.7.1 */
|
||||||
.connectListStoragePools = vboxConnectListStoragePools, /* 0.7.1 */
|
.connectListStoragePools = vboxConnectListStoragePools, /* 0.7.1 */
|
||||||
.storagePoolLookupByName = vboxStoragePoolLookupByName, /* 0.7.1 */
|
.storagePoolLookupByName = vboxStoragePoolLookupByName, /* 0.7.1 */
|
||||||
|
@ -1197,8 +1197,7 @@ vmwareConnectListAllDomains(virConnectPtr conn,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virHypervisorDriver vmwareDriver = {
|
static virHypervisorDriver vmwareHypervisorDriver = {
|
||||||
.no = VIR_DRV_VMWARE,
|
|
||||||
.name = "VMWARE",
|
.name = "VMWARE",
|
||||||
.connectOpen = vmwareConnectOpen, /* 0.8.7 */
|
.connectOpen = vmwareConnectOpen, /* 0.8.7 */
|
||||||
.connectClose = vmwareConnectClose, /* 0.8.7 */
|
.connectClose = vmwareConnectClose, /* 0.8.7 */
|
||||||
@ -1236,10 +1235,13 @@ static virHypervisorDriver vmwareDriver = {
|
|||||||
.connectIsAlive = vmwareConnectIsAlive, /* 0.9.8 */
|
.connectIsAlive = vmwareConnectIsAlive, /* 0.9.8 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virConnectDriver vmwareConnectDriver = {
|
||||||
|
.hypervisorDriver = &vmwareHypervisorDriver,
|
||||||
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
vmwareRegister(void)
|
vmwareRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterHypervisorDriver(&vmwareDriver) < 0)
|
return virRegisterConnectDriver(&vmwareConnectDriver,
|
||||||
return -1;
|
false);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
@ -2759,8 +2759,7 @@ xenUnifiedNodeSuspendForDuration(virConnectPtr conn,
|
|||||||
/*----- Register with libvirt.c, and initialize Xen drivers. -----*/
|
/*----- Register with libvirt.c, and initialize Xen drivers. -----*/
|
||||||
|
|
||||||
/* The interface which we export upwards to libvirt.c. */
|
/* The interface which we export upwards to libvirt.c. */
|
||||||
static virHypervisorDriver xenUnifiedDriver = {
|
static virHypervisorDriver xenUnifiedHypervisorDriver = {
|
||||||
.no = VIR_DRV_XEN_UNIFIED,
|
|
||||||
.name = "Xen",
|
.name = "Xen",
|
||||||
.connectOpen = xenUnifiedConnectOpen, /* 0.0.3 */
|
.connectOpen = xenUnifiedConnectOpen, /* 0.0.3 */
|
||||||
.connectClose = xenUnifiedConnectClose, /* 0.0.3 */
|
.connectClose = xenUnifiedConnectClose, /* 0.0.3 */
|
||||||
@ -2856,6 +2855,11 @@ static virHypervisorDriver xenUnifiedDriver = {
|
|||||||
.nodeSetMemoryParameters = xenUnifiedNodeSetMemoryParameters, /* 0.10.2 */
|
.nodeSetMemoryParameters = xenUnifiedNodeSetMemoryParameters, /* 0.10.2 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static virConnectDriver xenUnifiedConnectDriver = {
|
||||||
|
.hypervisorDriver = &xenUnifiedHypervisorDriver,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xenRegister:
|
* xenRegister:
|
||||||
*
|
*
|
||||||
@ -2868,7 +2872,8 @@ xenRegister(void)
|
|||||||
{
|
{
|
||||||
if (virRegisterStateDriver(&state_driver) == -1) return -1;
|
if (virRegisterStateDriver(&state_driver) == -1) return -1;
|
||||||
|
|
||||||
return virRegisterHypervisorDriver(&xenUnifiedDriver);
|
return virRegisterConnectDriver(&xenUnifiedConnectDriver,
|
||||||
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1978,8 +1978,7 @@ xenapiConnectIsAlive(virConnectPtr conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The interface which we export upwards to libvirt.c. */
|
/* The interface which we export upwards to libvirt.c. */
|
||||||
static virHypervisorDriver xenapiDriver = {
|
static virHypervisorDriver xenapiHypervisorDriver = {
|
||||||
.no = VIR_DRV_XENAPI,
|
|
||||||
.name = "XenAPI",
|
.name = "XenAPI",
|
||||||
.connectOpen = xenapiConnectOpen, /* 0.8.0 */
|
.connectOpen = xenapiConnectOpen, /* 0.8.0 */
|
||||||
.connectClose = xenapiConnectClose, /* 0.8.0 */
|
.connectClose = xenapiConnectClose, /* 0.8.0 */
|
||||||
@ -2032,6 +2031,11 @@ static virHypervisorDriver xenapiDriver = {
|
|||||||
.connectIsAlive = xenapiConnectIsAlive, /* 0.9.8 */
|
.connectIsAlive = xenapiConnectIsAlive, /* 0.9.8 */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static virConnectDriver xenapiConnectDriver = {
|
||||||
|
.hypervisorDriver = &xenapiHypervisorDriver,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xenapiRegister:
|
* xenapiRegister:
|
||||||
*
|
*
|
||||||
@ -2041,7 +2045,8 @@ static virHypervisorDriver xenapiDriver = {
|
|||||||
int
|
int
|
||||||
xenapiRegister(void)
|
xenapiRegister(void)
|
||||||
{
|
{
|
||||||
return virRegisterHypervisorDriver(&xenapiDriver);
|
return virRegisterConnectDriver(&xenapiConnectDriver,
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -58,16 +58,7 @@ fakeSecretLookupByUsage(virConnectPtr conn,
|
|||||||
return virGetSecret(conn, uuid, usageType, usageID);
|
return virGetSecret(conn, uuid, usageType, usageID);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
fakeSecretClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static virSecretDriver fakeSecretDriver = {
|
static virSecretDriver fakeSecretDriver = {
|
||||||
.name = "fake_secret",
|
|
||||||
.secretOpen = NULL,
|
|
||||||
.secretClose = fakeSecretClose,
|
|
||||||
.connectNumOfSecrets = NULL,
|
.connectNumOfSecrets = NULL,
|
||||||
.connectListSecrets = NULL,
|
.connectListSecrets = NULL,
|
||||||
.secretLookupByUUID = NULL,
|
.secretLookupByUUID = NULL,
|
||||||
@ -212,12 +203,6 @@ fakeStoragePoolGetXMLDesc(virStoragePoolPtr pool,
|
|||||||
return xmlbuf;
|
return xmlbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
fakeStorageClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
fakeStoragePoolIsActive(virStoragePoolPtr pool)
|
fakeStoragePoolIsActive(virStoragePoolPtr pool)
|
||||||
{
|
{
|
||||||
@ -244,8 +229,6 @@ fakeStoragePoolIsActive(virStoragePoolPtr pool)
|
|||||||
* type is assumed.
|
* type is assumed.
|
||||||
*/
|
*/
|
||||||
static virStorageDriver fakeStorageDriver = {
|
static virStorageDriver fakeStorageDriver = {
|
||||||
.name = "fake_storage",
|
|
||||||
.storageClose = fakeStorageClose,
|
|
||||||
.storagePoolLookupByName = fakeStoragePoolLookupByName,
|
.storagePoolLookupByName = fakeStoragePoolLookupByName,
|
||||||
.storageVolLookupByName = fakeStorageVolLookupByName,
|
.storageVolLookupByName = fakeStorageVolLookupByName,
|
||||||
.storagePoolGetXMLDesc = fakeStoragePoolGetXMLDesc,
|
.storagePoolGetXMLDesc = fakeStoragePoolGetXMLDesc,
|
||||||
|
@ -30,23 +30,12 @@
|
|||||||
|
|
||||||
VIR_LOG_INIT("tests.drivermoduletest");
|
VIR_LOG_INIT("tests.drivermoduletest");
|
||||||
|
|
||||||
struct testDriverData {
|
|
||||||
const char *name;
|
|
||||||
const char *dep1;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static int testDriverModule(const void *args)
|
static int testDriverModule(const void *args)
|
||||||
{
|
{
|
||||||
const struct testDriverData *data = args;
|
const char *name = args;
|
||||||
|
|
||||||
/* coverity[leaked_storage] */
|
/* coverity[leaked_storage] */
|
||||||
if (data->dep1 &&
|
if (!virDriverLoadModule(name))
|
||||||
!virDriverLoadModule(data->dep1))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
/* coverity[leaked_storage] */
|
|
||||||
if (!virDriverLoadModule(data->name))
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -60,8 +49,7 @@ mymain(void)
|
|||||||
|
|
||||||
#define TEST(name, dep1) \
|
#define TEST(name, dep1) \
|
||||||
do { \
|
do { \
|
||||||
const struct testDriverData data = { name, dep1 }; \
|
if (virtTestRun("Test driver " # name, testDriverModule, name) < 0) \
|
||||||
if (virtTestRun("Test driver " # name, testDriverModule, &data) < 0) \
|
|
||||||
ret = -1; \
|
ret = -1; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user