qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 1/1] chardev: convert the socket server to QIONetListener
Date: Wed, 20 Dec 2017 17:23:17 +0100	[thread overview]
Message-ID: <f2953a7c-a107-4b42-527e-05e708f1fffd@redhat.com> (raw)
In-Reply-To: <b38ef134-69ac-5b90-adb4-6a38190d2dcf@redhat.com>

On 19/12/2017 09:48, Paolo Bonzini wrote:
> On 18/12/2017 14:54, Daniel P. Berrange wrote:
>> Instead of creating a QIOChannelSocket directly for the chardev
>> server socket, use a QIONetListener. This provides the ability
>> to listen on multiple sockets at the same time, so enables
>> full support for IPv4/IPv6 dual stack.
>>
>> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
>> ---
>>  chardev/char-socket.c | 72 +++++++++++++++++++++------------------------------
>>  1 file changed, 29 insertions(+), 43 deletions(-)
> 
> Queued, thanks.

I think this has to be squashed in to avoid use-after-free issues left and right
(visible with test-hmp):

diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 2d2252a..630a7f2 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -930,6 +930,7 @@ static void qmp_chardev_open_socket(Chardev *chr,
 
             if (qio_net_listener_open_sync(s->listener, s->addr, errp) < 0) {
                 object_unref(OBJECT(s->listener));
+                s->listener = NULL;
                 goto error;
             }
 

Paolo

> 
> As a follow-up, it's probably worth creating two new functions for
> respectively tcp_chr_set_client_ioc_name+tcp_chr_new_client and
> tcp_chr_set_client_ioc_name+qio_channel_socket_connect_async
> (with tcp_chr_set_client_ioc_name inlined).
> 
> Paolo
> 

  reply	other threads:[~2017-12-20 16:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 13:54 [Qemu-devel] [PATCH v2 0/1] Enable full IPv4/IPv6 dual stack support in chardevs Daniel P. Berrange
2017-12-18 13:54 ` [Qemu-devel] [PATCH v2 1/1] chardev: convert the socket server to QIONetListener Daniel P. Berrange
2017-12-19  8:48   ` Paolo Bonzini
2017-12-20 16:23     ` Paolo Bonzini [this message]
2017-12-20 16:25       ` Daniel P. Berrange

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=f2953a7c-a107-4b42-527e-05e708f1fffd@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@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).