]> git.ipfire.org Git - thirdparty/qemu.git/commit - hw/virtio/virtio.c
qmp: remove virtio_list, search QOM tree instead
authorJonah Palmer <jonah.palmer@oracle.com>
Tue, 26 Sep 2023 22:41:05 +0000 (18:41 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 4 Oct 2023 08:54:24 +0000 (04:54 -0400)
commitb532c684e0d71bc69fa56a30f1c7588101aa086a
treed374795bbddec1c12fbc23e01ccb13a427b549db
parentb0de17a2e28de477e09e77a587fcbeafbbc897c4
qmp: remove virtio_list, search QOM tree instead

The virtio_list duplicates information about virtio devices that already
exist in the QOM composition tree. Instead of creating this list of
realized virtio devices, search the QOM composition tree instead.

This patch modifies the QMP command qmp_x_query_virtio to instead
recursively search the QOM composition tree for devices of type
'TYPE_VIRTIO_DEVICE'. The device is also checked to ensure it's
realized.

Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230926224107.2951144-2-jonah.palmer@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio-qmp.c
hw/virtio/virtio-qmp.h
hw/virtio/virtio.c