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:
Eduardo Otubo 2010-08-12 11:33:12 -03:00 committed by Eric Blake
parent b9e1f11a2d
commit 50e4908559

View File

@ -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;
} }