qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 14/33] migration: push Error **errp into loadvm_postcopy_ram_


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 14/33] migration: push Error **errp into loadvm_postcopy_ram_handle_discard()
Date: Fri, 5 Feb 2021 17:24:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

On 2/4/21 6:18 PM, Daniel P. Berrangé wrote:
> This is an incremental step in converting vmstate loading code to report
> via Error objects instead of printing directly to the console/monitor.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  migration/savevm.c | 31 +++++++++++++++----------------
>  1 file changed, 15 insertions(+), 16 deletions(-)
> 
> diff --git a/migration/savevm.c b/migration/savevm.c
> index fa7883ae5e..2216c61c6f 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1735,7 +1735,8 @@ static int 
> loadvm_postcopy_handle_advise(MigrationIncomingState *mis,
>   * There can be 0..many of these messages, each encoding multiple pages.
>   */
>  static int loadvm_postcopy_ram_handle_discard(MigrationIncomingState *mis,
> -                                              uint16_t len)
> +                                              uint16_t len,
> +                                              Error **errp)
>  {
>      int tmp;
>      char ramid[256];
> @@ -1748,7 +1749,8 @@ static int 
> loadvm_postcopy_ram_handle_discard(MigrationIncomingState *mis,
>          /* 1st discard */
>          tmp = postcopy_ram_prepare_discard(mis);
>          if (tmp) {
> -            return tmp;
> +            error_setg(errp, "Failed to prepare for RAM discard: %d", tmp);

New error, OK.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> +            return -1;
>          }




reply via email to

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