qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1 1/2] qmp: remove virtio_list, search QOM tree instead


From: Daniel P . Berrangé
Subject: Re: [PATCH v1 1/2] qmp: remove virtio_list, search QOM tree instead
Date: Wed, 17 May 2023 09:12:34 +0100
User-agent: Mutt/2.2.9 (2022-11-12)

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
-- 
|: 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 :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]