[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/3] qmp: remove virtio_list, search QOM tree instead
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v3 1/3] qmp: remove virtio_list, search QOM tree instead |
Date: |
Thu, 3 Aug 2023 16:05:35 +0100 |
User-agent: |
Mutt/2.2.9 (2022-11-12) |
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.palmer@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é <berrange@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 :|
- [PATCH v3 0/3] qmp, vhost-user: Remove virtio_list & update virtio introspection, Jonah Palmer, 2023/08/03
- [PATCH v3 2/3] qmp: update virtio feature maps, vhost-user-gpio introspection, Jonah Palmer, 2023/08/03
- [PATCH v3 1/3] qmp: remove virtio_list, search QOM tree instead, Jonah Palmer, 2023/08/03
- [PATCH v3 3/3] vhost-user: move VhostUserProtocolFeature definition to header file, Jonah Palmer, 2023/08/03
- Re: [PATCH v3 0/3] qmp,vhost-user: Remove virtio_list & update virtio introspection, Michael S. Tsirkin, 2023/08/03