mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-22 04:25:21 +00:00
virtio-devices: mem: Report error instead of panic
Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
parent
58066e2da4
commit
0235ed3388
@ -139,6 +139,8 @@ pub enum Error {
|
||||
NotActivatedByGuest,
|
||||
#[error("Unknown request type: {0}")]
|
||||
UnkownRequestType(u16),
|
||||
#[error("Failed adding used index: {0}")]
|
||||
QueueAddUsed(virtio_queue::Error),
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
@ -614,7 +616,7 @@ impl MemEpollHandler {
|
||||
let len = r.send_response(desc_chain.memory(), resp_type, resp_state)?;
|
||||
self.queue
|
||||
.add_used(desc_chain.memory(), desc_chain.head_index(), len)
|
||||
.unwrap();
|
||||
.map_err(Error::QueueAddUsed)?;
|
||||
used_descs = true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user