mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-virtio: Reset underlying device on driver request
If the driver triggers a reset by writing zero into the status register then reset the underlying device if supported. A device reset also requires resetting various aspects of the queue. In order to be able to do a subsequent reactivate it is required to reclaim certain resources (interrupt and queue EventFDs.) If a device reset is requested by the driver but the underlying device does not support it then generate an error as the driver would not be able to configure it anyway. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
040ea5432d
commit
3b2faa9f11
@@ -256,6 +256,12 @@ impl Queue {
|
||||
min(self.size, self.max_size)
|
||||
}
|
||||
|
||||
/// Reset the queue to a state that is acceptable for a device reset
|
||||
pub fn reset(&mut self) {
|
||||
self.ready = false;
|
||||
self.size = self.max_size;
|
||||
}
|
||||
|
||||
pub fn is_valid(&self, mem: &GuestMemoryMmap) -> bool {
|
||||
let queue_size = self.actual_size() as usize;
|
||||
let desc_table = self.desc_table;
|
||||
|
||||
Reference in New Issue
Block a user