migration: Rephrase message on failure to save / load Xen device state
commitfdac62dbd3de7e65c5a79798097894a29125c60e
authorMarkus Armbruster <armbru@redhat.com>
Mon, 13 May 2024 14:17:02 +0000 (13 16:17 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 27 May 2024 10:42:52 +0000 (27 12:42 +0200)
treeb8628e0150d08f1bd2ac11073a21f06cbc344175
parentc59fb13be7fd937c087ed103abad4c2d9d2bcfab
migration: Rephrase message on failure to save / load Xen device state

Functions that use an Error **errp parameter to return errors should
not also report them to the user, because reporting is the caller's
job.  When the caller does, the error is reported twice.  When it
doesn't (because it recovered from the error), there is no error to
report, i.e. the report is bogus.

qmp_xen_save_devices_state() and qmp_xen_load_devices_state() violate
this principle: they call qemu_save_device_state() and
qemu_loadvm_state(), which call error_report_err().

I wish I could clean this up now, but migration's error reporting is
too complicated (confused?) for me to mess with it.

Instead, I'm merely improving the error reported by
qmp_xen_load_devices_state() and qmp_xen_load_devices_state() to the
QMP core from

    An IO error has occurred

to
    saving Xen device state failed

and

    loading Xen device state failed

respectively.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20240513141703.549874-6-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Fabiano Rosas <farosas@suse.de>
Acked-by: Peter Xu <peterx@redhat.com>
migration/savevm.c