mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
Added no-op stub of storage APIs to test driver
This commit is contained in:
parent
b49b628ab5
commit
291158945d
@ -1,3 +1,7 @@
|
|||||||
|
Wed Feb 20 10:49:27 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* src/test.c: no-op stub impl of storage APIs
|
||||||
|
|
||||||
Wed Feb 20 10:46:27 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
Wed Feb 20 10:46:27 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
* configure.in: Added check for parted tool & libraries
|
* configure.in: Added check for parted tool & libraries
|
||||||
|
24
src/test.c
24
src/test.c
@ -1917,6 +1917,22 @@ static int testNetworkSetAutostart(virNetworkPtr network,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static virDrvOpenStatus testStorageOpen(virConnectPtr conn,
|
||||||
|
xmlURIPtr uri ATTRIBUTE_UNUSED,
|
||||||
|
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
|
||||||
|
int flags ATTRIBUTE_UNUSED) {
|
||||||
|
if (STRNEQ(conn->driver->name, "Test"))
|
||||||
|
return VIR_DRV_OPEN_DECLINED;
|
||||||
|
|
||||||
|
conn->storagePrivateData = conn->privateData;
|
||||||
|
return VIR_DRV_OPEN_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int testStorageClose(virConnectPtr conn) {
|
||||||
|
conn->storagePrivateData = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static virDriver testDriver = {
|
static virDriver testDriver = {
|
||||||
VIR_DRV_TEST,
|
VIR_DRV_TEST,
|
||||||
@ -1999,6 +2015,12 @@ static virNetworkDriver testNetworkDriver = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static virStorageDriver testStorageDriver = {
|
||||||
|
.name = "Test",
|
||||||
|
.open = testStorageOpen,
|
||||||
|
.close = testStorageClose,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testRegister:
|
* testRegister:
|
||||||
*
|
*
|
||||||
@ -2011,6 +2033,8 @@ testRegister(void)
|
|||||||
return -1;
|
return -1;
|
||||||
if (virRegisterNetworkDriver(&testNetworkDriver) < 0)
|
if (virRegisterNetworkDriver(&testNetworkDriver) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
if (virRegisterStorageDriver(&testStorageDriver) < 0)
|
||||||
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user