[libvirt] [PATCH] qemu: Error prompt when managed save a shutoff domain

Daniel Veillard veillard at redhat.com
Tue Jan 25 07:58:42 UTC 2011


On Tue, Jan 25, 2011 at 03:49:51PM +0800, Osier Yang wrote:
> The problem was intrduced by commit 4303c91, which removed the checking
> of domain state, this patch is to fix it.
> 
> Otherwise, improper error will be throwed, e.g.
> 
> # virsh managedsave rhel6
> 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 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 34cc29f..575dbd3 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;

  Ahhh, yes it makes sense,

  ACK

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list