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
This commit is contained in:
Osier Yang 2011-01-25 15:49:51 +08:00 committed by Eric Blake
parent 6cbab7c159
commit dbd63c4d63

View 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;