migration: vmstate_save_state_v(): fix error path

In case of pre_save_errp, on error, we continue processing fields,
unlike case of pre_save, where we return immediately. Behavior
for pre_save_errp case is wrong, we must return here, like for
pre_save.

 "migration: Add error-parameterized function variants in VMSD struct"

Fixes: 40de712a89
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Link: https://lore.kernel.org/r/20251028130738.29037-2-vsementsov@yandex-team.ru
Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
Vladimir Sementsov-Ogievskiy 2025-10-28 16:07:37 +03:00 committed by Peter Xu
parent 604bb1badc
commit d4b3a3cc55

View file

@ -443,6 +443,7 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd,
if (ret < 0) {
error_prepend(errp, "pre-save for %s failed, ret: %d: ",
vmsd->name, ret);
return ret;
}
} else if (vmsd->pre_save) {
ret = vmsd->pre_save(opaque);