From: Peter Xu Date: Tue, 27 Jan 2026 18:52:53 +0000 (-0500) Subject: migration: Simplify qemu_save_device_state() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1580d7346b38fe5a0baee72cdf9f46bd8eb6b150;p=thirdparty%2Fqemu.git migration: Simplify qemu_save_device_state() This function is used by both COLO and Xen. Simplify it with two changes: - Remove checks on qemu_savevm_se_iterable(): this is not needed as vmstate_save() also checks for "save_state() || vmsd" instead. Here, save_setup() (or say, iterable states) should be mutual exclusive to "save_state() || vmsd" [*]. - Remove migrate_error_propagate(): both of the users are not using live migration framework, but raw vmstate operations. Error propagation is only needed for query-migrate persistence. [*] One tricky user is VFIO, who provided _both_ save_state() and save_setup(). However VFIO mustn't have been used in these paths or it means both COLO and Xen have ignored VFIO data instead (that is, qemu_savevm_se_iterable() will return true for VFIO). Hence, this change is safe. Cc: David Woodhouse Cc: Paul Durrant Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas Tested-by: Lukas Straub Link: https://lore.kernel.org/qemu-devel/20260127185254.3954634-24-peterx@redhat.com [commit msg: s/not needed for/only needed for] Signed-off-by: Fabiano Rosas --- diff --git a/migration/savevm.c b/migration/savevm.c index 130b9764a7..b29272db3b 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1897,13 +1897,8 @@ int qemu_save_device_state(QEMUFile *f) QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { int ret; - if (qemu_savevm_se_iterable(se)) { - continue; - } ret = vmstate_save(f, se, NULL, &local_err); if (ret) { - migrate_error_propagate(migrate_get_current(), - error_copy(local_err)); error_report_err(local_err); return ret; }