@samitouri / QOSamiQemu / commits / 843a97fa2c

hw/virtio: Pass VirtIODevice* to virtio_reset()

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>

Philippe Mathieu-Daudé committed Feb 1, 2026 at 23:39 UTC 843a97fa2c9f42685d714c00a1a812cb886017f5
2 files changed +2 -3
hw/virtio/virtio.c
+1 -2
@@ -3235,9 +3235,8 @@ int virtio_set_features_ex(VirtIODevice *vdev, const uint64_t *features)
3235 return ret;
3236 }
3237
3238 -void virtio_reset(void *opaque)
3238 +void virtio_reset(VirtIODevice *vdev)
3239 {
3240 - VirtIODevice *vdev = opaque;
3240 VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
3241 uint64_t features[VIRTIO_FEATURES_NU64S];
3242 int i;
include/hw/virtio/virtio.h
+1 -1
@@ -370,7 +370,7 @@ void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector);
370 int virtio_queue_set_host_notifier_mr(VirtIODevice *vdev, int n,
371 MemoryRegion *mr, bool assign);
372 int virtio_set_status(VirtIODevice *vdev, uint8_t val);
373 -void virtio_reset(void *opaque);
373 +void virtio_reset(VirtIODevice *vdev);
374 void virtio_queue_reset(VirtIODevice *vdev, uint32_t queue_index);
375 void virtio_queue_enable(VirtIODevice *vdev, uint32_t queue_index);
376 void virtio_update_irq(VirtIODevice *vdev);