mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-11 04:15:49 +00:00
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
This commit is contained in:
parent
6a035507fd
commit
575b18c0f0
@ -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)
|
|||||||
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,
|
|||||||
xmlXPathFreeContext(ctxt);
|
xmlXPathFreeContext(ctxt);
|
||||||
return enc;
|
return enc;
|
||||||
}
|
}
|
||||||
|
#endif /* ! PROXY */
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virStorageEncryptionSecretFormat(virConnectPtr conn,
|
virStorageEncryptionSecretFormat(virConnectPtr conn,
|
||||||
|
21
src/test.c
21
src/test.c
@ -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 = {
|
|||||||
.close = testDevMonClose,
|
.close = testDevMonClose,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static virSecretDriver testSecretDriver = {
|
||||||
|
.name = "Test",
|
||||||
|
.open = testSecretOpen,
|
||||||
|
.close = testSecretClose,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user