qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 10/12] savevm: update return value from qemu_


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 10/12] savevm: update return value from qemu_savevm_state
Date: Tue, 26 Mar 2013 15:57:40 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

On 03/22/2013 07:16 AM, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <address@hidden>
> ---

The commit message could usefully explain _why_ it is okay to collapse
all error values into one.  As written, the code appears accurate; and
the lone caller (do_savevm) handles the new semantics.  But this goes
back to my question in 9/10 - why not use errp as the witness, and
return void, instead of duplicating information?

>  savevm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/savevm.c b/savevm.c
> index 45d1b09..2e5f029 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -1805,7 +1805,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
>      };
>  
>      if (qemu_savevm_state_blocked(errp)) {
> -        return -EINVAL;
> +        return -1;
>      }
>  
>      qemu_mutex_unlock_iothread();
> @@ -1826,7 +1826,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp)
>      if (ret != 0) {
>          qemu_savevm_state_cancel();
>      }
> -    return ret;
> +    return ret == 0 ? 0 : -1;
>  }
>  
>  static int qemu_save_device_state(QEMUFile *f)
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]