[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/5] virtio: make endian_needed() work during loading
From: |
marcandre . lureau |
Subject: |
[PATCH 2/5] virtio: make endian_needed() work during loading |
Date: |
Tue, 26 Sep 2023 19:59:22 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
There is no simple way to distinguish when the callback is used for load
or save, AFAICT.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/virtio/virtio.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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();
}
--
2.41.0
- [PATCH 0/5] RFC: migration: check required entries and sections are loaded, marcandre . lureau, 2023/09/26
- [PATCH 1/5] block/fdc: 'phase' is not needed on load, marcandre . lureau, 2023/09/26
- [PATCH 2/5] virtio: make endian_needed() work during loading,
marcandre . lureau <=
- [PATCH 3/5] net/slirp: use different IDs for each instance, marcandre . lureau, 2023/09/26
- [PATCH 4/5] RFC: migration: check required subsections are loaded, once, marcandre . lureau, 2023/09/26
- [PATCH 5/5] RFC: migration: check required entries are loaded, once, marcandre . lureau, 2023/09/26