[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-9.1 v5 08/14] migration: Add Error** argument to .load_se
From: |
Markus Armbruster |
Subject: |
Re: [PATCH for-9.1 v5 08/14] migration: Add Error** argument to .load_setup() handler |
Date: |
Wed, 20 Mar 2024 09:02:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Cédric Le Goater <clg@redhat.com> writes:
> This will be useful to report errors at a higher level, mostly in VFIO
> today.
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
[...]
> diff --git a/migration/savevm.c b/migration/savevm.c
> index
> 535ad5a32d67057dd172ce25d561a66a07172e97..8f42999a15d1685957de9ed517d6bc9ba49c3f11
> 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -2747,8 +2747,9 @@ static void
> qemu_loadvm_state_switchover_ack_needed(MigrationIncomingState *mis)
>
> trace_loadvm_state_switchover_ack_needed(mis->switchover_ack_pending_num);
> }
>
> -static int qemu_loadvm_state_setup(QEMUFile *f)
> +static int qemu_loadvm_state_setup(QEMUFile *f, Error **errp)
> {
> + ERRP_GUARD(); /* error_prepend use */
The comment is correct, but prone to go stale. No other use of
ERRP_GUARD() is commented. Suggest to drop it.
> SaveStateEntry *se;
> int ret;
>
> @@ -2763,10 +2764,11 @@ static int qemu_loadvm_state_setup(QEMUFile *f)
> }
> }
>
> - ret = se->ops->load_setup(f, se->opaque);
> + ret = se->ops->load_setup(f, se->opaque, errp);
> if (ret < 0) {
> + error_prepend(errp, "Load state of device %s failed: ",
> + se->idstr);
> qemu_file_set_error(f, ret);
> - error_report("Load state of device %s failed", se->idstr);
> return ret;
> }
> }
> @@ -2947,7 +2949,8 @@ int qemu_loadvm_state(QEMUFile *f)
> return ret;
> }
>
> - if (qemu_loadvm_state_setup(f) != 0) {
> + if (qemu_loadvm_state_setup(f, &local_err) != 0) {
> + error_report_err(local_err);
> return -EINVAL;
> }
- [PATCH for-9.1 v5 00/14] migration: Improve error reporting, Cédric Le Goater, 2024/03/20
- [PATCH for-9.1 v5 02/14] vfio: Always report an error in vfio_save_setup(), Cédric Le Goater, 2024/03/20
- [PATCH for-9.1 v5 01/14] s390/stattrib: Add Error** argument to set_migrationmode() handler, Cédric Le Goater, 2024/03/20
- [PATCH for-9.1 v5 03/14] migration: Always report an error in block_save_setup(), Cédric Le Goater, 2024/03/20
- [PATCH for-9.1 v5 05/14] migration: Add Error** argument to vmstate_save(), Cédric Le Goater, 2024/03/20
- [PATCH for-9.1 v5 06/14] migration: Add Error** argument to qemu_savevm_state_setup(), Cédric Le Goater, 2024/03/20
- [PATCH for-9.1 v5 04/14] migration: Always report an error in ram_save_setup(), Cédric Le Goater, 2024/03/20
- [PATCH for-9.1 v5 08/14] migration: Add Error** argument to .load_setup() handler, Cédric Le Goater, 2024/03/20
- Re: [PATCH for-9.1 v5 08/14] migration: Add Error** argument to .load_setup() handler,
Markus Armbruster <=
- [PATCH for-9.1 v5 07/14] migration: Add Error** argument to .save_setup() handler, Cédric Le Goater, 2024/03/20
- [PATCH for-9.1 v5 09/14] memory: Add Error** argument to .log_global_start() handler, Cédric Le Goater, 2024/03/20
[PATCH for-9.1 v5 10/14] migration: Introduce ram_bitmaps_destroy(), Cédric Le Goater, 2024/03/20