From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kvy8l-0004t0-HO for qemu-devel@nongnu.org; Fri, 31 Oct 2008 13:50:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kvy8h-0004oT-Py for qemu-devel@nongnu.org; Fri, 31 Oct 2008 13:50:31 -0400 Received: from [199.232.76.173] (port=44354 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kvy8h-0004oI-Je for qemu-devel@nongnu.org; Fri, 31 Oct 2008 13:50:27 -0400 Received: from mx1.redhat.com ([66.187.233.31]:47828) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kvy8h-0008Dv-50 for qemu-devel@nongnu.org; Fri, 31 Oct 2008 13:50:27 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m9VHoQvX029332 for ; Fri, 31 Oct 2008 13:50:26 -0400 Date: Fri, 31 Oct 2008 17:50:23 +0000 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [PATCH 2/4] sockets: helper functions for qemu. Message-ID: <20081031175023.GM29492@redhat.com> References: <1225457254-1000-1-git-send-email-kraxel@redhat.com> <1225457254-1000-3-git-send-email-kraxel@redhat.com> <490B424C.7060404@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <490B424C.7060404@codemonkey.ws> Reply-To: "Daniel P. Berrange" , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann On Fri, Oct 31, 2008 at 12:37:16PM -0500, Anthony Liguori wrote: > Gerd Hoffmann wrote: > >@@ -8280,6 +8281,9 @@ static void help(int exitcode) > > "-redir [tcp|udp]:host-port:[guest-host]:guest-port\n" > > " redirect TCP or UDP connections from host to > > guest [-net user]\n" > > #endif > >+ "-ipv4 Use IPv4 only.\n" > >+ "-ipv6 Use UPv6 only.\n" > >+ " By default qemu uses what is available on > >your machine.\n" > > "\n" > > "Linux boot specific:\n" > > "-kernel bzImage use 'bzImage' as kernel image\n" > >@@ -8386,6 +8390,8 @@ enum { > > QEMU_OPTION_bootp, > > QEMU_OPTION_smb, > > QEMU_OPTION_redir, > >+ QEMU_OPTION_ipv4, > >+ QEMU_OPTION_ipv6, > > > > QEMU_OPTION_kernel, > > QEMU_OPTION_append, > >@@ -8489,6 +8495,10 @@ static const QEMUOption qemu_options[] = { > > #endif > > { "redir", HAS_ARG, QEMU_OPTION_redir }, > > #endif > >+ { "4", 0, QEMU_OPTION_ipv4 }, > >+ { "6", 0, QEMU_OPTION_ipv6 }, > >+ { "ipv4", 0, QEMU_OPTION_ipv4 }, > >+ { "ipv6", 0, QEMU_OPTION_ipv6 }, > > I don't like the idea of aliasing these options. Please just stick with > one set of options. > > And do we really need to have options for this? Can't we just do the > right thing? I can't believe that every application has to have an ipv6 > switch to be ipv6 enabled. Gerd's patch does 'do the right thing' for 90% of people - it uses the AI_ADDRCONFIG flag. This means that the getaddrinfo() name lookup will only return an IPv6 address if there is at least one NIC with IPv6 configured, likewise only return an IPv4 address if there is at least one NIC with IPv4 configured. There are still times when it is desirable to restrict it to just IPv4 or just IPv6, regardless of your host NIC config - mostly when needing to interact with other broken apps which are not correctly IPv6 aware. Maybe it would be sufficient to just have it added as a flag to the arg in question though, eg -serial tcp:localhost:123,ipv4 rather than a global -ipv4 flag Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|