From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P . Berrangé" <berrange@redhat.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
"Markus Armbruster" <armbru@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Juraj Marcin" <jmarcin@redhat.com>
Subject: Re: [PATCH for-11.0 v2 0/7] migration: Error reporting cleanups
Date: Wed, 3 Dec 2025 09:33:43 -0500 [thread overview]
Message-ID: <aTBKR-zsOltzi8hB@x1.local> (raw)
In-Reply-To: <20251201194510.1121221-1-peterx@redhat.com>
On Mon, Dec 01, 2025 at 02:45:03PM -0500, Peter Xu wrote:
> Based-on: <20251125070554.2256181-1-armbru@redhat.com>
>
> This series is based on Markus's recent fix:
>
> [PATCH] migration: Fix double-free on error path
> https://lore.kernel.org/r/20251125070554.2256181-1-armbru@redhat.com
>
> v2:
> - Added R-bs
> - Patch 1:
> - update commit message on s/accidentally merged/merged without proper
> review/ [Markus]
> - Patch 2:
> - Added a new follow up patch here from Markus to poison Error's autoptr
> - Patch 3:
> - Rename migration_connect_set_error to migration_connect_error_propagate
> [Markus]
> - Add comments in commit log for both migrate_connect() and the rename
> [Markus]
> - Patch 4:
> - Rename multifd_send_set_error to multifd_send_error_propagate [Markus]
> - Patch 6:
> - Make migrate_error_propagate() take MigrationState* as before [Markus]
> - Remove the one use case of g_clear_pointer() [Markus]
> - Touch up commit message for the change
>
> This series should address the issues discussed in this thread here:
>
> https://lore.kernel.org/r/871plmk1bc.fsf@pond.sub.org
>
> The problem is Error is not a good candidate of g_autoptr, however the
> cleanup function was merged without enough review. Luckily, we only have
> two users so far (after Markus's patch above lands). This series removes
> the last two in migration code and reverts the auto cleanup function for
> Error. Instead, poison the auto cleanup function.
>
> When at it, it'll also change migrate_set_error() to start taking ownership
> of errors, just like what most error APIs do. When at it, it is renamed to
> migrate_error_propagate() to imply migration version of error_propagate().
>
> Comments welcomed, thanks.
>
> Markus Armbruster (1):
> error: Poison g_autoptr(Error) to prevent its use
>
> Peter Xu (6):
> migration: Use explicit error_free() instead of g_autoptr
> Revert "error: define g_autoptr() cleanup function for the Error type"
> migration: Make migration_connect_set_error() own the error
> migration: Make multifd_send_set_error() own the error
> migration: Make multifd_recv_terminate_threads() own the error
> migration: Replace migrate_set_error() with migrate_error_propagate()
>
> include/qapi/error.h | 20 ++++++++++++-
> migration/migration.h | 2 +-
> migration/channel.c | 1 -
> migration/cpr-exec.c | 5 ++--
> migration/migration.c | 51 +++++++++++++++-----------------
> migration/multifd-device-state.c | 6 ++--
> migration/multifd.c | 30 +++++++++----------
> migration/postcopy-ram.c | 5 ++--
> migration/ram.c | 4 +--
> migration/savevm.c | 17 +++++------
> 10 files changed, 73 insertions(+), 68 deletions(-)
Thanks for the reviews, I queued all 8 patches for 11.0 (with small
tweaks per discussion).
--
Peter Xu
prev parent reply other threads:[~2025-12-03 14:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 19:45 [PATCH for-11.0 v2 0/7] migration: Error reporting cleanups Peter Xu
2025-12-01 19:45 ` [PATCH for-11.0 v2 1/7] migration: Use explicit error_free() instead of g_autoptr Peter Xu
2025-12-01 19:45 ` [PATCH for-11.0 v2 2/7] Revert "error: define g_autoptr() cleanup function for the Error type" Peter Xu
2025-12-02 7:53 ` Cédric Le Goater
2025-12-01 19:45 ` [PATCH for-11.0 v2 3/7] error: Poison g_autoptr(Error) to prevent its use Peter Xu
2025-12-01 19:45 ` [PATCH for-11.0 v2 4/7] migration: Make migration_connect_set_error() own the error Peter Xu
2025-12-02 11:42 ` Markus Armbruster
2025-12-01 19:45 ` [PATCH for-11.0 v2 5/7] migration: Make multifd_send_set_error() " Peter Xu
2025-12-01 19:45 ` [PATCH for-11.0 v2 6/7] migration: Make multifd_recv_terminate_threads() " Peter Xu
2025-12-02 11:44 ` Markus Armbruster
2025-12-01 19:45 ` [PATCH for-11.0 v2 7/7] migration: Replace migrate_set_error() with migrate_error_propagate() Peter Xu
2025-12-02 11:59 ` Markus Armbruster
2025-12-02 17:28 ` Peter Xu
2025-12-02 13:55 ` [PATCH for-11.0 v2 0/7] migration: Error reporting cleanups Fabiano Rosas
2025-12-02 17:47 ` Peter Xu
2025-12-02 17:53 ` [PATCH for-11.0 v2 8/7] migration: Use error_propagate() in migrate_error_propagate() Peter Xu
2025-12-03 7:38 ` Markus Armbruster
2025-12-03 14:33 ` Peter Xu [this message]
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=aTBKR-zsOltzi8hB@x1.local \
--to=peterx@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=farosas@suse.de \
--cc=jmarcin@redhat.com \
--cc=marcandre.lureau@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).