提交 29115894 编写于 作者: D Daniel P. Berrange

Added no-op stub of storage APIs to test driver

上级 b49b628a
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>
* configure.in: Added check for parted tool & libraries
......
......@@ -1917,6 +1917,22 @@ static int testNetworkSetAutostart(virNetworkPtr network,
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 = {
VIR_DRV_TEST,
......@@ -1999,6 +2015,12 @@ static virNetworkDriver testNetworkDriver = {
};
static virStorageDriver testStorageDriver = {
.name = "Test",
.open = testStorageOpen,
.close = testStorageClose,
};
/**
* testRegister:
*
......@@ -2011,6 +2033,8 @@ testRegister(void)
return -1;
if (virRegisterNetworkDriver(&testNetworkDriver) < 0)
return -1;
if (virRegisterStorageDriver(&testStorageDriver) < 0)
return -1;
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册