qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] virtio-serial: create a linked list of all


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 1/2] virtio-serial: create a linked list of all active devices
Date: Tue, 19 Aug 2014 18:15:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0

Am 19.08.2014 17:45, schrieb Markus Armbruster:
> Andreas Färber <address@hidden> writes:
> 
>> Am 04.08.2014 13:45, schrieb Amit Shah:
>>> On (Mon) 04 Aug 2014 [13:33:56], Markus Armbruster wrote:
>>>> Amit Shah <address@hidden> writes:
>>>>
>>>>> To ensure two virtserialports don't get added to the system with the
>>>>> same 'name' parameter, we need to access all the ports on all the
>>>>> devices added, and compare the names.
>>>>>
>>>>> We currently don't have a list of all VirtIOSerial devices added to the
>>>>> system.  This commit adds a simple linked list in which devices are put
>>>>> when they're initialized, and removed when they go away.
>> [...]
>>>> Patch looks simple & safe to me, but I can't help to wonder whether want
>>>> (or already have?) more generic infrastructure offering "for all devices
>>>> of a certain kind" functionality, which is what 2/2 needs.  Andreas?
>>>
>>> Yea; I didn't find any, but if there's already something it can be put
>>> to good use here.
>>
>> If you're looking for devices of the same QOM type, that can be done
>> through some QOM path syntax that Paolo introduced. Someone used it in a
>> recent iommu series.
> 
> Possibly
> 
>     object_class_foreach(fn, TYPE_VIRTIO_SERIAL_PORT, false, false, arg);

That enumerates derived types (ObjectClass), not Object instances.

Maybe it makes sense to add such an API for objects, too. However the
only "registry" of objects we have is the QOM composition tree, i.e. it
would be a tree-walking function.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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