summary refs log tree commit diff stats
path: root/hw/virtio/virtio.c
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2024-10-22 15:49:01 +0900
committerJason Wang <jasowang@redhat.com>2024-11-26 11:56:44 +0800
commit9379ea9db3c0064fa2787db0794a23a30f7b2d2d (patch)
treede46f651062a51dd06acbf34e81ae294845dcd27 /hw/virtio/virtio.c
parent791e3837c1105aec4e328674aad32e34056957e2 (diff)
downloadfocaccia-qemu-9379ea9db3c0064fa2787db0794a23a30f7b2d2d.tar.gz
focaccia-qemu-9379ea9db3c0064fa2787db0794a23a30f7b2d2d.zip
virtio-net: Add queues before loading them
Call virtio_net_set_multiqueue() to add queues before loading their
states. Otherwise the loaded queues will not have handlers and elements
in them will not be processed.

Cc: qemu-stable@nongnu.org
Fixes: 8c49756825da ("virtio-net: Add only one queue pair when realizing")
Reported-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/virtio/virtio.c')
-rw-r--r--hw/virtio/virtio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index a26f18908e..f12c4aa81e 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -3255,6 +3255,13 @@ virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id)
         config_len--;
     }
 
+    if (vdc->pre_load_queues) {
+        ret = vdc->pre_load_queues(vdev);
+        if (ret) {
+            return ret;
+        }
+    }
+
     num = qemu_get_be32(f);
 
     if (num > VIRTIO_QUEUE_MAX) {