Message ID | 20230926155925.1396309-3-marcandre.lureau@redhat.com |
---|---|
State | New |
Headers | show |
Series | RFC: migration: check required entries and sections are loaded | expand |
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 4577f3f5b3..7e77e66e99 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -2487,7 +2487,11 @@ static bool virtio_device_endian_needed(void *opaque) { VirtIODevice *vdev = opaque; - assert(vdev->device_endian != VIRTIO_DEVICE_ENDIAN_UNKNOWN); + /* On load, endian is UNKNOWN */ + if (vdev->device_endian == VIRTIO_DEVICE_ENDIAN_UNKNOWN) { + return false; + } + if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { return vdev->device_endian != virtio_default_endian(); }