One limitation of virtio-mem is that we cannot currently unplug virtio-mem
devices that have all memory unplugged from the VM.

Let's properly handle forced unplug (as can be triggered by the VM) and
add support for ordinary unplug (requests) of virtio-mem devices that are
in a compatible state (no legacy mode, no plugged memory, no plug request).

Briefly tested on both, x86_64 and aarch64.

Cc: Peter Maydell <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Marcel Apfelbaum <[email protected]>
Cc: Igor Mammedov <[email protected]>
Cc: [email protected]
Cc: Gavin Shan <[email protected]>

David Hildenbrand (5):
  pc: Properly handle unplug of virtio based memory devices
  arm/virt: Properly handle unplug of virtio based memory devices
  virtio-mem: Prepare for unplug support of virtio-mem-pci devices
  pc: Support unplug of virtio-mem-pci devices
  arm/virt: Support unplug of virtio-mem-pci devices

 hw/arm/virt.c                  | 60 +++++++++++++++++++++++++++++--
 hw/i386/pc.c                   | 66 ++++++++++++++++++++++++++++++----
 hw/virtio/virtio-mem-pci.c     | 42 ++++++++++++++++++++--
 hw/virtio/virtio-mem-pci.h     |  2 ++
 hw/virtio/virtio-mem.c         | 24 +++++++++++++
 include/hw/virtio/virtio-mem.h |  2 ++
 6 files changed, 183 insertions(+), 13 deletions(-)

-- 
2.40.1


Reply via email to