On Thu, Aug 03, 2023 at 10:54:58AM -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 > recursively search the QOM composition tree for devices of type > 'TYPE_VIRTIO_DEVICE'. The device is also checked to ensure it's > realized. > > [Jonah: In the previous commit the qmp_x_query_virtio function was > iterating through devices found via. qmp_qom_list and appending > "/virtio-backend" to devices' paths to check if they were a virtio > device. > > This method was messy and involved unneeded string manipulation. > > Instead, we can use recursion with object_get_root to iterate through > all parent and child device paths to find virtio devices. > > The qmp_find_virtio_device function was also updated to simplify the > method of determining if a path is to a valid and realized virtio > device.]
FWIW, this "history" would typically go after the '---' but before the diffstat, as it is relevant to reviewers of this new v3, but doesn't need to get into the permanent git log once merged. > Signed-off-by: Jonah Palmer <jonah.pal...@oracle.com> > --- > hw/virtio/virtio-qmp.c | 96 ++++++++++++++++++------------------------ > hw/virtio/virtio-qmp.h | 7 --- > hw/virtio/virtio.c | 6 --- > 3 files changed, 40 insertions(+), 69 deletions(-) Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|