qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* (no subject)
@ 2024-03-05 21:32 Yu Zhang
  2024-03-06 16:30 ` Problem with migration/rdma Philippe Mathieu-Daudé
  0 siblings, 1 reply; 13+ messages in thread
From: Yu Zhang @ 2024-03-05 21:32 UTC (permalink / raw)
  To: Het Gala, qemu-devel; +Cc: Jinpu Wang, Alexei Pastuchov, Elmar Gerdes

Hello Het and all,

while I was testing qemu-8.2, I saw a lot of our migration test cases failed.
After debugging the commits of the 8.2 branch, I saw the issue and mad a diff:

diff --git a/migration/rdma.c b/migration/rdma.c
index 6a29e53daf..f10d56f556 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3353,9 +3353,9 @@ static int qemu_rdma_accept(RDMAContext *rdma)
         goto err_rdma_dest_wait;
     }

-    isock->host = rdma->host;
+    isock->host = g_strdup_printf("%s", rdma->host);
     isock->port = g_strdup_printf("%d", rdma->port);

which was introduced by the commit below:

commit 3fa9642ff7d51f7fc3ba68e6ccd13a939d5bd609 (HEAD)
Author: Het Gala <het.gala@nutanix.com>
Date:   Mon Oct 23 15:20:45 2023 -0300

    migration: convert rdma backend to accept MigrateAddress

    RDMA based transport backend for 'migrate'/'migrate-incoming' QAPIs
    accept new wire protocol of MigrateAddress struct.

    It is achived by parsing 'uri' string and storing migration parameters
    required for RDMA connection into well defined InetSocketAddress struct.
    ...

A debug line
     isock->host = rdma->host;
     isock->port = g_strdup_printf("%d", rdma->port);
+fprintf(stdout, "QEMU: %s, host %s, port %s\n", __func__,
isock->host, isock->port);

produced this error:
QEMU: qemu_rdma_accept, host ::, port 8089
corrupted size vs. prev_size in fastbins

on the target host, which may indicate a crash related to the memory
allocation or a memory
corruption of the data. With the patch, it doesn't happen any more,
and the migration is fine.
Could you be kind to test this and confirm the issue?

Furthermore, I'm confused by the two struct:

struct InetSocketAddressBase {
    char *host;
    char *port;
};

struct InetSocketAddress {
    /* Members inherited from InetSocketAddressBase: */
    char *host;
    char *port;

To my understanding, they are used to consolidate the separated data
to a well-defined
struct "MigrateAddress", while the struct whose member receive their
data has a different type:

typedef struct RDMAContext {
    char *host;
    int port;
    ...
}

Is there any reason to keep "port" like this (char* instead of int) or
can we improve it?
Thank you so much for any of your comments!

Best regards,

Yu Zhang @ IONOS Compute Platform
05.03.2024


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-03-11 15:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-03-11 14:53                   ` Het Gala
2024-03-11 15:16                     ` Yu Zhang

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).