qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 07/12] savevm: update error reporting for qem


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v2 07/12] savevm: update error reporting for qemu_loadvm_state()
Date: Fri, 3 May 2013 13:17:01 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 24.04.2013 um 17:32 hat Pavel Hrdina geschrieben:
> Signed-off-by: Pavel Hrdina <address@hidden>
> ---
>  include/sysemu/sysemu.h |  2 +-
>  migration.c             | 11 ++++++---
>  savevm.c                | 65 
> ++++++++++++++++++++++++-------------------------
>  3 files changed, 40 insertions(+), 38 deletions(-)

> @@ -2212,8 +2216,8 @@ int qemu_loadvm_state(QEMUFile *f)
>  
>              ret = vmstate_load(f, le->se, le->version_id);
>              if (ret < 0) {
> -                fprintf(stderr, "qemu: warning: error while loading state 
> for instance 0x%x of device '%s'\n",
> -                        instance_id, idstr);
> +                error_setg(errp, "Error while loading state for instance "
> +                           "0x%x of device '%s'", instance_id, idstr);

error_setg_errno?

>                  goto out;
>              }
>              break;
> @@ -2227,40 +2231,35 @@ int qemu_loadvm_state(QEMUFile *f)
>                  }
>              }
>              if (le == NULL) {
> -                fprintf(stderr, "Unknown savevm section %d\n", section_id);
> -                ret = -EINVAL;
> +                error_setg(errp, "Unknown vmstate section %d", section_id);
>                  goto out;
>              }
>  
>              ret = vmstate_load(f, le->se, le->version_id);
>              if (ret < 0) {
> -                fprintf(stderr, "qemu: warning: error while loading state 
> section id %d\n",
> +                error_setg(errp, "Error while loading state section id %d",
>                          section_id);

Here, too.

>                  goto out;
>              }
>              break;
>          default:
> -            fprintf(stderr, "Unknown savevm section type %d\n", 
> section_type);
> -            ret = -EINVAL;
> +            error_setg(errp, "Unknown vmstate section type %d", 
> section_type);
>              goto out;
>          }
>      }

Kevin



reply via email to

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