]> xenbits.xensource.com Git - people/dariof/libvirt.git/commit
qemu: Allow hotplug of multiple SCSI devices
authorEric Farman <farman@linux.vnet.ibm.com>
Thu, 8 Aug 2013 11:26:50 +0000 (13:26 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 8 Aug 2013 12:16:34 +0000 (14:16 +0200)
commitc4eb12067e020b0b30c34b0f8d67943da654761d
treef648edbefe6afd366b49b8be6135a6a4c206712e
parent664ab2801dfcb8e72fc4408cc50c279bf74e47a2
qemu: Allow hotplug of multiple SCSI devices

Hotplugging a single SCSI device works, but adding additional ones
result in an error from QEMU:

[root@gpok197 ~]# virsh attach-device guest01 blah.xml
Device attached successfully
[root@gpok197 ~]# virsh attach-device guest01 blah2.xml
error: Failed to attach device from blah2.xml
error: internal error unable to execute QEMU command 'device_add': Duplicate ID 'hostdev0' for device

The hostdev ID that is created is always set to zero, regardless
of the contents of the XML.  Changing the index in the hotplug case
to a negative one so the next available index is used.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
Reviewed-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
src/qemu/qemu_hotplug.c