From 49156c720ce11a2db3c334bc5e63bf3202ef23b9 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Sat, 7 Mar 2026 01:24:32 +0000 Subject: [PATCH] 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 --- virtio-devices/src/console.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtio-devices/src/console.rs b/virtio-devices/src/console.rs index fc715eaac..5430673e7 100644 --- a/virtio-devices/src/console.rs +++ b/virtio-devices/src/console.rs @@ -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; }