virtio-input: convert to new virtio_delete_queue
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 9 Dec 2019 16:55:10 +0000 (11:55 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 5 Jan 2020 12:03:03 +0000 (07:03 -0500)
Seems cleaner than using VQ index values.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/input/virtio-input.c

index ec54e46ad6703ddacad196f0889458eda72eb967..9c013afddb93514237eef29ac499daee1487f8e3 100644 (file)
@@ -280,6 +280,7 @@ static void virtio_input_device_unrealize(DeviceState *dev, Error **errp)
 {
     VirtIOInputClass *vic = VIRTIO_INPUT_GET_CLASS(dev);
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
+    VirtIOInput *vinput = VIRTIO_INPUT(dev);
     Error *local_err = NULL;
 
     if (vic->unrealize) {
@@ -289,8 +290,8 @@ static void virtio_input_device_unrealize(DeviceState *dev, Error **errp)
             return;
         }
     }
-    virtio_del_queue(vdev, 0);
-    virtio_del_queue(vdev, 1);
+    virtio_delete_queue(vinput->evt);
+    virtio_delete_queue(vinput->sts);
     virtio_cleanup(vdev);
 }