From dbd63c4d63af26580acd213648eb5b5b961d70dc Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Tue, 25 Jan 2011 15:49:51 +0800 Subject: [PATCH] qemu: Error prompt when managed save a shutoff domain 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 34cc29fbaf..575dbd3395 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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; -- GitLab