[libvirt] [PATCH] qemu: forbid renaming domain which has managedsave file

Shanzhi Yu shyu at redhat.com
Thu Mar 3 12:47:47 UTC 2016


after rename a domain which has managedsave file, the new name domain
can't boot up from the state it saved, and the managedsave file will
exist with the original name.

Signed-off-by: Shanzhi Yu <shyu at redhat.com>
---
 src/qemu/qemu_driver.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4bd4071..036a367 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20000,6 +20000,12 @@ static int qemuDomainRename(virDomainPtr dom,
         goto endjob;
     }
 
+    if (vm->hasManagedSave) {
+        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                       _("can't rename a domain has managedsave file"));
+        goto endjob;
+    }
+
     if (virDomainObjListRename(driver->domains, vm, new_name, flags,
                                qemuDomainRenameCallback, driver) < 0)
         goto endjob;
-- 
2.5.0




More information about the libvir-list mailing list