From: Marc-André Lureau Date: Tue, 24 Oct 2023 08:40:41 +0000 (+0400) Subject: migration: set file error on subsection loading X-Git-Tag: qemu-xen-4.20.0~460^2~18 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cd4c0da6dbeac5cc986a4a553c722cbf4b3d0300;p=qemu-xen.git migration: set file error on subsection loading commit 13cde50889237 ("vmstate: Return error in case of error") sets QemuFile error to stop reading from it and report to the caller (checked by unit tests). We should do the same on subsection loading error. Signed-off-by: Marc-André Lureau Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela Message-ID: <20231024084043.2926316-8-marcandre.lureau@redhat.com> --- diff --git a/migration/vmstate.c b/migration/vmstate.c index 16e33a5d34..9c36803c8a 100644 --- a/migration/vmstate.c +++ b/migration/vmstate.c @@ -179,6 +179,7 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd, assert(field->flags == VMS_END); ret = vmstate_subsection_load(f, vmsd, opaque); if (ret != 0) { + qemu_file_set_error(f, ret); return ret; } if (vmsd->post_load) {