qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Markus Armbruster <armbru@redhat.com>
Cc: Amit Shah <amit.shah@redhat.com>, Amos Kong <akong@redhat.com>,
	qemu list <qemu-devel@nongnu.org>
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	[thread overview]
Message-ID: <53F37806.3060809@suse.de> (raw)
In-Reply-To: <87egwcmqj6.fsf@blackfin.pond.sub.org>

Am 19.08.2014 17:45, schrieb Markus Armbruster:
> Andreas Färber <afaerber@suse.de> writes:
> 
>> Am 04.08.2014 13:45, schrieb Amit Shah:
>>> On (Mon) 04 Aug 2014 [13:33:56], Markus Armbruster wrote:
>>>> Amit Shah <amit.shah@redhat.com> 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	other threads:[~2014-08-19 16:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-16 11:31 [Qemu-devel] [PATCH 0/2] virtio-serial: Prevent addition of ports with same name Amit Shah
2014-07-16 11:31 ` [Qemu-devel] [PATCH 1/2] virtio-serial: create a linked list of all active devices Amit Shah
2014-08-04 11:33   ` Markus Armbruster
2014-08-04 11:45     ` Amit Shah
2014-08-06  7:27       ` Markus Armbruster
2014-08-06  7:39         ` Amit Shah
2014-08-18 17:21       ` Andreas Färber
2014-08-19 15:45         ` Markus Armbruster
2014-08-19 16:15           ` Andreas Färber [this message]
2014-07-16 11:31 ` [Qemu-devel] [PATCH 2/2] virtio-serial: search for duplicate port names before adding new ports Amit Shah
2014-08-06  7:27 ` [Qemu-devel] [PATCH 0/2] virtio-serial: Prevent addition of ports with same name Markus Armbruster
2014-08-06  7:39   ` Amit Shah
2014-08-18 17:10   ` Amit Shah
2014-08-18 17:17     ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53F37806.3060809@suse.de \
    --to=afaerber@suse.de \
    --cc=akong@redhat.com \
    --cc=amit.shah@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).