]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Error prompt when managed save a shutoff domain
authorOsier Yang <jyang@redhat.com>
Tue, 25 Jan 2011 07:49:51 +0000 (15:49 +0800)
committerEric Blake <eblake@redhat.com>
Tue, 25 Jan 2011 16:51:26 +0000 (09:51 -0700)
The problem was introduced by commit 4303c91, which removed the checking
of domain state, this patch is to fix it.

Otherwise, improper error will be thrown, e.g.

error: Failed to save domain rhel6 state
error: cannot resolve symlink /var/lib/libvirt/qemu/save/rhel6.save: No such
file or directory

src/qemu/qemu_driver.c

index 34cc29fbaf823213221e1ced0aee6e0d017c4a11..575dbd339501c8f86d82a20f2db064534a0f607d 100644 (file)
@@ -4640,6 +4640,12 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int flags)
         goto cleanup;
     }
 
+    if (!virDomainObjIsActive(vm)) {
+        qemuReportError(VIR_ERR_OPERATION_INVALID,
+                        "%s", _("domain is not running"));
+        goto cleanup;
+    }
+
     name = qemuDomainManagedSavePath(driver, vm);
     if (name == NULL)
         goto cleanup;