From: Philippe Mathieu-Daudé Date: Sun, 1 Feb 2026 22:39:29 +0000 (+0100) Subject: hw/virtio: Pass VirtIODevice* to virtio_reset() X-Git-Tag: v11.0.0-rc0~58^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=843a97fa2c9f42685d714c00a1a812cb886017f5;p=thirdparty%2Fqemu.git 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é Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Message-Id: <20260201223929.78790-1-philmd@linaro.org> --- diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 77ca54e5206..e9d55329525 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -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; diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 27cd98d2fe1..fcaa9b03b4a 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -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);