mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 15:05:17 +00:00
Rename virDriver to virHypervisorDriver
To prepare for introducing a single global driver, rename the virDriver struct to virHypervisorDriver and the registration API to virRegisterHypervisorDriver()
This commit is contained in:
parent
43b67f2e71
commit
931dff992e
@ -15,7 +15,7 @@ my $symslxc = "$srcdir/libvirt_lxc.syms";
|
|||||||
my $drivertable = "$srcdir/driver.h";
|
my $drivertable = "$srcdir/driver.h";
|
||||||
|
|
||||||
my %groupheaders = (
|
my %groupheaders = (
|
||||||
"virDriver" => "Hypervisor APIs",
|
"virHypervisorDriver" => "Hypervisor APIs",
|
||||||
"virNetworkDriver" => "Virtual Network APIs",
|
"virNetworkDriver" => "Virtual Network APIs",
|
||||||
"virInterfaceDriver" => "Host Interface APIs",
|
"virInterfaceDriver" => "Host Interface APIs",
|
||||||
"virNodeDeviceDriver" => "Host Device APIs",
|
"virNodeDeviceDriver" => "Host Device APIs",
|
||||||
|
@ -1400,7 +1400,7 @@ bhyveConnectDomainEventDeregisterAny(virConnectPtr conn,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDriver bhyveDriver = {
|
static virHypervisorDriver bhyveDriver = {
|
||||||
.no = VIR_DRV_BHYVE,
|
.no = VIR_DRV_BHYVE,
|
||||||
.name = "bhyve",
|
.name = "bhyve",
|
||||||
.connectOpen = bhyveConnectOpen, /* 1.2.2 */
|
.connectOpen = bhyveConnectOpen, /* 1.2.2 */
|
||||||
@ -1459,7 +1459,7 @@ static virStateDriver bhyveStateDriver = {
|
|||||||
int
|
int
|
||||||
bhyveRegister(void)
|
bhyveRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(&bhyveDriver) < 0)
|
if (virRegisterHypervisorDriver(&bhyveDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&bhyveStateDriver) < 0)
|
if (virRegisterStateDriver(&bhyveStateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -336,11 +336,11 @@ struct _virConnect {
|
|||||||
virURIPtr uri; /* connection URI */
|
virURIPtr uri; /* connection URI */
|
||||||
|
|
||||||
/* The underlying hypervisor driver and network driver. */
|
/* The underlying hypervisor driver and network driver. */
|
||||||
virDriverPtr driver;
|
virHypervisorDriverPtr driver;
|
||||||
virNetworkDriverPtr networkDriver;
|
virNetworkDriverPtr networkDriver;
|
||||||
virInterfaceDriverPtr interfaceDriver;
|
virInterfaceDriverPtr interfaceDriver;
|
||||||
virStorageDriverPtr storageDriver;
|
virStorageDriverPtr storageDriver;
|
||||||
virNodeDeviceDriverPtr nodeDeviceDriver;
|
virNodeDeviceDriverPtr nodeDeviceDriver;
|
||||||
virSecretDriverPtr secretDriver;
|
virSecretDriverPtr secretDriver;
|
||||||
virNWFilterDriverPtr nwfilterDriver;
|
virNWFilterDriverPtr nwfilterDriver;
|
||||||
|
|
||||||
|
10
src/driver.h
10
src/driver.h
@ -1221,11 +1221,11 @@ typedef int
|
|||||||
unsigned int cellCount,
|
unsigned int cellCount,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
typedef struct _virDriver virDriver;
|
typedef struct _virHypervisorDriver virHypervisorDriver;
|
||||||
typedef virDriver *virDriverPtr;
|
typedef virHypervisorDriver *virHypervisorDriverPtr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _virDriver:
|
* _virHypervisorDriver:
|
||||||
*
|
*
|
||||||
* Structure associated to a virtualization driver, defining the various
|
* Structure associated to a virtualization driver, defining the various
|
||||||
* entry points for it.
|
* entry points for it.
|
||||||
@ -1236,7 +1236,7 @@ typedef virDriver *virDriverPtr;
|
|||||||
* - open
|
* - open
|
||||||
* - close
|
* - close
|
||||||
*/
|
*/
|
||||||
struct _virDriver {
|
struct _virHypervisorDriver {
|
||||||
int no; /* the number virDrvNo */
|
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;
|
||||||
@ -2241,7 +2241,7 @@ struct _virNWFilterDriver {
|
|||||||
* TODO: also need ways to (des)activate a given driver
|
* TODO: also need ways to (des)activate a given driver
|
||||||
* lookup based on the URI given in a virConnectOpen(ReadOnly)
|
* lookup based on the URI given in a virConnectOpen(ReadOnly)
|
||||||
*/
|
*/
|
||||||
int virRegisterDriver(virDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
int virRegisterHypervisorDriver(virHypervisorDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
||||||
int virRegisterNetworkDriver(virNetworkDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
int virRegisterNetworkDriver(virNetworkDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
||||||
int virRegisterInterfaceDriver(virInterfaceDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
int virRegisterInterfaceDriver(virInterfaceDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
||||||
int virRegisterStorageDriver(virStorageDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
int virRegisterStorageDriver(virStorageDriverPtr) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
@ -5291,7 +5291,7 @@ esxConnectListAllDomains(virConnectPtr conn,
|
|||||||
#undef MATCH
|
#undef MATCH
|
||||||
|
|
||||||
|
|
||||||
static virDriver esxDriver = {
|
static virHypervisorDriver esxDriver = {
|
||||||
.no = VIR_DRV_ESX,
|
.no = VIR_DRV_ESX,
|
||||||
.name = "ESX",
|
.name = "ESX",
|
||||||
.connectOpen = esxConnectOpen, /* 0.7.0 */
|
.connectOpen = esxConnectOpen, /* 0.7.0 */
|
||||||
@ -5376,7 +5376,7 @@ static virDriver esxDriver = {
|
|||||||
int
|
int
|
||||||
esxRegister(void)
|
esxRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(&esxDriver) < 0 ||
|
if (virRegisterHypervisorDriver(&esxDriver) < 0 ||
|
||||||
esxInterfaceRegister() < 0 ||
|
esxInterfaceRegister() < 0 ||
|
||||||
esxNetworkRegister() < 0 ||
|
esxNetworkRegister() < 0 ||
|
||||||
esxStorageRegister() < 0 ||
|
esxStorageRegister() < 0 ||
|
||||||
|
@ -1354,7 +1354,7 @@ hypervConnectListAllDomains(virConnectPtr conn,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDriver hypervDriver = {
|
static virHypervisorDriver hypervDriver = {
|
||||||
.no = VIR_DRV_HYPERV,
|
.no = VIR_DRV_HYPERV,
|
||||||
.name = "Hyper-V",
|
.name = "Hyper-V",
|
||||||
.connectOpen = hypervConnectOpen, /* 0.9.5 */
|
.connectOpen = hypervConnectOpen, /* 0.9.5 */
|
||||||
@ -1418,7 +1418,7 @@ hypervDebugHandler(const char *message, debug_level_e level,
|
|||||||
int
|
int
|
||||||
hypervRegister(void)
|
hypervRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(&hypervDriver) < 0 ||
|
if (virRegisterHypervisorDriver(&hypervDriver) < 0 ||
|
||||||
hypervInterfaceRegister() < 0 ||
|
hypervInterfaceRegister() < 0 ||
|
||||||
hypervNetworkRegister() < 0 ||
|
hypervNetworkRegister() < 0 ||
|
||||||
hypervStorageRegister() < 0 ||
|
hypervStorageRegister() < 0 ||
|
||||||
|
@ -122,8 +122,8 @@ VIR_LOG_INIT("libvirt");
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static virDriverPtr virDriverTab[MAX_DRIVERS];
|
static virHypervisorDriverPtr virHypervisorDriverTab[MAX_DRIVERS];
|
||||||
static int virDriverTabCount = 0;
|
static int virHypervisorDriverTabCount = 0;
|
||||||
static virNetworkDriverPtr virNetworkDriverTab[MAX_DRIVERS];
|
static virNetworkDriverPtr virNetworkDriverTab[MAX_DRIVERS];
|
||||||
static int virNetworkDriverTabCount = 0;
|
static int virNetworkDriverTabCount = 0;
|
||||||
static virInterfaceDriverPtr virInterfaceDriverTab[MAX_DRIVERS];
|
static virInterfaceDriverPtr virInterfaceDriverTab[MAX_DRIVERS];
|
||||||
@ -668,7 +668,7 @@ virRegisterNWFilterDriver(virNWFilterDriverPtr driver)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virRegisterDriver:
|
* virRegisterHypervisorDriver:
|
||||||
* @driver: pointer to a driver block
|
* @driver: pointer to a driver block
|
||||||
*
|
*
|
||||||
* Register a virtualization driver
|
* Register a virtualization driver
|
||||||
@ -676,19 +676,19 @@ virRegisterNWFilterDriver(virNWFilterDriverPtr driver)
|
|||||||
* Returns the driver priority or -1 in case of error.
|
* Returns the driver priority or -1 in case of error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
virRegisterDriver(virDriverPtr driver)
|
virRegisterHypervisorDriver(virHypervisorDriverPtr driver)
|
||||||
{
|
{
|
||||||
VIR_DEBUG("driver=%p name=%s", driver,
|
VIR_DEBUG("driver=%p name=%s", driver,
|
||||||
driver ? NULLSTR(driver->name) : "(null)");
|
driver ? NULLSTR(driver->name) : "(null)");
|
||||||
|
|
||||||
virCheckNonNullArgReturn(driver, -1);
|
virCheckNonNullArgReturn(driver, -1);
|
||||||
virDriverCheckTabMaxReturn(virDriverTabCount, -1);
|
virDriverCheckTabMaxReturn(virHypervisorDriverTabCount, -1);
|
||||||
|
|
||||||
VIR_DEBUG("registering %s as driver %d",
|
VIR_DEBUG("registering %s as driver %d",
|
||||||
driver->name, virDriverTabCount);
|
driver->name, virHypervisorDriverTabCount);
|
||||||
|
|
||||||
virDriverTab[virDriverTabCount] = driver;
|
virHypervisorDriverTab[virHypervisorDriverTabCount] = driver;
|
||||||
return virDriverTabCount++;
|
return virHypervisorDriverTabCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1106,7 +1106,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 < virDriverTabCount; i++) {
|
for (i = 0; i < virHypervisorDriverTabCount; 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.
|
||||||
@ -1114,7 +1114,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 (virDriverTab[i]->no == VIR_DRV_REMOTE &&
|
if (virHypervisorDriverTab[i]->no == VIR_DRV_REMOTE &&
|
||||||
ret->uri != NULL && ret->uri->scheme != NULL &&
|
ret->uri != NULL && ret->uri->scheme != NULL &&
|
||||||
(
|
(
|
||||||
#ifndef WITH_PHYP
|
#ifndef WITH_PHYP
|
||||||
@ -1142,11 +1142,11 @@ do_open(const char *name,
|
|||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("trying driver %zu (%s) ...", i, virDriverTab[i]->name);
|
VIR_DEBUG("trying driver %zu (%s) ...", i, virHypervisorDriverTab[i]->name);
|
||||||
ret->driver = virDriverTab[i];
|
ret->driver = virHypervisorDriverTab[i];
|
||||||
res = virDriverTab[i]->connectOpen(ret, auth, flags);
|
res = virHypervisorDriverTab[i]->connectOpen(ret, auth, flags);
|
||||||
VIR_DEBUG("driver %zu %s returned %s",
|
VIR_DEBUG("driver %zu %s returned %s",
|
||||||
i, virDriverTab[i]->name,
|
i, virHypervisorDriverTab[i]->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")));
|
||||||
|
@ -857,7 +857,7 @@ virDomainMigratePrepare3Params;
|
|||||||
virDomainMigratePrepareTunnel;
|
virDomainMigratePrepareTunnel;
|
||||||
virDomainMigratePrepareTunnel3;
|
virDomainMigratePrepareTunnel3;
|
||||||
virDomainMigratePrepareTunnel3Params;
|
virDomainMigratePrepareTunnel3Params;
|
||||||
virRegisterDriver;
|
virRegisterHypervisorDriver;
|
||||||
virRegisterInterfaceDriver;
|
virRegisterInterfaceDriver;
|
||||||
virRegisterNetworkDriver;
|
virRegisterNetworkDriver;
|
||||||
virRegisterNodeDeviceDriver;
|
virRegisterNodeDeviceDriver;
|
||||||
|
@ -4729,7 +4729,7 @@ libxlDomainMigrateConfirm3Params(virDomainPtr domain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virDriver libxlDriver = {
|
static virHypervisorDriver libxlDriver = {
|
||||||
.no = VIR_DRV_LIBXL,
|
.no = VIR_DRV_LIBXL,
|
||||||
.name = LIBXL_DRIVER_NAME,
|
.name = LIBXL_DRIVER_NAME,
|
||||||
.connectOpen = libxlConnectOpen, /* 0.9.0 */
|
.connectOpen = libxlConnectOpen, /* 0.9.0 */
|
||||||
@ -4837,7 +4837,7 @@ static virStateDriver libxlStateDriver = {
|
|||||||
int
|
int
|
||||||
libxlRegister(void)
|
libxlRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(&libxlDriver) < 0)
|
if (virRegisterHypervisorDriver(&libxlDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&libxlStateDriver) < 0)
|
if (virRegisterStateDriver(&libxlStateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -5707,7 +5707,7 @@ lxcNodeAllocPages(virConnectPtr conn,
|
|||||||
|
|
||||||
|
|
||||||
/* Function Tables */
|
/* Function Tables */
|
||||||
static virDriver lxcDriver = {
|
static virHypervisorDriver lxcDriver = {
|
||||||
.no = VIR_DRV_LXC,
|
.no = VIR_DRV_LXC,
|
||||||
.name = LXC_DRIVER_NAME,
|
.name = LXC_DRIVER_NAME,
|
||||||
.connectOpen = lxcConnectOpen, /* 0.4.2 */
|
.connectOpen = lxcConnectOpen, /* 0.4.2 */
|
||||||
@ -5810,7 +5810,7 @@ static virStateDriver lxcStateDriver = {
|
|||||||
|
|
||||||
int lxcRegister(void)
|
int lxcRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(&lxcDriver) < 0)
|
if (virRegisterHypervisorDriver(&lxcDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&lxcStateDriver) < 0)
|
if (virRegisterStateDriver(&lxcStateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2552,7 +2552,7 @@ openvzDomainMigrateConfirm3Params(virDomainPtr domain,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virDriver openvzDriver = {
|
static virHypervisorDriver openvzDriver = {
|
||||||
.no = VIR_DRV_OPENVZ,
|
.no = VIR_DRV_OPENVZ,
|
||||||
.name = "OPENVZ",
|
.name = "OPENVZ",
|
||||||
.connectOpen = openvzConnectOpen, /* 0.3.1 */
|
.connectOpen = openvzConnectOpen, /* 0.3.1 */
|
||||||
@ -2620,7 +2620,7 @@ static virDriver openvzDriver = {
|
|||||||
|
|
||||||
int openvzRegister(void)
|
int openvzRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(&openvzDriver) < 0)
|
if (virRegisterHypervisorDriver(&openvzDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2463,7 +2463,7 @@ parallelsNodeGetCPUMap(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virDriver parallelsDriver = {
|
static virHypervisorDriver parallelsDriver = {
|
||||||
.no = VIR_DRV_PARALLELS,
|
.no = VIR_DRV_PARALLELS,
|
||||||
.name = "Parallels",
|
.name = "Parallels",
|
||||||
.connectOpen = parallelsConnectOpen, /* 0.10.0 */
|
.connectOpen = parallelsConnectOpen, /* 0.10.0 */
|
||||||
@ -2518,7 +2518,7 @@ parallelsRegister(void)
|
|||||||
|
|
||||||
VIR_FREE(prlctl_path);
|
VIR_FREE(prlctl_path);
|
||||||
|
|
||||||
if (virRegisterDriver(¶llelsDriver) < 0)
|
if (virRegisterHypervisorDriver(¶llelsDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (parallelsStorageRegister())
|
if (parallelsStorageRegister())
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3717,7 +3717,7 @@ phypInterfaceClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDriver phypDriver = {
|
static virHypervisorDriver phypDriver = {
|
||||||
.no = VIR_DRV_PHYP,
|
.no = VIR_DRV_PHYP,
|
||||||
.name = "PHYP",
|
.name = "PHYP",
|
||||||
.connectOpen = phypConnectOpen, /* 0.7.0 */
|
.connectOpen = phypConnectOpen, /* 0.7.0 */
|
||||||
@ -3786,7 +3786,7 @@ static virInterfaceDriver phypInterfaceDriver = {
|
|||||||
int
|
int
|
||||||
phypRegister(void)
|
phypRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(&phypDriver) < 0)
|
if (virRegisterHypervisorDriver(&phypDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStorageDriver(&phypStorageDriver) < 0)
|
if (virRegisterStorageDriver(&phypStorageDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -18491,7 +18491,7 @@ qemuNodeAllocPages(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virDriver qemuDriver = {
|
static virHypervisorDriver qemuDriver = {
|
||||||
.no = VIR_DRV_QEMU,
|
.no = VIR_DRV_QEMU,
|
||||||
.name = QEMU_DRIVER_NAME,
|
.name = QEMU_DRIVER_NAME,
|
||||||
.connectOpen = qemuConnectOpen, /* 0.2.0 */
|
.connectOpen = qemuConnectOpen, /* 0.2.0 */
|
||||||
@ -18705,7 +18705,7 @@ static virStateDriver qemuStateDriver = {
|
|||||||
|
|
||||||
int qemuRegister(void)
|
int qemuRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(&qemuDriver) < 0)
|
if (virRegisterHypervisorDriver(&qemuDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(&qemuStateDriver) < 0)
|
if (virRegisterStateDriver(&qemuStateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -78,7 +78,6 @@ VIR_LOG_INIT("remote.remote_driver");
|
|||||||
limit, params, nparams)
|
limit, params, nparams)
|
||||||
|
|
||||||
static bool inside_daemon = false;
|
static bool inside_daemon = false;
|
||||||
static virDriverPtr remoteDriver = NULL;
|
|
||||||
|
|
||||||
struct private_data {
|
struct private_data {
|
||||||
virMutex lock;
|
virMutex lock;
|
||||||
@ -8030,7 +8029,7 @@ unsigned long remoteVersion(void)
|
|||||||
return REMOTE_PROTOCOL_VERSION;
|
return REMOTE_PROTOCOL_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDriver remote_driver = {
|
static virHypervisorDriver hypervisor_driver = {
|
||||||
.no = VIR_DRV_REMOTE,
|
.no = VIR_DRV_REMOTE,
|
||||||
.name = "remote",
|
.name = "remote",
|
||||||
.connectOpen = remoteConnectOpen, /* 0.3.0 */
|
.connectOpen = remoteConnectOpen, /* 0.3.0 */
|
||||||
@ -8403,9 +8402,7 @@ static virStateDriver state_driver = {
|
|||||||
int
|
int
|
||||||
remoteRegister(void)
|
remoteRegister(void)
|
||||||
{
|
{
|
||||||
remoteDriver = &remote_driver;
|
if (virRegisterHypervisorDriver(&hypervisor_driver) < 0)
|
||||||
|
|
||||||
if (virRegisterDriver(&remote_driver) < 0)
|
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterNetworkDriver(&network_driver) < 0)
|
if (virRegisterNetworkDriver(&network_driver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -7356,7 +7356,7 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDriver testDriver = {
|
static virHypervisorDriver testDriver = {
|
||||||
.no = VIR_DRV_TEST,
|
.no = VIR_DRV_TEST,
|
||||||
.name = "Test",
|
.name = "Test",
|
||||||
.connectOpen = testConnectOpen, /* 0.1.1 */
|
.connectOpen = testConnectOpen, /* 0.1.1 */
|
||||||
@ -7583,7 +7583,7 @@ static virNWFilterDriver testNWFilterDriver = {
|
|||||||
int
|
int
|
||||||
testRegister(void)
|
testRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(&testDriver) < 0)
|
if (virRegisterHypervisorDriver(&testDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterNetworkDriver(&testNetworkDriver) < 0)
|
if (virRegisterNetworkDriver(&testNetworkDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2928,7 +2928,7 @@ umlNodeAllocPages(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static virDriver umlDriver = {
|
static virHypervisorDriver umlDriver = {
|
||||||
.no = VIR_DRV_UML,
|
.no = VIR_DRV_UML,
|
||||||
.name = "UML",
|
.name = "UML",
|
||||||
.connectOpen = umlConnectOpen, /* 0.5.0 */
|
.connectOpen = umlConnectOpen, /* 0.5.0 */
|
||||||
@ -3003,7 +3003,7 @@ static virStateDriver umlStateDriver = {
|
|||||||
|
|
||||||
int umlRegister(void)
|
int umlRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(¨Driver) < 0)
|
if (virRegisterHypervisorDriver(¨Driver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStateDriver(¨StateDriver) < 0)
|
if (virRegisterStateDriver(¨StateDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -7468,7 +7468,7 @@ vboxNodeAllocPages(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
* Function Tables
|
* Function Tables
|
||||||
*/
|
*/
|
||||||
|
|
||||||
virDriver vboxCommonDriver = {
|
virHypervisorDriver vboxCommonDriver = {
|
||||||
.no = VIR_DRV_VBOX,
|
.no = VIR_DRV_VBOX,
|
||||||
.name = "VBOX",
|
.name = "VBOX",
|
||||||
.connectOpen = vboxConnectOpen, /* 0.6.3 */
|
.connectOpen = vboxConnectOpen, /* 0.6.3 */
|
||||||
@ -7550,7 +7550,7 @@ static void updateDriver(void)
|
|||||||
vboxCommonDriver.domainScreenshot = NULL;
|
vboxCommonDriver.domainScreenshot = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
virDriverPtr vboxGetDriver(uint32_t uVersion)
|
virHypervisorDriverPtr vboxGetHypervisorDriver(uint32_t uVersion)
|
||||||
{
|
{
|
||||||
/* Install gVBoxAPI according to the vbox API version.
|
/* Install gVBoxAPI according to the vbox API version.
|
||||||
* Return -1 for unsupported version.
|
* Return -1 for unsupported version.
|
||||||
|
@ -73,7 +73,7 @@ extern virStorageDriver vbox43_4StorageDriver;
|
|||||||
|
|
||||||
#if !defined(WITH_DRIVER_MODULES) || defined(VBOX_STORAGE_DRIVER)
|
#if !defined(WITH_DRIVER_MODULES) || defined(VBOX_STORAGE_DRIVER)
|
||||||
static void
|
static void
|
||||||
vboxGetDrivers(virDriverPtr *driver_ret,
|
vboxGetDrivers(virHypervisorDriverPtr *hypervisorDriver_ret,
|
||||||
virStorageDriverPtr *storageDriver_ret)
|
virStorageDriverPtr *storageDriver_ret)
|
||||||
{
|
{
|
||||||
virStorageDriverPtr storageDriver;
|
virStorageDriverPtr storageDriver;
|
||||||
@ -136,8 +136,8 @@ vboxGetDrivers(virDriverPtr *driver_ret,
|
|||||||
VIR_DEBUG("VBoxCGlueInit failed, using dummy driver");
|
VIR_DEBUG("VBoxCGlueInit failed, using dummy driver");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (driver_ret)
|
if (hypervisorDriver_ret)
|
||||||
*driver_ret = NULL;
|
*hypervisorDriver_ret = NULL;
|
||||||
if (storageDriver_ret)
|
if (storageDriver_ret)
|
||||||
*storageDriver_ret = storageDriver;
|
*storageDriver_ret = storageDriver;
|
||||||
}
|
}
|
||||||
@ -212,7 +212,7 @@ static virDrvOpenStatus dummyConnectOpen(virConnectPtr conn,
|
|||||||
return VIR_DRV_OPEN_ERROR;
|
return VIR_DRV_OPEN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virDriver vboxDriverDummy = {
|
static virHypervisorDriver vboxDriverDummy = {
|
||||||
VIR_DRV_VBOX,
|
VIR_DRV_VBOX,
|
||||||
"VBOX",
|
"VBOX",
|
||||||
.connectOpen = dummyConnectOpen, /* 0.6.3 */
|
.connectOpen = dummyConnectOpen, /* 0.6.3 */
|
||||||
@ -220,16 +220,16 @@ static virDriver vboxDriverDummy = {
|
|||||||
|
|
||||||
int vboxRegister(void)
|
int vboxRegister(void)
|
||||||
{
|
{
|
||||||
virDriverPtr driver = NULL;
|
virHypervisorDriverPtr driver = NULL;
|
||||||
uint32_t uVersion;
|
uint32_t uVersion;
|
||||||
|
|
||||||
if (VBoxCGlueInit(&uVersion) == 0)
|
if (VBoxCGlueInit(&uVersion) == 0)
|
||||||
driver = vboxGetDriver(uVersion);
|
driver = vboxGetHypervisorDriver(uVersion);
|
||||||
|
|
||||||
if (!driver)
|
if (!driver)
|
||||||
driver = &vboxDriverDummy;
|
driver = &vboxDriverDummy;
|
||||||
|
|
||||||
if (virRegisterDriver(driver) < 0)
|
if (virRegisterHypervisorDriver(driver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
# include "internal.h"
|
# include "internal.h"
|
||||||
|
|
||||||
virDriverPtr vboxGetDriver(uint32_t uVersion);
|
virHypervisorDriverPtr vboxGetHypervisorDriver(uint32_t uVersion);
|
||||||
virNetworkDriverPtr vboxGetNetworkDriver(uint32_t uVersion);
|
virNetworkDriverPtr vboxGetNetworkDriver(uint32_t uVersion);
|
||||||
|
|
||||||
#endif /* VBOX_GET_DRIVER_H */
|
#endif /* VBOX_GET_DRIVER_H */
|
||||||
|
@ -1456,7 +1456,7 @@ _vboxDomainSnapshotRestore(virDomainPtr dom,
|
|||||||
/* No Callback support for VirtualBox 4.* series */
|
/* No Callback support for VirtualBox 4.* series */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_registerDomainEvent(virDriverPtr driver)
|
_registerDomainEvent(virHypervisorDriverPtr driver)
|
||||||
{
|
{
|
||||||
driver->connectDomainEventRegister = NULL;
|
driver->connectDomainEventRegister = NULL;
|
||||||
driver->connectDomainEventDeregister = NULL;
|
driver->connectDomainEventDeregister = NULL;
|
||||||
@ -2007,7 +2007,7 @@ vboxConnectDomainEventDeregisterAny(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_registerDomainEvent(virDriverPtr driver)
|
_registerDomainEvent(virHypervisorDriverPtr driver)
|
||||||
{
|
{
|
||||||
driver->connectDomainEventRegister = vboxConnectDomainEventRegister; /* 0.7.0 */
|
driver->connectDomainEventRegister = vboxConnectDomainEventRegister; /* 0.7.0 */
|
||||||
driver->connectDomainEventDeregister = vboxConnectDomainEventDeregister; /* 0.7.0 */
|
driver->connectDomainEventDeregister = vboxConnectDomainEventDeregister; /* 0.7.0 */
|
||||||
|
@ -541,7 +541,7 @@ typedef struct {
|
|||||||
int (*attachFloppy)(vboxGlobalData *data, IMachine *machine, const char *src);
|
int (*attachFloppy)(vboxGlobalData *data, IMachine *machine, const char *src);
|
||||||
int (*detachFloppy)(IMachine *machine);
|
int (*detachFloppy)(IMachine *machine);
|
||||||
int (*snapshotRestore)(virDomainPtr dom, IMachine *machine, ISnapshot *snapshot);
|
int (*snapshotRestore)(virDomainPtr dom, IMachine *machine, ISnapshot *snapshot);
|
||||||
void (*registerDomainEvent)(virDriverPtr driver);
|
void (*registerDomainEvent)(virHypervisorDriverPtr driver);
|
||||||
vboxUniformedPFN UPFN;
|
vboxUniformedPFN UPFN;
|
||||||
vboxUniformedIID UIID;
|
vboxUniformedIID UIID;
|
||||||
vboxUniformedArray UArray;
|
vboxUniformedArray UArray;
|
||||||
|
@ -1182,7 +1182,7 @@ vmwareConnectListAllDomains(virConnectPtr conn,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static virDriver vmwareDriver = {
|
static virHypervisorDriver vmwareDriver = {
|
||||||
.no = VIR_DRV_VMWARE,
|
.no = VIR_DRV_VMWARE,
|
||||||
.name = "VMWARE",
|
.name = "VMWARE",
|
||||||
.connectOpen = vmwareConnectOpen, /* 0.8.7 */
|
.connectOpen = vmwareConnectOpen, /* 0.8.7 */
|
||||||
@ -1223,7 +1223,7 @@ static virDriver vmwareDriver = {
|
|||||||
int
|
int
|
||||||
vmwareRegister(void)
|
vmwareRegister(void)
|
||||||
{
|
{
|
||||||
if (virRegisterDriver(&vmwareDriver) < 0)
|
if (virRegisterHypervisorDriver(&vmwareDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2744,7 +2744,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 virDriver xenUnifiedDriver = {
|
static virHypervisorDriver xenUnifiedDriver = {
|
||||||
.no = VIR_DRV_XEN_UNIFIED,
|
.no = VIR_DRV_XEN_UNIFIED,
|
||||||
.name = "Xen",
|
.name = "Xen",
|
||||||
.connectOpen = xenUnifiedConnectOpen, /* 0.0.3 */
|
.connectOpen = xenUnifiedConnectOpen, /* 0.0.3 */
|
||||||
@ -2852,7 +2852,7 @@ xenRegister(void)
|
|||||||
{
|
{
|
||||||
if (virRegisterStateDriver(&state_driver) == -1) return -1;
|
if (virRegisterStateDriver(&state_driver) == -1) return -1;
|
||||||
|
|
||||||
return virRegisterDriver(&xenUnifiedDriver);
|
return virRegisterHypervisorDriver(&xenUnifiedDriver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1963,7 +1963,7 @@ xenapiConnectIsAlive(virConnectPtr conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The interface which we export upwards to libvirt.c. */
|
/* The interface which we export upwards to libvirt.c. */
|
||||||
static virDriver xenapiDriver = {
|
static virHypervisorDriver xenapiDriver = {
|
||||||
.no = VIR_DRV_XENAPI,
|
.no = VIR_DRV_XENAPI,
|
||||||
.name = "XenAPI",
|
.name = "XenAPI",
|
||||||
.connectOpen = xenapiConnectOpen, /* 0.8.0 */
|
.connectOpen = xenapiConnectOpen, /* 0.8.0 */
|
||||||
@ -2025,7 +2025,7 @@ static virDriver xenapiDriver = {
|
|||||||
int
|
int
|
||||||
xenapiRegister(void)
|
xenapiRegister(void)
|
||||||
{
|
{
|
||||||
return virRegisterDriver(&xenapiDriver);
|
return virRegisterHypervisorDriver(&xenapiDriver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user