From 97e16f249f68f7c39a904539a23042598a9b5c9d Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 6 May 2026 14:16:59 +0100 Subject: [PATCH] virtio-devices: mem: Respond to unknown request types An unknown request type caused process_queue to return an error that killed the device thread. The request/response descriptors are already parsed at this point, so respond with VIRTIO_MEM_RESP_ERROR and continue processing. Signed-off-by: Rob Bradford Assisted-by: Claude:claude-opus-4-6 --- virtio-devices/src/mem.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/virtio-devices/src/mem.rs b/virtio-devices/src/mem.rs index 9f149deeb..06ecb3b7e 100644 --- a/virtio-devices/src/mem.rs +++ b/virtio-devices/src/mem.rs @@ -23,7 +23,7 @@ use std::{io, result}; use anyhow::anyhow; use event_monitor::event; -use log::{error, info}; +use log::{error, info, warn}; use seccompiler::SeccompAction; use serde::{Deserialize, Serialize}; use thiserror::Error; @@ -654,7 +654,8 @@ impl MemEpollHandler { VIRTIO_MEM_REQ_UNPLUG_ALL => (self.unplug_all(), 0u16), VIRTIO_MEM_REQ_STATE => self.state_request(r.req.addr, r.req.nb_blocks), _ => { - return Err(Error::UnknownRequestType(r.req.req_type)); + warn!("Unknown request type: {}", r.req.req_type); + (VIRTIO_MEM_RESP_ERROR, 0u16) } }; let len = r.send_response(desc_chain.memory(), resp_type, resp_state)?;