From: "Michael S. Tsirkin" <mst@redhat.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] libvhost-user: implement VHOST_USER_PROTOCOL_F_KICK_CALL_MSGS
Date: Mon, 9 Sep 2019 11:45:28 -0400 [thread overview]
Message-ID: <20190909114358-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <f97477a5b16e69a4891c8da542f5002fe4cf2548.camel@sipsolutions.net>
On Mon, Sep 09, 2019 at 05:34:13PM +0200, Johannes Berg wrote:
> On Mon, 2019-09-09 at 17:26 +0200, Johannes Berg wrote:
> >
> > Maybe instead we should just add a "VHOST_USER_REPLY_ERROR" bit (e.g.
> > bit 4 after NEED_REPLY). Qemu in vhost_user_read_header() validates that
> > it received REPLY_MASK | VERSION, so it would reject the message at that
> > point.
> >
> > Another possibility would be to define the highest bit of the 'request'
> > field to indicate an error, so for GET_FEATURES we'd return the value
> > 0x80000000 | GET_FEATURES.
>
> However, one way or another, that basically leaves us with three
> different ways of indicating an error:
>
> 1) already defined errors in existing messages - we can't change them
> since those are handled at runtime now, e.g. VHOST_USER_POSTCOPY_END
> returns a u64 value with an error status, and current code cannot
> deal with an error flag in the 'request' or 'flags' field
> 2) F_REPLY_ACK errors to messages that do not specify a response at all
> 3) this new way of indicating an error back from messages that specify
> a response, but the response has no inherent way of returning an
> error
>
> To me that really feels a bit too complex from the spec POV. But I don't
> see a way to generalize this without another extension, and again the
> device cannot choose which extensions it supports since the master
> chooses them and just sets them.
>
> Perhaps I really should just stick a "g_assert()" into the code at that
> point,
There's the old way: close the socket.
This will make reads fail gracefully.
If we don't want complexity right now, I'd go with that.
> and have it crash, since it's likely that F_KICK_CALL_MSGS isn't
> even going to be implemented in qemu (unless it grows simulation support
> and then it'd all be conditional on some simulation command-line option)
>
>
>
> And actually ... you got the order wrong:
>
> > > Next command is GET_FEATURES. Return an error response from that
> > > and device init will fail.
>
> That's not the case. We *start* with GET_FEATURES, if that includes
> protocol features then we do GET_PROTOCOL_FEATURES next, and then we get
> the # of queues next ...
>
> Though the whole discussion pretty much applies equivalently to
> GET_QUEUES_NUM instead of GET_FEATURES.
>
> johannes
next prev parent reply other threads:[~2019-09-09 15:46 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-02 12:12 [Qemu-devel] [RFC] vhost-user simulation extension Johannes Berg
2019-09-02 12:12 ` [Qemu-devel] [RFC] docs: vhost-user: add in-band kick/call messages Johannes Berg
2019-09-05 20:28 ` Johannes Berg
2019-09-09 16:00 ` Stefan Hajnoczi
2019-09-09 17:34 ` Johannes Berg
2019-09-10 15:03 ` Stefan Hajnoczi
2019-09-10 15:14 ` Johannes Berg
2019-09-10 15:33 ` Michael S. Tsirkin
2019-09-10 15:34 ` Johannes Berg
2019-09-11 6:56 ` Stefan Hajnoczi
2019-09-11 7:35 ` Stefan Hajnoczi
2019-09-11 8:26 ` Johannes Berg
2019-09-11 15:17 ` Stefan Hajnoczi
2019-09-11 15:31 ` Stefan Hajnoczi
2019-09-11 15:36 ` Johannes Berg
2019-09-11 15:38 ` Johannes Berg
2019-09-12 12:22 ` Stefan Hajnoczi
2019-09-12 20:37 ` Johannes Berg
2019-09-06 12:13 ` [Qemu-devel] [RFC] libvhost-user: implement VHOST_USER_PROTOCOL_F_KICK_CALL_MSGS Johannes Berg
2019-09-06 14:22 ` Michael S. Tsirkin
2019-09-06 14:48 ` Johannes Berg
2019-09-06 15:12 ` Michael S. Tsirkin
2019-09-06 15:32 ` Johannes Berg
2019-09-08 13:13 ` Michael S. Tsirkin
2019-09-09 11:35 ` Johannes Berg
2019-09-09 12:41 ` Michael S. Tsirkin
2019-09-09 13:05 ` Johannes Berg
2019-09-09 13:48 ` Michael S. Tsirkin
2019-09-09 13:50 ` Johannes Berg
2019-09-09 14:59 ` Michael S. Tsirkin
2019-09-09 15:26 ` Johannes Berg
2019-09-09 15:34 ` Johannes Berg
2019-09-09 15:45 ` Michael S. Tsirkin [this message]
2019-09-09 15:47 ` Johannes Berg
2019-09-10 15:52 ` Johannes Berg
2019-09-11 9:16 ` Michael S. Tsirkin
2019-09-11 9:20 ` Johannes Berg
2019-09-11 9:54 ` Michael S. Tsirkin
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=20190909114358-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=johannes@sipsolutions.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.