mirror of https://gitee.com/openkylin/libvirt.git
test_driver: implement virDomainSaveImageGetXMLDesc
Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
4d39a99142
commit
49df9205f2
|
@ -2291,6 +2291,30 @@ testDomainSaveImageDefineXML(virConnectPtr conn,
|
|||
}
|
||||
|
||||
|
||||
static char *
|
||||
testDomainSaveImageGetXMLDesc(virConnectPtr conn,
|
||||
const char *path,
|
||||
unsigned int flags)
|
||||
{
|
||||
int fd = -1;
|
||||
char *ret = NULL;
|
||||
virDomainDefPtr def = NULL;
|
||||
testDriverPtr privconn = conn->privateData;
|
||||
|
||||
virCheckFlags(VIR_DOMAIN_SAVE_IMAGE_XML_SECURE, NULL);
|
||||
|
||||
if ((fd = testDomainSaveImageOpen(privconn, path, &def)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret = virDomainDefFormat(def, privconn->caps, VIR_DOMAIN_DEF_FORMAT_SECURE);
|
||||
|
||||
cleanup:
|
||||
virDomainDefFree(def);
|
||||
VIR_FORCE_CLOSE(fd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int testDomainCoreDumpWithFormat(virDomainPtr domain,
|
||||
const char *to,
|
||||
unsigned int dumpformat,
|
||||
|
@ -7114,6 +7138,7 @@ static virHypervisorDriver testHypervisorDriver = {
|
|||
.domainRestore = testDomainRestore, /* 0.3.2 */
|
||||
.domainRestoreFlags = testDomainRestoreFlags, /* 0.9.4 */
|
||||
.domainSaveImageDefineXML = testDomainSaveImageDefineXML, /* 5.5.0 */
|
||||
.domainSaveImageGetXMLDesc = testDomainSaveImageGetXMLDesc, /* 5.5.0 */
|
||||
.domainCoreDump = testDomainCoreDump, /* 0.3.2 */
|
||||
.domainCoreDumpWithFormat = testDomainCoreDumpWithFormat, /* 1.2.3 */
|
||||
.domainSetVcpus = testDomainSetVcpus, /* 0.1.4 */
|
||||
|
|
Loading…
Reference in New Issue