mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Remove panic when duplicating activate EventFds
Replace the (unlikely) panic when duplicating the EventFds with a propagated error. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -281,7 +281,7 @@ impl VirtioDevice for Blk {
|
||||
|
||||
// Run a dedicated thread for handling potential reconnections with
|
||||
// the backend.
|
||||
let (kill_evt, pause_evt) = self.vu_common.virtio_common.dup_eventfds();
|
||||
let (kill_evt, pause_evt) = self.vu_common.virtio_common.dup_eventfds()?;
|
||||
|
||||
let mut handler = self.vu_common.activate(
|
||||
mem,
|
||||
|
||||
@@ -255,7 +255,7 @@ impl VirtioDevice for Fs {
|
||||
let backend_req_handler: Option<FrontendReqHandler<BackendReqHandler>> = None;
|
||||
// Run a dedicated thread for handling potential reconnections with
|
||||
// the backend.
|
||||
let (kill_evt, pause_evt) = self.vu_common.virtio_common.dup_eventfds();
|
||||
let (kill_evt, pause_evt) = self.vu_common.virtio_common.dup_eventfds()?;
|
||||
|
||||
let mut handler = self.vu_common.activate(
|
||||
mem,
|
||||
|
||||
@@ -317,7 +317,7 @@ impl VirtioDevice for GenericVhostUser {
|
||||
|
||||
// Run a dedicated thread for handling potential reconnections with
|
||||
// the backend.
|
||||
let (kill_evt, pause_evt) = self.vu_common.virtio_common.dup_eventfds();
|
||||
let (kill_evt, pause_evt) = self.vu_common.virtio_common.dup_eventfds()?;
|
||||
|
||||
let mut handler = self.vu_common.activate(
|
||||
mem,
|
||||
|
||||
@@ -289,7 +289,7 @@ impl VirtioDevice for Net {
|
||||
|
||||
ctrl_queue.set_event_idx(event_idx);
|
||||
|
||||
let (kill_evt, pause_evt) = self.vu_common.virtio_common.dup_eventfds();
|
||||
let (kill_evt, pause_evt) = self.vu_common.virtio_common.dup_eventfds()?;
|
||||
|
||||
let mut ctrl_handler = NetCtrlEpollHandler {
|
||||
mem: mem.clone(),
|
||||
@@ -330,7 +330,7 @@ impl VirtioDevice for Net {
|
||||
|
||||
// Run a dedicated thread for handling potential reconnections with
|
||||
// the backend.
|
||||
let (kill_evt, pause_evt) = self.vu_common.virtio_common.dup_eventfds();
|
||||
let (kill_evt, pause_evt) = self.vu_common.virtio_common.dup_eventfds()?;
|
||||
|
||||
let mut handler = self.vu_common.activate(
|
||||
mem,
|
||||
|
||||
Reference in New Issue
Block a user