On 2020/12/23 6:31, Michael S. Tsirkin wrote:
On Tue, Dec 22, 2020 at 12:29:09PM +0100, Cornelia Huck wrote:
Is there any reason why we need to infer the type of the request by
checking some lengths? Can't we just specify explicit flags for read
and write? What am I missing?
Point is descriptors already have flags for read/write.
If there is a read buffer and length > sizeof virtio_i2c_in_hdr then
we know it's a read request.
If there is a write buffer and length > sizeof virtio_i2c_out_hdr then
we know it's a write request.
If both then both.
All this is known before buffer itself is consumed, which is nice.
Putting this info in flags will duplicate info which is often
a source of errors.
Sent the v6 with field written/read removed.