]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration: set file error on subsection loading
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 24 Oct 2023 08:40:41 +0000 (12:40 +0400)
committerJuan Quintela <quintela@redhat.com>
Mon, 30 Oct 2023 16:44:03 +0000 (17:44 +0100)
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 <marcandre.lureau@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231024084043.2926316-8-marcandre.lureau@redhat.com>

migration/vmstate.c

index 16e33a5d34d895263048f001e8c41beb51ae0013..9c36803c8a0535ff47cd7175fad23bbf8e0030b8 100644 (file)
@@ -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) {