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é <[email protected]>
> ---
> migration/colo.c | 3 +--
> migration/savevm.c | 4 ++--
> migration/savevm.h | 2 +-
> 3 files changed, 4 insertions(+), 5 deletions(-)
...
> -int qemu_load_device_state(QEMUFile *f)
> +int qemu_load_device_state(QEMUFile *f, Error **errp)
> {
> MigrationIncomingState *mis = migration_incoming_get_current();
> int ret;
> @@ -2734,7 +2734,7 @@ int qemu_load_device_state(QEMUFile *f)
> /* Load QEMU_VM_SECTION_FULL section */
> ret = qemu_loadvm_state_main(f, mis);
> if (ret < 0) {
> - error_report("Failed to load device state: %d", ret);
> + error_setg(errp, "Failed to load device state: %d", ret);
error_setg_errno(), otherwise:
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
> return ret;
> }