hw/virtio/virtio-pmem: Replace impossible check by assertion
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 16 Oct 2023 15:00:53 +0000 (17:00 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 20 Oct 2023 12:46:07 +0000 (14:46 +0200)
commit184256d261cfc773360f14a80092ace5a716bb8f
tree6e01008f2fbf276cb8c982ce09d4ec670741a896
parent7892e7cd916436a763705ba627619ca96b140ed6
hw/virtio/virtio-pmem: Replace impossible check by assertion

The get_memory_region() handler is used when (un)plugging the
device, which can only occur *after* it is realized.

virtio_pmem_realize() ensure the instance can not be realized
without 'memdev'. Remove the superfluous check, replacing it
by an assertion.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-Id: <20231017140150.44995-2-philmd@linaro.org>
hw/virtio/virtio-pmem.c