All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH 2/3] migration: Drop iochannel reference during snapshot setup
Date: Fri, 4 Sep 2026 09:54:17 -0400	[thread overview]
Message-ID: <aprNif-4MLKwW421@x1.local> (raw)
In-Reply-To: <20260903220523.2849019-3-farosas@suse.de>

On Thu, Sep 03, 2026 at 07:05:22PM -0300, Fabiano Rosas wrote:
> During migration there are usually two references to the iochannel,
> one from the channel creation itself and another from the ownership
> transfer into QEMUFile.
> 
> - The reference from the QEMUFile is decremented at qemu_fclose.
> 
> - The original reference is decremented at migration_connect_outgoing()
> for regular migration and not at all for snapshots.
> 
> The ide-test has recently added migration support and ASAN has
> flagged:
> 
> Indirect leak of 32 byte(s) in 1 object(s) allocated from:
>     #0 0x55ca12aac0b9 in realloc
>     #1 0x7fd97d7e5a05 in g_realloc
>     #3 0x7fd97d7c98c6 in g_hash_table_new_full
>     #4 0x55ca14e186f1 in object_initialize_with_type ../qom/object.c:506:23
>     #5 0x55ca14e1a590 in object_new_with_type ../qom/object.c:706:5
>     #6 0x55ca14e1a7e8 in object_new ../qom/object.c:722:12
>     #7 0x55ca12de896f in qio_channel_block_new ../migration/channel-block.c:32:29
>     #8 0x55ca12ec8f2d in qemu_fopen_bdrv ../migration/savevm.c:172:49
>     #9 0x55ca12ec8b42 in save_snapshot ../migration/savevm.c:3375:9
>     #10 0x55ca12ee18e3 in hmp_savevm ../migration/migration-hmp-cmds.c:497:5
> 
> Change qemu_fopen_bdrv() to drop the original reference once the
> QEMUFile has taken over the object. The xen code already does the
> same.
> 
> Signed-off-by: Fabiano Rosas <farosas@suse.de>

Reviewed-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu



  parent reply	other threads:[~2026-09-04 13:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 22:05 [PATCH 0/3] A few leak fixes for QTest Fabiano Rosas
2026-09-03 22:05 ` [PATCH 1/3] ahci: Fix leak of IRQState Fabiano Rosas
2026-09-03 23:06   ` Denis V. Lunev
2026-09-04  8:31   ` Peter Maydell
2026-09-04 11:01     ` Philippe Mathieu-Daudé
2026-09-03 22:05 ` [PATCH 2/3] migration: Drop iochannel reference during snapshot setup Fabiano Rosas
2026-09-04  6:25   ` Marc-André Lureau
2026-09-04 13:54   ` Peter Xu [this message]
2026-09-03 22:05 ` [PATCH 3/3] migration: Free the JSON writer during snapshots Fabiano Rosas
2026-09-04 12:09   ` Marc-André Lureau
2026-09-04 14:00     ` Peter Xu

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=aprNif-4MLKwW421@x1.local \
    --to=peterx@redhat.com \
    --cc=farosas@suse.de \
    --cc=qemu-devel@nongnu.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.