[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 06/33] migration: push Error **errp into qemu_loadvm_section_
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 06/33] migration: push Error **errp into qemu_loadvm_section_start_full() |
Date: |
Thu, 4 Feb 2021 23:04:20 +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.
>
> This is particularly useful for loading snapshots as this is a likely
> error scenario to hit when the source and dest VM configs do not
> match. This is illustrated by the improved error reporting in the
> QMP load snapshot test.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> migration/savevm.c | 49 +++++++++----------
> .../tests/internal-snapshots-qapi.out | 3 +-
> 2 files changed, 25 insertions(+), 27 deletions(-)
...
> instance_id = qemu_get_be32(f);
> version_id = qemu_get_be32(f);
>
> ret = qemu_file_get_error(f);
> if (ret) {
> - error_report("%s: Failed to read instance/version ID: %d",
> - __func__, ret);
> - return ret;
> + error_setg(errp, "Failed to read instance/version ID: %d",
> + ret);
error_setg_errno()
> + return -1;
> }
...
> @@ -2601,11 +2603,8 @@ retry:
> switch (section_type) {
> case QEMU_VM_SECTION_START:
> case QEMU_VM_SECTION_FULL:
> - ret = qemu_loadvm_section_start_full(f, mis);
> + ret = qemu_loadvm_section_start_full(f, mis, errp);
> if (ret < 0) {
> - error_setg(errp,
> - "Failed to load device state section start: %d",
> - ret);
Ditto.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> goto out;
> }
> break;
- [PATCH 07/33] migration: push Error **errp into qemu_loadvm_section_part_end(), (continued)
- [PATCH 07/33] migration: push Error **errp into qemu_loadvm_section_part_end(), Daniel P . Berrangé, 2021/02/04
- [PATCH 09/33] migration: push Error **errp into loadvm_handle_cmd_packaged(), Daniel P . Berrangé, 2021/02/04
- [PATCH 03/33] migration: push Error **errp into qemu_loadvm_state_setup(), Daniel P . Berrangé, 2021/02/04
- [PATCH 05/33] migration: push Error **errp into qemu_loadvm_state_main(), Daniel P . Berrangé, 2021/02/04
- [PATCH 06/33] migration: push Error **errp into qemu_loadvm_section_start_full(), Daniel P . Berrangé, 2021/02/04
- Re: [PATCH 06/33] migration: push Error **errp into qemu_loadvm_section_start_full(),
Philippe Mathieu-Daudé <=
- [PATCH 08/33] migration: push Error **errp into loadvm_process_command(), Daniel P . Berrangé, 2021/02/04
- [PATCH 10/33] migration: push Error **errp into loadvm_postcopy_handle_advise(), Daniel P . Berrangé, 2021/02/04
- [PATCH 11/33] migration: push Error **errp into ram_postcopy_incoming_init(), Daniel P . Berrangé, 2021/02/04
- [PATCH 13/33] migration: push Error **errp into loadvm_postcopy_handle_run(), Daniel P . Berrangé, 2021/02/04
- [PATCH 12/33] migration: push Error **errp into loadvm_postcopy_handle_listen(), Daniel P . Berrangé, 2021/02/04
- [PATCH 15/33] migration: make loadvm_postcopy_handle_resume() void, Daniel P . Berrangé, 2021/02/04