virtio-mem-pci: Device unplug support
authorDavid Hildenbrand <david@redhat.com>
Tue, 11 Jul 2023 15:34:45 +0000 (17:34 +0200)
committerDavid Hildenbrand <david@redhat.com>
Wed, 12 Jul 2023 07:27:32 +0000 (09:27 +0200)
commit339a8bbdfed910d0baa392c2071fd0e09b30aed9
treefb11786cf85a5174789f8e0749e2dd9e3d7742dc
parent92a8ee1b594244a82d4c955eab907034f8953f8b
virtio-mem-pci: Device unplug support

Let's support device unplug by forwarding the unplug_request_check()
callback to the virtio-mem device.

Further, disallow changing the requested-size once an unplug request is
pending.

Disallowing requested-size changes handles corner cases such as
(1) pausing the VM (2) requesting device unplug and (3) adjusting the
requested size. If the VM would plug memory (due to the requested size
change) before processing the unplug request, we would be in trouble.

Message-ID: <20230711153445.514112-8-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>
hw/virtio/virtio-mem-pci.c