From: "Daniel P. Berrange" <berrange@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 3/5] sockets: remove use of QemuOpts from socket_connect
Date: Wed, 18 Nov 2015 10:10:55 +0000 [thread overview]
Message-ID: <20151118101055.GC27591@redhat.com> (raw)
In-Reply-To: <564BACFA.4070105@redhat.com>
On Tue, Nov 17, 2015 at 03:40:58PM -0700, Eric Blake wrote:
> On 11/17/2015 10:00 AM, Daniel P. Berrange wrote:
> > The socket_connect method accepts a QAPI SocketAddress object
> > which it then turns into QemuOpts before calling the
> > inet_connect_opts/unix_connect_opts helper methods. By
> > converting the latter to use QAPI SocketAddress directly,
> > the QemuOpts conversion step can be eliminated
> >
> > This also fixes the problem where ipv4=off && ipv6=off
> > would be treated the same as ipv4=on && ipv6=on
> >
> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> > ---
> > util/qemu-sockets.c | 91 +++++++++++++++++++++--------------------------------
> > 1 file changed, 36 insertions(+), 55 deletions(-)
> >
>
> > ai.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ADDRCONFIG;
> > - ai.ai_family = PF_UNSPEC;
> > + ai.ai_family = inet_ai_family_from_address(saddr, &err);
> > ai.ai_socktype = SOCK_STREAM;
> >
>
> >
> > - if (qemu_opt_get_bool(opts, "ipv4", 0)) {
> > - ai.ai_family = PF_INET;
> > - }
> > - if (qemu_opt_get_bool(opts, "ipv6", 0)) {
> > - ai.ai_family = PF_INET6;
>
> I'm using the notation you used in 2/5, where - is unspecified, f is
> explicitly false, and t is explicitly true. qemu_opt_get_bool(, 0)
> cannot tell the difference between - and f.
>
> The old code treated 4=- and 6=- as PF_UNSPEC; 4=f and 6=f as PF_UNSPEC,
> and 4=t and 6=t as PF_INET6. That doesn't quite jive with the commit
> message claiming that 4=off (is that '4=-' or '4=f'?) and 6=off was the
> same as 4=on (4=t) and 6=on.
Yeah that commit message is wrong - i'll remove that bit
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next prev parent reply other threads:[~2015-11-18 10:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 17:00 [Qemu-devel] [PATCH v2 0/5] Convert qemu-socket to use QAPI exclusively Daniel P. Berrange
2015-11-17 17:00 ` [Qemu-devel] [PATCH v2 1/5] sockets: remove use of QemuOpts from header file Daniel P. Berrange
2015-11-17 17:00 ` [Qemu-devel] [PATCH v2 2/5] sockets: remove use of QemuOpts from socket_listen Daniel P. Berrange
2015-11-17 22:22 ` Eric Blake
2015-11-18 10:08 ` Daniel P. Berrange
2015-11-18 15:44 ` Eric Blake
2015-11-18 15:53 ` Daniel P. Berrange
2015-11-17 17:00 ` [Qemu-devel] [PATCH v2 3/5] sockets: remove use of QemuOpts from socket_connect Daniel P. Berrange
2015-11-17 22:40 ` Eric Blake
2015-11-18 10:10 ` Daniel P. Berrange [this message]
2015-11-17 17:00 ` [Qemu-devel] [PATCH v2 4/5] sockets: remove use of QemuOpts from socket_dgram Daniel P. Berrange
2015-11-18 0:10 ` Eric Blake
2015-11-17 17:00 ` [Qemu-devel] [PATCH v2 5/5] vnc: distiguish between ipv4/ipv6 omitted vs set to off Daniel P. Berrange
2015-11-18 0:12 ` Eric Blake
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=20151118101055.GC27591@redhat.com \
--to=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.