All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, philmd@linaro.org, fam@euphon.net,
	kwolf@redhat.com, hreitz@redhat.com, marcandre.lureau@redhat.com,
	farosas@suse.de, pbonzini@redhat.com,
	richard.henderson@linaro.org, qemu-block@nongnu.org
Subject: Re: [PATCH 5/6] migration: Rephrase message on failure to save / load Xen device state
Date: Mon, 27 May 2024 10:35:20 -0400	[thread overview]
Message-ID: <ZlSaKHxJS7ZtMH0o@x1n> (raw)
In-Reply-To: <87wmnfcyql.fsf@pond.sub.org>

On Mon, May 27, 2024 at 12:53:22PM +0200, Markus Armbruster wrote:
> Peter Xu <peterx@redhat.com> writes:
> 
> > On Mon, May 13, 2024 at 04:17:02PM +0200, Markus Armbruster wrote:
> >> 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.
> >
> > :-(
> 
> If I understood how it's *supposed* to work, I might have a chance...
> 
> I can see a mixture of reporting errors directly (with error_report() &
> friends), passing them to callers (via Error **errp), and storing them
> in / retrieving them from MigrationState member @error.  This can't be
> right.
> 
> I think a necessary first step towards getting it right is a shared
> understanding how errors are to be handled in migration code.  This
> includes how error data should flow from error source to error sink, and
> what the possible sinks are.

True.  I think the sink should always be MigrationState.error so far.

There's also the other complexity on detecting errors using either
qemu_file_get_error() or migrate_get_error().. the error handling in
migration is indeed prone to a cleanup.

I've added a cleanup entry for migration todo page:

https://wiki.qemu.org/ToDo/LiveMigration#Migration_error_detection_and_reporting

Thanks,

-- 
Peter Xu



  reply	other threads:[~2024-05-27 14:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 14:16 [PATCH 0/6] error: Eliminate QERR_IO_ERROR Markus Armbruster
2024-05-13 14:16 ` [PATCH 1/6] block: Improve error message when external snapshot can't flush Markus Armbruster
2024-05-13 14:24   ` Philippe Mathieu-Daudé
2024-05-13 14:16 ` [PATCH 2/6] dump/win_dump: Improve error messages on write error Markus Armbruster
2024-05-13 14:22   ` Philippe Mathieu-Daudé
2024-05-13 14:48     ` Markus Armbruster
2024-05-13 14:55       ` Philippe Mathieu-Daudé
2024-05-13 14:17 ` [PATCH 3/6] block/vmdk: Improve error messages on extent " Markus Armbruster
2024-05-13 14:23   ` Philippe Mathieu-Daudé
2024-05-13 14:17 ` [PATCH 4/6] cpus: Improve error messages on memsave, pmemsave " Markus Armbruster
2024-05-13 14:27   ` Philippe Mathieu-Daudé
2024-05-13 14:45     ` Markus Armbruster
2024-05-13 14:58       ` Philippe Mathieu-Daudé
2024-05-27 10:41         ` Markus Armbruster
2024-05-13 14:17 ` [PATCH 5/6] migration: Rephrase message on failure to save / load Xen device state Markus Armbruster
2024-05-13 14:24   ` Philippe Mathieu-Daudé
2024-05-13 18:07   ` Fabiano Rosas
2024-05-23 19:43   ` Peter Xu
2024-05-27 10:53     ` Markus Armbruster
2024-05-27 14:35       ` Peter Xu [this message]
2024-05-13 14:17 ` [PATCH 6/6] qerror: QERR_IO_ERROR is no longer used, drop Markus Armbruster
2024-05-13 14:28   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZlSaKHxJS7ZtMH0o@x1n \
    --to=peterx@redhat.com \
    --cc=armbru@redhat.com \
    --cc=fam@euphon.net \
    --cc=farosas@suse.de \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.