mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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 <rbradford@meta.com> Assisted-by: Claude:claude-opus-4-6
This commit is contained in:
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user