qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, Umair_Sair@mentor.com
Subject: Re: [Qemu-devel] [PATCH] qemu-sockets: fix conversion of ipv4/ipv6 JSON to QemuOpts
Date: Mon, 12 Oct 2015 14:48:39 +0100	[thread overview]
Message-ID: <20151012134839.GN21855@redhat.com> (raw)
In-Reply-To: <1444656941-17038-1-git-send-email-pbonzini@redhat.com>

On Mon, Oct 12, 2015 at 03:35:41PM +0200, Paolo Bonzini wrote:
> The QemuOpts-based code treats "option not set" and "option set
> to false" the same way for the ipv4 and ipv6 options, because it
> is meant to handle only the ",ipv4" and ",ipv6" substrings in
> hand-crafted option parsers.
> 
> When converting InetSocketAddress to QemuOpts, however, it is
> necessary to handle all three cases (not set, set to true, set
> to false).  Currently we are not handling all cases correctly.
> The rules are:
> 
> * if none or both options are absent, leave things as is
> 
> * if the single present option is Y, the other should be N.
> This can be implemented by leaving things as is, or by setting
> the other option to N as done in this patch.
> 
> * if the single present option is N, the other should be Y.
> This is handled by the "else if" branch of this patch.
> 
> This ensures that the ipv4 option has an effect on Windows,
> where creating the socket with PF_UNSPEC makes an ipv6
> socket.  With this patch, ",ipv4" will result in a PF_INET
> socket instead.
> 
> Reported-by: Sair, Umair <Umair_Sair@mentor.com>
> Tested-by: Sair, Umair <Umair_Sair@mentor.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  util/qemu-sockets.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

I look forward to formally submitting the remainder of my patches to kill
off QemuOpts from this qemu-sockets.c code :-)

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 :|

      reply	other threads:[~2015-10-12 13:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 13:35 [Qemu-devel] [PATCH] qemu-sockets: fix conversion of ipv4/ipv6 JSON to QemuOpts Paolo Bonzini
2015-10-12 13:48 ` Daniel P. Berrange [this message]

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=20151012134839.GN21855@redhat.com \
    --to=berrange@redhat.com \
    --cc=Umair_Sair@mentor.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 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).