virtio-serial: create a linked list of all active devices
authorAmit Shah <amit.shah@redhat.com>
Wed, 16 Jul 2014 11:08:50 +0000 (16:38 +0530)
committerAmit Shah <amit.shah@redhat.com>
Mon, 18 Aug 2014 17:12:37 +0000 (22:42 +0530)
commita1857ad1acbddbefe7ce8adb24b0e40991c5c38f
tree8a9949bd2e3c2d8360adba1cc63e451fbbbdab47
parent08ab59770da57648bfb8fc9be37f0ef7fb50b0f9
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>
hw/char/virtio-serial-bus.c
include/hw/virtio/virtio-serial.h