[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-discuss] TCP options ipv4 and ipv6 have no effect

From: Sair, Umair
Subject: [Qemu-discuss] TCP options ipv4 and ipv6 have no effect
Date: Fri, 2 Oct 2015 16:54:53 +0000



I am working with qemu-2.4.0. I built it using mingw on Windows. I am having a problem while connecting it to gdb. I figured out that qemu gdb server is running on IPv6 whereas gdb tries to connect on IPv4. This problem is already reported here: https://bugs.launchpad.net/qemu/+bug/562107.


gdd server runs on IPv6 even if I provide ipv4 tcp option (-S -gdb tcp::10000,ipv4). In other words, providing ipv4 or ipv6 option have no effect on both windows and linux. On linux it always runs on IPv4 and on Windows, it always runs on IPv6. Can you please help me out in resolving this problem?


I debugged qemu a bit and it seems to me that the problem is in ‘inet_addr_to_opts()’ function of ‘qemu-sockets.c’. Following is the excerpt from this function:


static void inet_addr_to_opts(QemuOpts *opts, const InetSocketAddress *addr)


    bool ipv4 = addr->ipv4 || !addr->has_ipv4;

    bool ipv6 = addr->ipv6 || !addr->has_ipv6;


    if (!ipv4 || !ipv6) {

        qemu_opt_set_bool(opts, "ipv4", ipv4);

        qemu_opt_set_bool(opts, "ipv6", ipv6);




The ipv4 and ipv6 variables of this function are always true (because we set addr->ipv4 = addr->has_ipv4 and addr->ipv6 = addr->has_ipv6), hence ipv4 and ipv6 option is never set in the if condition. The consequence is that the socket is created with PF_UNSPEC and then for windows IPv6 and for linux IPv4 socket is created (see inet_listen_opts() in qemu-sockets.c). Is there a particular reason for the logic of inet_addr_to_opts()?



Umair Sair


reply via email to

[Prev in Thread] Current Thread [Next in Thread]