mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: console: Use 0 as the 'len' for the transmit queue
For a transmit queue (guest to host), the host only reads from the guest-provided buffers and does not write to them. According to the virtio specification (e.g., Section 2.6.8 in Virtio 1.1), the 'len' field in the used ring has to be set to the number of bytes written to the buffers. Therefore, it should be 0 for the console transmit queue. Signed-off-by: Andrei Vagin <avagin@google.com>
This commit is contained in:
@@ -265,7 +265,7 @@ impl ConsoleEpollHandler {
|
||||
out.flush().map_err(Error::OutputFlush)?;
|
||||
}
|
||||
trans_queue
|
||||
.add_used(desc_chain.memory(), desc_chain.head_index(), desc.len())
|
||||
.add_used(desc_chain.memory(), desc_chain.head_index(), 0)
|
||||
.map_err(Error::QueueAddUsed)?;
|
||||
used_descs = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user