From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, "Daniel P . Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH v2 1/2] migration: Fix iocs leaks during file and fd migration
Date: Thu, 14 Mar 2024 11:10:52 -0400 [thread overview]
Message-ID: <ZfMTfAXRDT7WsgtV@x1n> (raw)
In-Reply-To: <20240313212824.16974-2-farosas@suse.de>
On Wed, Mar 13, 2024 at 06:28:23PM -0300, Fabiano Rosas wrote:
> The memory for the io channels is being leaked in three different ways
> during file migration:
>
> 1) if the offset check fails we never drop the ioc reference;
>
> 2) we allocate an extra channel for no reason;
>
> 3) if multifd is enabled but channel creation fails when calling
> dup(), we leave the previous channels around along with the glib
> polling;
>
> Fix all issues by restructuring the code to first allocate the
> channels and only register the watches when all channels have been
> created.
>
> For multifd, the file and fd migrations can share code because both
> are backed by a QIOChannelFile. For the non-multifd case, the fd needs
> to be separate because it is backed by a QIOChannelSocket.
>
> Fixes: 2dd7ee7a51 ("migration/multifd: Add incoming QIOChannelFile support")
> Fixes: decdc76772 ("migration/multifd: Add mapped-ram support to fd: URI")
> Reported-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
--
Peter Xu
next prev parent reply other threads:[~2024-03-14 15:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-13 21:28 [PATCH v2 0/2] migration mapped-ram fixes Fabiano Rosas
2024-03-13 21:28 ` [PATCH v2 1/2] migration: Fix iocs leaks during file and fd migration Fabiano Rosas
2024-03-14 15:10 ` Peter Xu [this message]
2024-03-13 21:28 ` [PATCH v2 2/2] migration/multifd: Ensure we're not given a socket for file migration Fabiano Rosas
2024-03-14 15:10 ` Peter Xu
2024-03-14 15:43 ` Peter Xu
2024-03-14 16:50 ` Fabiano Rosas
2024-03-14 17:58 ` Peter Xu
2024-03-14 16:44 ` Fabiano Rosas
2024-03-14 17:53 ` Peter Xu
2024-03-14 15:22 ` [PATCH v2 0/2] migration mapped-ram fixes Peter Xu
2024-03-14 16:55 ` Fabiano Rosas
2024-03-14 17:35 ` Peter Xu
2024-03-14 18: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=ZfMTfAXRDT7WsgtV@x1n \
--to=peterx@redhat.com \
--cc=berrange@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 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).