qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 06/11] savevm: update error reporting for qemu_l


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 06/11] savevm: update error reporting for qemu_loadvm_state()
Date: Tue, 16 Apr 2013 15:42:47 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

On 04/16/2013 10:05 AM, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <address@hidden>
> ---
>  include/sysemu/sysemu.h |  2 +-
>  migration.c             |  9 +++----
>  savevm.c                | 64 
> ++++++++++++++++++++++++-------------------------
>  3 files changed, 37 insertions(+), 38 deletions(-)
> 

> +++ b/migration.c
> @@ -93,12 +93,13 @@ void qemu_start_incoming_migration(const char *uri, Error 
> **errp)
>  static void process_incoming_migration_co(void *opaque)
>  {
>      QEMUFile *f = opaque;
> -    int ret;
> +    Error *local_err = NULL;
>  
> -    ret = qemu_loadvm_state(f);
> +    qemu_loadvm_state(f, &local_err);
>      qemu_fclose(f);
> -    if (ret < 0) {
> -        fprintf(stderr, "load of migration failed\n");
> +    if (error_is_set(&local_err)) {
> +        fprintf(stderr, "%s\n", error_get_pretty(local_err));
> +        error_free(local_err);
>          exit(0);

Pre-existing, but WHY are we exiting with successful status even when
incoming migration failed?  This feels SOOOO wrong.  Exiting non-zero
would at least give management apps like libvirt a reason to inspect the
output for the error message.

>      v = qemu_get_be32(f);
>      if (v == QEMU_VM_FILE_VERSION_COMPAT) {
> -        fprintf(stderr, "SaveVM v2 format is obsolete and don't work 
> anymore\n");
> -        return -ENOTSUP;
> +        error_setg(errp, "saveVM v2 format is obsolete and don't work 
> anymore");

As long as you are touching this, fix the grammar:

s/don't/doesn't/

As my findings were pre-existing problems:

Reviewed-by: Eric Blake <address@hidden>

-- 
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]