]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: rename: Forbid renaming domains with managed save image
authorPeter Krempa <pkrempa@redhat.com>
Mon, 7 Mar 2016 09:06:19 +0000 (10:06 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 7 Mar 2016 09:15:37 +0000 (10:15 +0100)
The code does not handle renaming of the save state file. In addition to
that the resuming code would need to be tweaked to handle the name
change since the XML is extracted from the save image. The easies option
is to make the rename API even less useful by forbiding this.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1314594

src/qemu/qemu_driver.c

index 102fade2806891873723a79b06f49be6b4224efe..40203640005f53e379802c066bb39055bd5cf149 100644 (file)
@@ -19994,6 +19994,12 @@ static int qemuDomainRename(virDomainPtr dom,
         goto endjob;
     }
 
+    if (vm->hasManagedSave) {
+        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+                       _("domain with a managed saved state can't be renamed"));
+        goto endjob;
+    }
+
     if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_SHUTOFF) {
         virReportError(VIR_ERR_OPERATION_INVALID,
                        "%s", _("domain has to be shutoff before renaming"));