mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
virtio-mem: Prepare for device unplug support
In many cases, blindly unplugging a virtio-mem device is problematic. We can only safely remove a device once: * The guest is not expecting to be able to read unplugged memory (unplugged-inaccessible == on) * The virtio-mem device does not have memory plugged (size == 0) * The virtio-mem device does not have outstanding requests to the VM to plug memory (requested-size == 0) So let's add a callback to the virtio-mem device class to check for that. We'll wire-up virtio-mem-pci next. Message-ID: <20230711153445.514112-7-david@redhat.com> Tested-by: Mario Casquero <mcasquer@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com>
This commit is contained in:
parent
aac44204bc
commit
92a8ee1b59
2 changed files with 26 additions and 0 deletions
|
@ -98,6 +98,7 @@ struct VirtIOMEMClass {
|
|||
MemoryRegion *(*get_memory_region)(VirtIOMEM *vmem, Error **errp);
|
||||
void (*add_size_change_notifier)(VirtIOMEM *vmem, Notifier *notifier);
|
||||
void (*remove_size_change_notifier)(VirtIOMEM *vmem, Notifier *notifier);
|
||||
void (*unplug_request_check)(VirtIOMEM *vmem, Error **errp);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue