mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Require at least one ready queue for activation
When a guest resets a device by writing status=0 and reinitializes without enabling queues before writing DRIVER_OK, the activation path would collect zero ready queues and treat that as a fatal error, killing the entire VMM process. The PCI transport now checks that at least one queue is ready before reporting that the device needs activation. This prevents a spurious activation attempt that would fatally fail when no queues are enabled. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
9a46affc33
commit
534aaaceb2
@@ -829,7 +829,9 @@ impl VirtioPciDevice {
|
||||
}
|
||||
|
||||
fn needs_activation(&self) -> bool {
|
||||
!self.device_activated.load(Ordering::SeqCst) && self.is_driver_ready()
|
||||
!self.device_activated.load(Ordering::SeqCst)
|
||||
&& self.is_driver_ready()
|
||||
&& self.queues.iter().any(|q| q.ready())
|
||||
}
|
||||
|
||||
pub fn dma_handler(&self) -> Option<&dyn ExternalDmaMapping> {
|
||||
|
||||
Reference in New Issue
Block a user