Skip to content

Commit 3d6f04b

Browse files
committed
virtio: mem: Implement device reset
The virtio-mem device does not have any backend specific state that needs resetting so implement the method by simply returning true. Plugged memory regions remain intact. Signed-off-by: Ilias Stamatis <ilstam@amazon.com>
1 parent 2c56098 commit 3d6f04b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/vmm/src/devices/virtio/mem/device.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,14 @@ impl VirtioDevice for VirtioMem {
661661
}
662662

663663
fn _reset(&mut self) -> bool {
664-
false
664+
// Virtio spec, section 5.15.5.2:
665+
// The device MUST NOT change the state of memory blocks during device
666+
// reset. The device MUST NOT modify memory or memory properties of
667+
// plugged memory blocks during device reset.
668+
//
669+
// Note: the Linux virtio-mem driver does not support rebinding when
670+
// memory is plugged
671+
true
665672
}
666673

667674
fn activate(

0 commit comments

Comments
 (0)