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

Misc fixes to secrets API code

* proxy/Makefile.am: Build storage_encryption_conf.c since its a
  dependancy of domain_conf.c
* src/storage_encryption_conf.c: Disable XML parsing APis when
  build under proxy
* src/test.c: Add a dummy no-op secrets driver for test suite
上级 6a035507
...@@ -16,6 +16,7 @@ libvirt_proxy_SOURCES = libvirt_proxy.c @top_srcdir@/src/xend_internal.c \ ...@@ -16,6 +16,7 @@ libvirt_proxy_SOURCES = libvirt_proxy.c @top_srcdir@/src/xend_internal.c \
@top_srcdir@/src/xs_internal.c @top_srcdir@/src/buf.c \ @top_srcdir@/src/xs_internal.c @top_srcdir@/src/buf.c \
@top_srcdir@/src/capabilities.c \ @top_srcdir@/src/capabilities.c \
@top_srcdir@/src/memory.c \ @top_srcdir@/src/memory.c \
@top_srcdir@/src/storage_encryption_conf.c \
@top_srcdir@/src/domain_conf.c \ @top_srcdir@/src/domain_conf.c \
@top_srcdir@/src/util.c \ @top_srcdir@/src/util.c \
@top_srcdir@/src/event.c \ @top_srcdir@/src/event.c \
......
...@@ -64,6 +64,8 @@ virStorageEncryptionFree(virStorageEncryptionPtr enc) ...@@ -64,6 +64,8 @@ virStorageEncryptionFree(virStorageEncryptionPtr enc)
VIR_FREE(enc); VIR_FREE(enc);
} }
#ifndef PROXY
static virStorageEncryptionSecretPtr static virStorageEncryptionSecretPtr
virStorageEncryptionSecretParse(virConnectPtr conn, xmlXPathContextPtr ctxt, virStorageEncryptionSecretParse(virConnectPtr conn, xmlXPathContextPtr ctxt,
xmlNodePtr node) xmlNodePtr node)
...@@ -191,6 +193,8 @@ virStorageEncryptionParseNode(virConnectPtr conn, ...@@ -191,6 +193,8 @@ virStorageEncryptionParseNode(virConnectPtr conn,
xmlXPathFreeContext(ctxt); xmlXPathFreeContext(ctxt);
return enc; return enc;
} }
#endif /* ! PROXY */
static int static int
virStorageEncryptionSecretFormat(virConnectPtr conn, virStorageEncryptionSecretFormat(virConnectPtr conn,
......
...@@ -4173,6 +4173,20 @@ static void testDomainEventQueue(testConnPtr driver, ...@@ -4173,6 +4173,20 @@ static void testDomainEventQueue(testConnPtr driver,
virEventUpdateTimeout(driver->domainEventTimer, 0); virEventUpdateTimeout(driver->domainEventTimer, 0);
} }
static virDrvOpenStatus testSecretOpen(virConnectPtr conn,
virConnectAuthPtr auth ATTRIBUTE_UNUSED,
int flags ATTRIBUTE_UNUSED) {
if (STRNEQ(conn->driver->name, "Test"))
return VIR_DRV_OPEN_DECLINED;
conn->secretPrivateData = conn->privateData;
return VIR_DRV_OPEN_SUCCESS;
}
static int testSecretClose(virConnectPtr conn) {
conn->secretPrivateData = NULL;
return 0;
}
static virDriver testDriver = { static virDriver testDriver = {
VIR_DRV_TEST, VIR_DRV_TEST,
...@@ -4328,6 +4342,11 @@ static virDeviceMonitor testDevMonitor = { ...@@ -4328,6 +4342,11 @@ static virDeviceMonitor testDevMonitor = {
.close = testDevMonClose, .close = testDevMonClose,
}; };
static virSecretDriver testSecretDriver = {
.name = "Test",
.open = testSecretOpen,
.close = testSecretClose,
};
/** /**
...@@ -4348,6 +4367,8 @@ testRegister(void) ...@@ -4348,6 +4367,8 @@ testRegister(void)
return -1; return -1;
if (virRegisterDeviceMonitor(&testDevMonitor) < 0) if (virRegisterDeviceMonitor(&testDevMonitor) < 0)
return -1; return -1;
if (virRegisterSecretDriver(&testSecretDriver) < 0)
return -1;
return 0; return 0;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册