Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
src/test/test_driver.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 8715d6c0d6..360bdef373 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -7633,6 +7633,43 @@ testDomainManagedSaveGetXMLDesc(virDomainPtr dom,
}
+static int
+testDomainManagedSaveDefineXML(virDomainPtr dom,
+ const char *dxml,
+ unsigned int flags)
+{
+ virDomainObjPtr vm = NULL;
+ virDomainDefPtr newdef = NULL;
+ testDriverPtr privconn = dom->conn->privateData;
+ int ret = -1;
+
+ virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE |
+ VIR_DOMAIN_SAVE_RUNNING |
+ VIR_DOMAIN_SAVE_PAUSED, -1);
+
+ if (!(vm = testDomObjFromDomain(dom)))
+ return -1;
+
+ if (vm->hasManagedSave == false) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain does not have managed save image"));
+ goto cleanup;
+ }
+
+ if ((newdef = virDomainDefParseString(dxml, privconn->caps, privconn->xmlopt,
NULL,
+ VIR_DOMAIN_DEF_PARSE_INACTIVE)) == NULL)
+ goto cleanup;
+
+ virDomainDefFree(vm->def);
+ vm->def = newdef;
+
+ ret = 0;
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
+
static int
testDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
{
@@ -9055,6 +9092,7 @@ static virHypervisorDriver testHypervisorDriver = {
.connectGetCPUModelNames = testConnectGetCPUModelNames, /* 1.1.3 */
.domainManagedSave = testDomainManagedSave, /* 1.1.4 */
.domainManagedSaveGetXMLDesc = testDomainManagedSaveGetXMLDesc, /* 5.7.0 */
+ .domainManagedSaveDefineXML = testDomainManagedSaveDefineXML, /* 5.7.0 */
.domainHasManagedSaveImage = testDomainHasManagedSaveImage, /* 1.1.4 */
.domainManagedSaveRemove = testDomainManagedSaveRemove, /* 1.1.4 */
.domainMemoryStats = testDomainMemoryStats, /* 5.7.0 */
--
2.22.0