]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/virtio: Pass VirtIODevice* to virtio_reset()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Sun, 1 Feb 2026 22:39:29 +0000 (23:39 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 20 Feb 2026 18:04:45 +0000 (13:04 -0500)
virtio_reset() expects a VirtIODevice pointer, which
is what the single caller - virtio_bus_reset - passes.
Promote the opaque argument to a plain VirtIODevice.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260201223929.78790-1-philmd@linaro.org>

hw/virtio/virtio.c
include/hw/virtio/virtio.h

index 77ca54e52065a54e3da819f3ada4d16ec08888c0..e9d5532952571a4e038bb102c721c4924a365644 100644 (file)
@@ -3235,9 +3235,8 @@ int virtio_set_features_ex(VirtIODevice *vdev, const uint64_t *features)
     return ret;
 }
 
-void virtio_reset(void *opaque)
+void virtio_reset(VirtIODevice *vdev)
 {
-    VirtIODevice *vdev = opaque;
     VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
     uint64_t features[VIRTIO_FEATURES_NU64S];
     int i;
index 27cd98d2fe11f70b43fbbfb84170c11a1f4f1845..fcaa9b03b4aa6f63e7ec146ddb4124615da2c6bd 100644 (file)
@@ -370,7 +370,7 @@ void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector);
 int virtio_queue_set_host_notifier_mr(VirtIODevice *vdev, int n,
                                       MemoryRegion *mr, bool assign);
 int virtio_set_status(VirtIODevice *vdev, uint8_t val);
-void virtio_reset(void *opaque);
+void virtio_reset(VirtIODevice *vdev);
 void virtio_queue_reset(VirtIODevice *vdev, uint32_t queue_index);
 void virtio_queue_enable(VirtIODevice *vdev, uint32_t queue_index);
 void virtio_update_irq(VirtIODevice *vdev);