From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [RESEND][PATCH] gdbstub: listen on ipv4 address
Date: Wed, 28 Jan 2009 10:38:58 +0000 [thread overview]
Message-ID: <20090128103858.GD1213@redhat.com> (raw)
In-Reply-To: <498021EE.5060801@siemens.com>
On Wed, Jan 28, 2009 at 10:14:22AM +0100, Jan Kiszka wrote:
> Anthony Liguori wrote:
> > Sebastian Herbszt wrote:
> >> Anthony Liguori wrote:
> >>> Sebastian Herbszt wrote:
> >>>> Make gdbstub listen on ipv4 address like before r5697.
> >>>
> >>> Any reason to make it explicit?
> >>
> >> There seems to be no support for IPv6 in gdb.
> >
> > Are you unable to connect without the ipv4 option? My understanding was
> > that we shouldn't explicitly need this option.
>
> inet_listen (which is finally called for this) falls back to PF_UNSPEC
> when no protocol is given. I'm not sure if we can expect (according to
> specs) that all our host OSes pick the protocol we want (normally IPv4).
There are three scenarios you need to consider wrt command line
args for TCP
- IP address - the parser determines whether it IPv4 or V6
address and asets PF_INET / PF_INET6 as needed
- Hostname - with PF_UNSPEC, and AI_ADDRCONFIG, getaddrinfo()
will resolve the name, and return zero or more IP addresses.
An IPv6 address is only returned if a NIC has IPv6 enabled.
An IPv4 address is only returned if a NIC has IPv4 enabled.
QEMU listens on the first address it gets
If an IPv6 address is returned, QEMU *disables* IPV6_V6ONLY
socket option, so the kernel also accepts IPv4 connections
on the IPv6 socket.
- No hostname - with PF_UNSPEC, and AI_ADDRCONFIG, getaddrinf()
will return the 0.0.0.0 or :: depending on whether the host
has IPv6 enabled on any NICs. Again QEMU disables IPV6_V6ONLY
to ensure IPv4 connections can be accepted over the IPv6 socket
Finally the ipv4/v6 command line flags in QEMU can override
the normal getaddrinfo() config.
The GDB stub current code should be hitting scenario 3, and thus QEMU
should be listening on both IPv4 and IPv6 ports.
If everything is working as I describe above, we should not need any
special case to force disable IPv6 for GDB stub, even if GDB itself is
IPv4 only - we always listen on IPv4 address even if we're also listening
on IPv6, unless the command line explicitly has the ',ipv6' flag provided.
If this isn't working, then perhaps our call to disable the IPV6_V6ONLY
socket option is not working correctly on some OS ?
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 :|
next prev parent reply other threads:[~2009-01-28 10:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-26 20:24 [Qemu-devel] [RESEND][PATCH] gdbstub: listen on ipv4 address Sebastian Herbszt
2009-01-26 22:11 ` Anthony Liguori
2009-01-27 22:32 ` [Qemu-devel] " Sebastian Herbszt
2009-01-27 22:57 ` Anthony Liguori
2009-01-28 9:14 ` Jan Kiszka
2009-01-28 10:38 ` Daniel P. Berrange [this message]
2009-01-28 12:04 ` Jan Kiszka
2009-01-28 16:39 ` Jamie Lokier
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=20090128103858.GD1213@redhat.com \
--to=berrange@redhat.com \
--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).