mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Make reset() best-effort on backend failures
The virtio specification treats reset as the recovery operation and so must take the device back to a fresh state, and the driver waits for the status read-back to converge before continuing. There is no defined way for the device to report a reset failure to the driver. Previously the implementations of reset() would return early and not complete all their cleanup leaving them in an inconsistent state. Now log errors and continue through the execution. Signed-off-by: Rob Bradford <rbradford@meta.com> Assisted-by: Claude:claude-opus-4-7
This commit is contained in:
@@ -451,9 +451,10 @@ impl VirtioDevice for Vdpa {
|
||||
}
|
||||
|
||||
fn reset(&mut self) -> Option<Arc<dyn VirtioInterrupt>> {
|
||||
// Backend reset failures are logged but don't skip local cleanup:
|
||||
// reset must converge to fresh state regardless of backend state.
|
||||
if let Err(e) = self.reset_vdpa() {
|
||||
error!("Failed to reset vhost-vdpa: {e:?}");
|
||||
return None;
|
||||
}
|
||||
|
||||
event!("vdpa", "reset", "id", &self.id);
|
||||
|
||||
Reference in New Issue
Block a user