qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: Patch Tracking <patches@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Anthony Liguori <aliguori@amazon.com>
Subject: Re: [Qemu-devel] [PATCH] qemu-char: Convert socket char backend to parse/kind
Date: Mon, 30 Jun 2014 14:29:08 +0200	[thread overview]
Message-ID: <53B15814.5070106@redhat.com> (raw)
In-Reply-To: <1404125874.24066.20.camel@nilsson.home.kraxel.org>

Il 30/06/2014 12:57, Gerd Hoffmann ha scritto:
> On Mo, 2014-06-30 at 11:33 +0100, Peter Maydell wrote:
>> On 30 June 2014 11:23, Gerd Hoffmann <kraxel@redhat.com> wrote:
>>>   Hi,
>>>
>>>>>  * The old qemu_chr_open_socket() has an
>>>>>    "if (!is_waitconnect)
>>>>>        qemu_set_nonblock(fd);
>>>>>    which the QMP char-open codepath has never had. Does this matter?
>>>>>    Which of the two code paths was correct?
>>>>
>>>> Gerd?
>>>
>>> IIRC the socket is put into non-blocking mode anyway by the qemu socket
>>> helper functions.
>>
>> In that case is qemu_chr_open_socket_fd() incorrect
>> in marking the socket as nonblocking in the
>> is_listen && is_waitconnect case?

It's unnecessary.  tcp_chr_accept calls tcp_chr_add_client, which takes 
care of that.  But it doesn't hurt either.

> Honestly I think the whole waitconnect stuff should be ripped out.
> Obvious problem is backward compatibility.  But maybe not because nobody
> uses it anyway.  Anyone out there using chardev server sockets without
> 'nowait' option?
>
> waitconnect means "go into server mode, wait for a client to connect,
> then unpause the guest".  Which handles one special case of the generic
> "start qemu with -S, connect everything, then sent 'cont' to monitor"
> libvirt is doing.
>
> IIRC "wait for client to connect" is a blocking accept() call.  Which
> you certainly don't want do in a qmp command handler.

I agree you don't want to do it, but then... just don't do it. :)  We 
can leave in waitconnect, and leave it blocking.  QMP clients simply 
shouldn't use it, but if they do it's not our fault.

In fact, ChardevSocket.wait defaults to false (unlike the command-line 
counterpart).

Paolo

  parent reply	other threads:[~2014-06-30 12:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 20:55 [Qemu-devel] [PATCH] qemu-char: Convert socket char backend to parse/kind Peter Maydell
2014-06-23 12:49 ` Markus Armbruster
2014-06-23 13:05   ` Peter Maydell
2014-06-30 10:23   ` Gerd Hoffmann
2014-06-30 10:33     ` Peter Maydell
2014-06-30 10:57       ` Gerd Hoffmann
2014-06-30 11:31         ` Peter Maydell
2014-06-30 12:29         ` Paolo Bonzini [this message]
2014-06-30 12:33           ` Peter Maydell
2014-06-30 12:36             ` Paolo Bonzini

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=53B15814.5070106@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --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).