]> xenbits.xensource.com Git - libvirt.git/commit
qemu: fix address allocation on chardev attach
authorLuyao Huang <lhuang@redhat.com>
Wed, 10 Jun 2015 14:49:37 +0000 (22:49 +0800)
committerJán Tomko <jtomko@redhat.com>
Wed, 1 Jul 2015 06:09:43 +0000 (08:09 +0200)
commitf967e7a6690ed20478623b0707b846f81f469ff4
tree4d22ca56c397e176d0ba5a4c6d3eabcabb478565
parent04597f8f0de09cbac5a141bee6f6690924900bc8
qemu: fix address allocation on chardev attach

Also check the device type when deciding what type the address should
be. Commit 9807c47 (aiming to fix another error in address allocation)
only checked the target type, but its value is different for different
device types. This resulted in an error when trying to attach
a channel with target type 'virtio':

error: Failed to attach device from channel-file.xml
error: internal error: virtio serial device has invalid address type

Make the logic for releasing the address dependent only on
* the address type
* whether it was allocated earlier
to avoid copying the device and target type checks.

https://bugzilla.redhat.com/show_bug.cgi?id=1230039

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c
src/qemu/qemu_hotplug.c