From: Amit Shah <amit.shah@redhat.com>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: Anthony Liguori <aliguori@linux.vnet.ibm.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
Adam Litke <agl@us.ibm.com>
Subject: [Qemu-devel] Re: virtio-serial semantics for binary data and guest agents
Date: Wed, 23 Feb 2011 10:29:44 +0530 [thread overview]
Message-ID: <20110223045944.GA9886@amit-x200.redhat.com> (raw)
In-Reply-To: <4D643B77.60109@linux.vnet.ibm.com>
On (Tue) 22 Feb 2011 [16:40:55], Michael Roth wrote:
> If something in the guest is attempting to read/write from the
> virtio-serial device, and nothing is connected to virtio-serial's
> host character device (say, a socket)
>
> 1. writes will block until something connect()s, at which point the
> write will succeed
>
> 2. reads will always return 0 until something connect()s, at which
> point the reads will block until there's data
>
> This makes it difficult (impossible?) to implement the notion of
> connect/disconnect or open/close over virtio-serial without layering
> another protocol on top using hackish things like length-encoded
> payloads or sentinel values to determine the end of one
> RPC/request/response/session and the start of the next.
>
> For instance, if the host side disconnects, then reconnects before
> we read(), we may never get the read()=0, and our FD remains valid.
> Whereas with a tcp/unix socket our FD is no longer valid, and the
> read()=0 is an event we can check for at any point after the other
> end does a close/disconnect.
There's SIGIO support, so host connect-disconnect notifications can be
caught via the signal.
Also, nonblocking reads/writes will return -EPIPE if the host-side
connection is not up.
Amit
next prev parent reply other threads:[~2011-02-23 5:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-22 22:40 [Qemu-devel] virtio-serial semantics for binary data and guest agents Michael Roth
2011-02-22 23:09 ` [Qemu-devel] " Anthony Liguori
2011-02-23 4:59 ` Amit Shah [this message]
2011-02-23 14:31 ` Michael Roth
2011-02-23 14:36 ` Michael Roth
2011-02-24 12:48 ` Amit Shah
2011-02-24 14:44 ` Anthony Liguori
2011-02-28 12:21 ` Amit Shah
2011-02-25 20:25 ` Michael Roth
2011-03-01 6:17 ` Amit Shah
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=20110223045944.GA9886@amit-x200.redhat.com \
--to=amit.shah@redhat.com \
--cc=agl@us.ibm.com \
--cc=aliguori@linux.vnet.ibm.com \
--cc=mdroth@linux.vnet.ibm.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).