From: Fabiano Rosas <farosas@suse.de>
To: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>,
peterx@redhat.com
Cc: vsementsov@yandex-team.ru,
"open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: Re: [PATCH v2 05/16] migration: vmstate_save/load_state(): stop tracing errors
Date: Fri, 27 Feb 2026 19:44:48 -0300 [thread overview]
Message-ID: <878qcdu7q7.fsf@suse.de> (raw)
In-Reply-To: <20260220210214.800050-6-vsementsov@yandex-team.ru>
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> writes:
> We duplicate some of errors by trace points. That doesn't make
> real sense: we report the error through errp, and stop migration,
> no reason to duplicate the reported error by trace points, making
> error path more complicated.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
> ---
> migration/trace-events | 5 ++---
> migration/vmstate.c | 14 ++++++--------
> 2 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/migration/trace-events b/migration/trace-events
> index 90629f828f..e864d19c55 100644
> --- a/migration/trace-events
> +++ b/migration/trace-events
> @@ -55,15 +55,14 @@ postcopy_pause_incoming_continued(void) ""
> postcopy_page_req_sync(void *host_addr) "sync page req %p"
>
> # vmstate.c
> -vmstate_load_field_error(const char *field, int ret) "field \"%s\" load failed, ret = %d"
> vmstate_load_state(const char *name, int version_id) "%s v%d"
> -vmstate_load_state_end(const char *name, const char *reason, int val) "%s %s/%d"
> +vmstate_load_state_end(const char *name) "%s"
> vmstate_load_state_field(const char *name, const char *field, bool exists) "%s:%s exists=%d"
> vmstate_n_elems(const char *name, int n_elems) "%s: %d"
> vmstate_subsection_load(const char *parent) "%s"
> vmstate_subsection_load_bad(const char *parent, const char *sub, const char *sub2) "%s: %s/%s"
> vmstate_subsection_load_good(const char *parent) "%s"
> -vmstate_save_state_pre_save_res(const char *name, int res) "%s/%d"
> +vmstate_save_state_pre_save_done(const char *name) "%s"
> vmstate_save_state_loop(const char *name, const char *field, int n_elems) "%s/%s[%d]"
> vmstate_save_state_top(const char *idstr) "%s"
> vmstate_subsection_save_loop(const char *name, const char *sub) "%s/%s"
> diff --git a/migration/vmstate.c b/migration/vmstate.c
> index dd7cd27993..b07bbdd366 100644
> --- a/migration/vmstate.c
> +++ b/migration/vmstate.c
> @@ -144,7 +144,6 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
> error_setg(errp, "%s: incoming version_id %d is too new "
> "for local version_id %d",
> vmsd->name, version_id, vmsd->version_id);
> - trace_vmstate_load_state_end(vmsd->name, "too new", -EINVAL);
> return -EINVAL;
> }
>
> @@ -152,7 +151,6 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
> error_setg(errp, "%s: incoming version_id %d is too old "
> "for local minimum version_id %d",
> vmsd->name, version_id, vmsd->minimum_version_id);
> - trace_vmstate_load_state_end(vmsd->name, "too old", -EINVAL);
> return -EINVAL;
> }
>
> @@ -245,7 +243,6 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
>
> if (ret < 0) {
> qemu_file_set_error(f, ret);
> - trace_vmstate_load_field_error(field->name, ret);
> return ret;
> }
> }
> @@ -269,7 +266,7 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
> error_prepend(errp, "post load hook failed for: %s, version_id: "
> "%d, minimum_version: %d: ", vmsd->name,
> vmsd->version_id, vmsd->minimum_version_id);
> - ret = -EINVAL;
> + return -EINVAL;
> }
> } else if (vmsd->post_load) {
> ret = vmsd->post_load(opaque, version_id);
> @@ -279,12 +276,13 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,
> "minimum_version: %d, ret: %d",
> vmsd->name, vmsd->version_id, vmsd->minimum_version_id,
> ret);
> + return ret;
> }
> }
>
> - trace_vmstate_load_state_end(vmsd->name, "end", ret);
> + trace_vmstate_load_state_end(vmsd->name);
>
> - return ret;
> + return 0;
> }
>
> static int vmfield_name_num(const VMStateField *start,
> @@ -444,20 +442,20 @@ static int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd,
>
> if (vmsd->pre_save_errp) {
> ret = vmsd->pre_save_errp(opaque, errp) ? 0 : -EINVAL;
> - trace_vmstate_save_state_pre_save_res(vmsd->name, ret);
> if (ret < 0) {
> error_prepend(errp, "pre-save for %s failed: ", vmsd->name);
> return ret;
> }
> } else if (vmsd->pre_save) {
> ret = vmsd->pre_save(opaque);
> - trace_vmstate_save_state_pre_save_res(vmsd->name, ret);
> if (ret) {
> error_setg(errp, "pre-save failed: %s", vmsd->name);
> return ret;
> }
> }
>
> + trace_vmstate_save_state_pre_save_done(vmsd->name);
> +
> if (vmdesc) {
> json_writer_str(vmdesc, "vmsd_name", vmsd->name);
> json_writer_int64(vmdesc, "version", version_id);
One benefit of the traces is to be able to match with source code when
debugging a QEMU instance that cannot be rebuilt. Not so much about the
trace itself, but to be able to know _where_ the code exited.
However, I have no preference.
Acked-by: Fabiano Rosas <farosas@suse.de>
next prev parent reply other threads:[~2026-02-27 22:45 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260220210214.800050-1-vsementsov@yandex-team.ru>
2026-02-20 21:01 ` [PATCH v2 01/16] migration: vmstate_save_state_v: fix double error_setg Vladimir Sementsov-Ogievskiy
2026-02-27 22:14 ` Fabiano Rosas
2026-03-03 14:30 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 02/16] migration: make vmstate_save_state_v() static Vladimir Sementsov-Ogievskiy
2026-02-27 22:15 ` Fabiano Rosas
2026-03-03 15:01 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 03/16] migration: make .post_save() a void function Vladimir Sementsov-Ogievskiy
2026-02-27 22:41 ` Fabiano Rosas
2026-02-27 23:56 ` Vladimir Sementsov-Ogievskiy
2026-03-03 15:05 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 04/16] migration: vmstate_load_state(): add some newlines Vladimir Sementsov-Ogievskiy
2026-02-27 22:41 ` Fabiano Rosas
2026-03-03 15:06 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 05/16] migration: vmstate_save/load_state(): stop tracing errors Vladimir Sementsov-Ogievskiy
2026-02-27 22:44 ` Fabiano Rosas [this message]
2026-03-03 15:13 ` Peter Xu
2026-03-04 16:10 ` Vladimir Sementsov-Ogievskiy
2026-02-20 21:02 ` [PATCH v2 06/16] migration: factor out vmstate_pre_save() from vmstate_save_state() Vladimir Sementsov-Ogievskiy
2026-03-03 15:22 ` Peter Xu
2026-03-04 16:27 ` Vladimir Sementsov-Ogievskiy
2026-03-04 16:42 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 07/16] migration: factor out vmstate_save_field() " Vladimir Sementsov-Ogievskiy
2026-03-03 15:38 ` Peter Xu
2026-03-04 17:22 ` Vladimir Sementsov-Ogievskiy
2026-02-20 21:02 ` [PATCH v2 08/16] migration: factor out vmstate_pre_load() from vmstate_load_state() Vladimir Sementsov-Ogievskiy
2026-03-03 16:11 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 09/16] migration: factor out vmstate_load_field() " Vladimir Sementsov-Ogievskiy
2026-03-03 16:14 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 10/16] migration: factor out vmstate_post_load() " Vladimir Sementsov-Ogievskiy
2026-03-03 16:16 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 11/16] migration: convert vmstate_subsection_save/load functions to bool Vladimir Sementsov-Ogievskiy
2026-03-03 16:17 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 12/16] migration: VMStateInfo: introduce new handlers with errp Vladimir Sementsov-Ogievskiy
2026-03-03 16:19 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 13/16] migration: introduce vmstate_load_vmsd() and vmstate_save_vmsd() Vladimir Sementsov-Ogievskiy
2026-03-03 16:22 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 14/16] migration/cpr: move to new migration APIs Vladimir Sementsov-Ogievskiy
2026-03-03 16:23 ` Peter Xu
2026-02-20 21:02 ` [PATCH v2 15/16] migration/savevm: " Vladimir Sementsov-Ogievskiy
2026-03-03 16:42 ` Peter Xu
2026-03-04 17:04 ` Vladimir Sementsov-Ogievskiy
2026-02-20 21:02 ` [PATCH v2 16/16] migration/vmstate-types: " Vladimir Sementsov-Ogievskiy
2026-03-03 16:56 ` Peter Xu
2026-03-04 17:38 ` Vladimir Sementsov-Ogievskiy
2026-03-04 18:20 ` Peter Xu
2026-03-04 19:15 ` Vladimir Sementsov-Ogievskiy
2026-03-04 19:20 ` Peter Xu
2026-03-04 20:06 ` Vladimir Sementsov-Ogievskiy
2026-03-04 21:53 ` Peter Xu
2026-02-20 21:05 ` [PATCH v2 00/16] migration: more bool+errp APIs Vladimir Sementsov-Ogievskiy
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=878qcdu7q7.fsf@suse.de \
--to=farosas@suse.de \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/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.