On 5/17/23 04:12, Daniel P. Berrangé
wrote:
On Tue, May 16, 2023 at 03:26:25PM -0400, Jonah Palmer wrote:
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 search
the partial paths of '/machine/peripheral/' &
'/machine/peripheral-anon/' in the QOM composition tree for virtio
devices.
A device is found to be a valid virtio device if (1) it has a canonical
path ending with 'virtio-backend' and (2) the device has been realized.
Checking the path suffix feels pretty undesirable to me when we could
be doing a QOM class check
if (object_dynamic_cast(obj, TYPE_VIRTIO_DEVICE))
...
With regards,
Daniel