From: Peter Xu <peterx@redhat.com>
To: Het Gala <het.gala@nutanix.com>
Cc: "Yu Zhang" <yu.zhang@ionos.com>,
"Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Fabiano Rosas" <farosas@suse.de>,
qemu-devel <qemu-devel@nongnu.org>,
"Jinpu Wang" <jinpu.wang@ionos.com>,
"Alexei Pastuchov" <alexei.pastuchov@ionos.com>,
"Elmar Gerdes" <elmar.gerdes@ionos.com>
Subject: Re: Problem with migration/rdma
Date: Mon, 11 Mar 2024 10:46:18 -0400 [thread overview]
Message-ID: <Ze8ZOnWad7_otUX-@x1n> (raw)
In-Reply-To: <a5d4b5fb-e3fa-44c9-b7fb-37c3d1ab2bb3@nutanix.com>
On Mon, Mar 11, 2024 at 08:00:06PM +0530, Het Gala wrote:
> Let me send a proper patch to qemu devel mailing list and cc all the people
> involved.
>
> I have reviewed and tested the change. Have tweaked the commit message
> accordingly.
> I hope that's okay with you Yu Zhang :)
Het - don't worry, I've had it in my queue. Thanks,
=====
From 694451b89b21b3b67c404cbcfa2b84e3afae0c5d Mon Sep 17 00:00:00 2001
From: Yu Zhang <yu.zhang@ionos.com>
Date: Wed, 6 Mar 2024 09:06:54 +0100
Subject: [PATCH] migration/rdma: Fix a memory issue for migration
In commit 3fa9642ff7 change was made to convert the RDMA backend to
accept MigrateAddress struct. However, the assignment of "host" leads
to data corruption on the target host and the failure of migration.
isock->host = rdma->host;
By allocating the memory explicitly for it with g_strdup_printf(), the
issue is fixed and the migration doesn't fail any more.
Fixes: 3fa9642ff7 ("migration: convert rdma backend to accept MigrateAddress")
Cc: qemu-stable <qemu-stable@nongnu.org>
Cc: Li Zhijian <lizhijian@fujitsu.com>
Link: https://lore.kernel.org/r/CAHEcVy4L_D6tuhJ8h=xLR4WaPaprJE3nnxZAEyUnoTrxQ6CF5w@mail.gmail.com
Signed-off-by: Yu Zhang <yu.zhang@ionos.com>
[peterx: use g_strdup() instead of g_strdup_printf(), per Zhijian]
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/rdma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/rdma.c b/migration/rdma.c
index a355dcea89..855753c671 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3357,7 +3357,7 @@ static int qemu_rdma_accept(RDMAContext *rdma)
goto err_rdma_dest_wait;
}
- isock->host = rdma->host;
+ isock->host = g_strdup(rdma->host);
isock->port = g_strdup_printf("%d", rdma->port);
/*
--
2.44.0
--
Peter Xu
next prev parent reply other threads:[~2024-03-11 14:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-05 21:32 Yu Zhang
2024-03-06 16:30 ` Problem with migration/rdma Philippe Mathieu-Daudé
2024-03-07 2:41 ` Zhijian Li (Fujitsu) via
2024-03-07 3:36 ` Peter Xu
2024-03-08 6:27 ` Yu Zhang
2024-03-08 6:55 ` Peter Xu
2024-03-08 7:03 ` Zhijian Li (Fujitsu) via
2024-03-08 7:14 ` Peter Xu
[not found] ` <CAOQbQt0+UbfZNPrticjLD4X+S2KR4r+yWPATnhEhTRuxbwvGiQ@mail.gmail.com>
[not found] ` <CAHEcVy78iCXVGmwr-2snpFwOyCxv3wxYrYJonK6nZF9UfbX_bw@mail.gmail.com>
2024-03-11 11:14 ` Yu Zhang
2024-03-11 14:30 ` Het Gala
2024-03-11 14:46 ` Peter Xu [this message]
2024-03-11 14:53 ` Het Gala
2024-03-11 15:16 ` Yu Zhang
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=Ze8ZOnWad7_otUX-@x1n \
--to=peterx@redhat.com \
--cc=alexei.pastuchov@ionos.com \
--cc=elmar.gerdes@ionos.com \
--cc=farosas@suse.de \
--cc=het.gala@nutanix.com \
--cc=jinpu.wang@ionos.com \
--cc=lizhijian@fujitsu.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=yu.zhang@ionos.com \
/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).