qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 05/11] vhost-user: add vhost_user_gpu_set_soc


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH v6 05/11] vhost-user: add vhost_user_gpu_set_socket()
Date: Mon, 29 Apr 2019 09:12:43 +0200
User-agent: NeoMutt/20180716

  Hi,

> > What questions for example?
> 
> This opens up different kind of possible replies, and error handling.
> 
> With current proposal and needs, the reply (or absence of reply) is
> entirely driven by the request.
> 
> With your proposal, should all request have a reply?

Yes.

> which makes a lot
> more code synchronous,

Why?  You don't have to wait for the reply before sending the next
request.

Adding a request id to the messages might be useful, so it is possible
to wait for a reply to a specific message without having to keeping
track of all in-flight messages.

> and complicates both sides unnecessarily.

Having headers in the reply allows it to process them in generic code.
There is a size header for the reply, so you can parse the stream
without knowing what replay to expect.  You can use the status field to
indicate the payload, simliar to virtio-gpu which has response code
OK_NODATA, some OK_$whatpayload and some ERR_$failure codes.

You can dispatch based on the response/status code and run *fully*
asynchronous without too much trouble.

> > > Can we leave that for future protocol extensions negotiated with
> > > GET/SET_PROTOCOL_FEATURES ?
> >
> > I don't think negotiating such a basic protocol change is a good idea.
> 
> Well, then I would rather focus on improving protocol negociation,
> rather than adding unnecessary protocol changes.
> 
> Given that GET/SET_PROTOCOL_FEATURES is the first messages being sent,
> why couldn't it have flags indicating new protocol revision?

A properly structed reply allows a different approach in reply
processing (see above).  But that only works if it is in the protocol
right from the start.  As add-on feature it can't provide the benefits
because the reply parser must be able to handle both protocol variants.

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]