[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: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] virtio-serial: create a linked list of all active devices |
Date: |
Wed, 06 Aug 2014 09:27:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Amit Shah <address@hidden> writes:
> 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.
>
> <snip>
>
>> > +struct VirtIOSerialDevices {
>> > + QLIST_HEAD(, VirtIOSerial) devices;
>> > +} vserdevices;
>> > +
>>
>> Any particular reason for stuffing the list into a struct?
>
> Not strictly needed for this patch alone, but I think it's cleaner to
> keep it this way, and when something else comes up that needs a
> per-device variable, this list will be around.
Adding the struct when it's needed will be easy, so why pay the
notational overhead now?
> Also, this is also the
> way it's done in the kernel, so that uniformity helps as well.
Two uglies make a pretty?
Anyway, matter of taste.
[...]