virtio-serial: create a linked list of all active devices

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.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Amit Shah 2014-07-16 16:38:50 +05:30
parent 08ab59770d
commit a1857ad1ac
2 changed files with 12 additions and 0 deletions

View file

@ -202,6 +202,8 @@ struct VirtIOSerial {
QTAILQ_HEAD(, VirtIOSerialPort) ports;
QLIST_ENTRY(VirtIOSerial) next;
/* bitmap for identifying active ports */
uint32_t *ports_map;