virtio-serial: search for duplicate port names before adding new ports
authorAmit Shah <amit.shah@redhat.com>
Tue, 15 Jul 2014 04:47:02 +0000 (10:17 +0530)
committerAmit Shah <amit.shah@redhat.com>
Mon, 18 Aug 2014 17:12:49 +0000 (22:42 +0530)
commitd0a0bfe6729ef6044d76ea49fafa07e29fa598bd
treeed221783760dc3733384087a4ae9fc4c5dbe3525
parenta1857ad1acbddbefe7ce8adb24b0e40991c5c38f
virtio-serial: search for duplicate port names before adding new ports

Before adding new ports to VirtIOSerial devices, check if there's a
conflict in the 'name' parameter.  This ensures two virtserialports with
identical names are not initialized.

Reported-by: <mazhang@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
hw/char/virtio-serial-bus.c