On Wed, Aug 1, 2012 at 5:54 AM, Benjamin Herrenschmidt
<b...@kernel.crashing.org> wrote:
> However, virtio_blk_req_complete() does:
>
>     virtqueue_push(s->vq, &req->elem, req->qiov.size + sizeof(*req->in));
>
> So it pushes into the queue req->qiov.size (which is 0) + sizeof(*req->in)
> which is as far as I can tell ... 16.
>
> So we don't push enough bytes out basically for the full 20 bytes allowed
> for the ID.
>
> Or am I missing something ?

The len field is mostly informational.  The virtio device driver
inside the guest may make use of it.  In many cases it doesn't so an
incorrect len value has no effect.  In
drivers/block/virtio_blk.c:blk_done() the len variable is unused.

QEMU should call cpu_physical_memory_unmap() with the correct size
value in hw/virtio.c:virtqueue_fill() so that the memory dirty bitmap
is kept up-to-date.  This is the only bad side-effect I can see here.

Stefan

Reply via email to