OSDN Git Service

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>
Thu, 19 Oct 2023 21:13:28 +0000 (23:13 +0200)
commit5960f254dbb46f0c7a9f5f44bf4d27c19c34cb97
tree04e43e7a1612e5f75604a6f2280fefc9e339108d
parent840b4495ef5c2d90d75f3f0d00d9018146f27d8e
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