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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]