qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	elohimes@gmail.com, zhangyu31@baidu.com, xieyongji@baidu.com,
	"Jason Wang" <jasowang@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	lilin24@baidu.com, "Yury Kotov" <yury-kotov@yandex-team.ru>,
	"Coquelin, Maxime" <maxime.coquelin@redhat.com>,
	chaiwen@baidu.com, nixun@baidu.com
Subject: Re: [Qemu-devel] [PATCH v2 for-4.0 1/7] chardev: Add disconnected option for chardev socket
Date: Wed, 19 Dec 2018 17:09:09 +0000	[thread overview]
Message-ID: <20181219170909.GO20465@redhat.com> (raw)
In-Reply-To: <20181219114920-mutt-send-email-mst@kernel.org>

On Wed, Dec 19, 2018 at 11:50:38AM -0500, Michael S. Tsirkin wrote:
> On Wed, Dec 19, 2018 at 04:01:02PM +0000, Daniel P. Berrangé wrote:
> > On Wed, Dec 19, 2018 at 10:55:09AM -0500, Michael S. Tsirkin wrote:
> > > On Tue, Dec 18, 2018 at 04:09:19PM +0000, Daniel P. Berrangé wrote:
> > > > On Tue, Dec 18, 2018 at 11:02:46AM -0500, Michael S. Tsirkin wrote:
> > > > > On Tue, Dec 18, 2018 at 03:25:20PM +0000, Daniel P. Berrangé wrote:
> > > > > > On Tue, Dec 18, 2018 at 04:24:26PM +0400, Marc-André Lureau wrote:
> > > > > > > Hi
> > > > > > > 
> > > > > > > On Tue, Dec 18, 2018 at 2:01 PM <elohimes@gmail.com> wrote:
> > > > > > > >
> > > > > > > > From: Xie Yongji <xieyongji@baidu.com>
> > > > > > > >
> > > > > > > > New option "disconnected" is added to init the chardev socket
> > > > > > > > in disconnected state. Then we can use qemu_chr_fe_wait_connected()
> > > > > > > > to connect when necessary. Now it would be used for unix domain
> > > > > > > > socket of vhost-user-blk device to support reconnect.
> > > > > > > 
> > > > > > > What difference does that make if you wait for connection in
> > > > > > > qemu_chr_fe_wait_connected(), or during chardev setup?
> > > > > > > 
> > > > > > > "disconnected" is misleading, would it be possible to reuse
> > > > > > > "wait/nowait" instead?
> > > > > > 
> > > > > > Currently we default to doing a blocking connect in foreground,
> > > > > > except if reconnect is non-zero, in which case we do a connect
> > > > > > async in the background. This "disconnected" proposal effectively
> > > > > > does a blocking connect, but delayed to later in startup.
> > > > > > 
> > > > > > IOW, this could already be achieved if "reconnect" were set to
> > > > > > non-zero. If the usage doesn't want reconnect though, I tend
> > > > > > to agree that we should use the exisiting wait/nowait options
> > > > > > to let it be controlled. I don't see that this "disconnected"
> > > > > > option gives a compelling benefit over using wait/nowait.
> > > > > 
> > > > > So the tricky thing is that we can not expose the
> > > > > device to guest until we get a connection and can query
> > > > > it for the first time. After that is completed,
> > > > > we can reasonably support disconnected operation at least for net.
> > > > 
> > > > The device code would still use  qemu_chr_fe_wait_connected() in my proposal,
> > > > so that its no different to the situation with the proposed "disconnected"
> > > > flag.
> > > > 
> > > > Regards,
> > > > Daniel
> > > 
> > > I guess so, but wouldn't it be confusing to users that one says
> > > "nowait" and qemu still waits for a connection and does not
> > > run the VM? That's different from how nowait behaves normally.
> > 
> > Well "nowait" is only referring to the chardev behaviour which is
> > still an accurate description.
> 
> man page seems to say
> 
>            nowait specifies that QEMU should not block waiting
>            for a client to connect to a listening socket.
> 
> if we do wait for a client to connect then how is it accurate?

Well the manpage needs to be clarified that this applies to the
initialization of the chardev.  What a downstream objet/device
does with the chardev is outside the scope of chardev config
options.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

  reply	other threads:[~2018-12-19 17:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18  9:59 [Qemu-devel] [PATCH v2 for-4.0 0/7] vhost-user-blk: Add support for backend reconnecting elohimes
2018-12-18  9:59 ` [Qemu-devel] [PATCH v2 for-4.0 1/7] chardev: Add disconnected option for chardev socket elohimes
2018-12-18 12:24   ` Marc-André Lureau
2018-12-18 13:33     ` Yongji Xie
2018-12-18 15:25     ` Daniel P. Berrangé
2018-12-18 16:02       ` Michael S. Tsirkin
2018-12-18 16:09         ` Daniel P. Berrangé
2018-12-19  9:01           ` Yongji Xie
2018-12-19 15:55           ` Michael S. Tsirkin
2018-12-19 16:01             ` Daniel P. Berrangé
2018-12-19 16:50               ` Michael S. Tsirkin
2018-12-19 17:09                 ` Daniel P. Berrangé [this message]
2018-12-19 18:18                   ` Michael S. Tsirkin
2018-12-20  4:25             ` Yongji Xie
2018-12-18  9:59 ` [Qemu-devel] [PATCH v2 for-4.0 2/7] vhost-user: Support providing shared memory to backend elohimes
2018-12-18 14:25   ` Michael S. Tsirkin
2018-12-18 14:47     ` Yongji Xie
2018-12-18 14:57       ` Michael S. Tsirkin
2018-12-18 15:10         ` Yongji Xie
2018-12-18  9:59 ` [Qemu-devel] [PATCH v2 for-4.0 3/7] libvhost-user: Introduce vu_queue_map_desc() elohimes
2018-12-18  9:59 ` [Qemu-devel] [PATCH v2 for-4.0 4/7] libvhost-user: Support recording inflight I/O in shared memory elohimes
2018-12-18 10:00 ` [Qemu-devel] [PATCH v2 for-4.0 5/7] vhost-user-blk: Add support to provide shared memory to backend elohimes
2018-12-18 10:00 ` [Qemu-devel] [PATCH v2 for-4.0 6/7] vhost-user-blk: Add support to reconnect backend elohimes
2018-12-18 12:30   ` Yury Kotov
2018-12-18 14:16     ` Yongji Xie
2018-12-18 14:35       ` Yury Kotov
2018-12-18 14:59         ` Yongji Xie
2018-12-18 15:33           ` Yury Kotov
2018-12-19  8:42             ` Yongji Xie
2018-12-18 10:00 ` [Qemu-devel] [PATCH v2 for-4.0 7/7] contrib/vhost-user-blk: enable inflight I/O recording elohimes

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=20181219170909.GO20465@redhat.com \
    --to=berrange@redhat.com \
    --cc=chaiwen@baidu.com \
    --cc=elohimes@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=lilin24@baidu.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mst@redhat.com \
    --cc=nixun@baidu.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xieyongji@baidu.com \
    --cc=yury-kotov@yandex-team.ru \
    --cc=zhangyu31@baidu.com \
    /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).