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: Jonah Palmer
Subject: Re: [PATCH v1 1/2] qmp: remove virtio_list, search QOM tree instead
Date: Mon, 5 Jun 2023 10:31:47 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0


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
Ah, yes, you're right. This is a much better solution. I will do this instead
of the hacky string manipulation (which also felt undesirable to me).


Jonah

    

reply via email to

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