This commit adds qemu driver implementation to edit xml
configuration of managed save state file of a domain.
Signed-off-by: Kothapally Madhu Pavan <kmp(a)linux.vnet.ibm.com>
---
src/qemu/qemu_driver.c | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c9b3ef3..7ce6464 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6837,6 +6837,43 @@ qemuDomainManagedSaveGetXMLDesc(virDomainPtr dom, unsigned int
flags)
return ret;
}
+static int
+qemuDomainManagedSaveDefineXML(virDomainPtr dom, const char *dxml,
+ unsigned int flags)
+{
+ virQEMUDriverPtr driver = dom->conn->privateData;
+ virConnectPtr conn = dom->conn;
+ virDomainObjPtr vm;
+ char *path = NULL;
+
+ if (!(vm = qemuDomObjFromDomain(dom)))
+ return -1;
+
+ path = qemuDomainManagedSavePath(driver, vm);
+ if (!path)
+ goto error;
+
+ virDomainObjEndAPI(&vm);
+
+ if (conn->driver->domainSaveImageDefineXML) {
+ int ret;
+ ret = qemuDomainSaveImageDefineXML(conn, path, dxml, flags);
+
+ VIR_FREE(path);
+
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virReportUnsupportedError();
+
+ error:
+ VIR_FREE(path);
+ virDispatchError(conn);
+ return -1;
+}
+
/* Return 0 on success, 1 if incomplete saved image was silently unlinked,
* and -1 on failure with error raised. */
static int
@@ -20850,6 +20887,7 @@ static virHypervisorDriver qemuHypervisorDriver = {
.domainHasManagedSaveImage = qemuDomainHasManagedSaveImage, /* 0.8.0 */
.domainManagedSaveRemove = qemuDomainManagedSaveRemove, /* 0.8.0 */
.domainManagedSaveGetXMLDesc = qemuDomainManagedSaveGetXMLDesc, /* 3.5.0 */
+ .domainManagedSaveDefineXML = qemuDomainManagedSaveDefineXML, /* 3.5.0 */
.domainSnapshotCreateXML = qemuDomainSnapshotCreateXML, /* 0.8.0 */
.domainSnapshotGetXMLDesc = qemuDomainSnapshotGetXMLDesc, /* 0.8.0 */
.domainSnapshotNum = qemuDomainSnapshotNum, /* 0.8.0 */
--
1.8.3.1