mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 01:43:23 +00:00
PHYP: Add rudimentary network driver
I changed virStorage[Open|Close] to virVIOSDriver[Open|Close] so the network driver can use it - since the network driver deals with Open/Close in the same way.
This commit is contained in:
parent
b9e1f11a2d
commit
50e4908559
@ -3864,9 +3864,9 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static virDrvOpenStatus
|
static virDrvOpenStatus
|
||||||
phypStorageOpen(virConnectPtr conn,
|
phypVIOSDriverOpen(virConnectPtr conn,
|
||||||
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
virCheckFlags(0, VIR_DRV_OPEN_ERROR);
|
virCheckFlags(0, VIR_DRV_OPEN_ERROR);
|
||||||
|
|
||||||
@ -3877,7 +3877,7 @@ phypStorageOpen(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
phypStorageClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
phypVIOSDriverClose(virConnectPtr conn ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3984,8 +3984,8 @@ static virDriver phypDriver = {
|
|||||||
|
|
||||||
static virStorageDriver phypStorageDriver = {
|
static virStorageDriver phypStorageDriver = {
|
||||||
.name = "PHYP",
|
.name = "PHYP",
|
||||||
.open = phypStorageOpen,
|
.open = phypVIOSDriverOpen,
|
||||||
.close = phypStorageClose,
|
.close = phypVIOSDriverClose,
|
||||||
|
|
||||||
.numOfPools = phypNumOfStoragePools,
|
.numOfPools = phypNumOfStoragePools,
|
||||||
.listPools = phypListStoragePools,
|
.listPools = phypListStoragePools,
|
||||||
@ -4023,6 +4023,29 @@ static virStorageDriver phypStorageDriver = {
|
|||||||
.poolIsPersistent = NULL
|
.poolIsPersistent = NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virNetworkDriver phypNetworkDriver = {
|
||||||
|
.name = "PHYP",
|
||||||
|
.open = phypVIOSDriverOpen,
|
||||||
|
.close = phypVIOSDriverClose,
|
||||||
|
.numOfNetworks = NULL,
|
||||||
|
.listNetworks = NULL,
|
||||||
|
.numOfDefinedNetworks = NULL,
|
||||||
|
.listDefinedNetworks = NULL,
|
||||||
|
.networkLookupByUUID = NULL,
|
||||||
|
.networkLookupByName = NULL,
|
||||||
|
.networkCreateXML = NULL,
|
||||||
|
.networkDefineXML = NULL,
|
||||||
|
.networkUndefine = NULL,
|
||||||
|
.networkCreate = NULL,
|
||||||
|
.networkDestroy = NULL,
|
||||||
|
.networkDumpXML = NULL,
|
||||||
|
.networkGetBridgeName = NULL,
|
||||||
|
.networkGetAutostart = NULL,
|
||||||
|
.networkSetAutostart = NULL,
|
||||||
|
.networkIsActive = NULL,
|
||||||
|
.networkIsPersistent = NULL
|
||||||
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
phypRegister(void)
|
phypRegister(void)
|
||||||
{
|
{
|
||||||
@ -4030,6 +4053,8 @@ phypRegister(void)
|
|||||||
return -1;
|
return -1;
|
||||||
if (virRegisterStorageDriver(&phypStorageDriver) < 0)
|
if (virRegisterStorageDriver(&phypStorageDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
if (virRegisterNetworkDriver(&phypNetworkDriver) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user