]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Allow hotplug of vhost-scsi device
authorEric Farman <farman@linux.vnet.ibm.com>
Tue, 22 Nov 2016 03:58:19 +0000 (22:58 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 24 Nov 2016 17:16:23 +0000 (12:16 -0500)
commit8c6d365373d5b8c110af7b09df3a3229eebf5215
treed00bc17c6b47dcd0924d9adbc76571032c34db16
parent9cc26dc62271d909f2c7019828c1120570cd0a70
qemu: Allow hotplug of vhost-scsi device

Adjust the device string that is built for vhost-scsi devices so that it
can be invoked from hotplug.

From the QEMU command line, the file descriptors are expect to be numeric only.
However, for hotplug, the file descriptors are expected to begin with at least
one alphabetic character else this error occurs:

  # virsh attach-device guest_0001 ~/vhost.xml
  error: Failed to attach device from /root/vhost.xml
  error: internal error: unable to execute QEMU command 'getfd':
  Parameter 'fdname' expects a name not starting with a digit

We also close the file descriptor in this case, so that shutting down the
guest cleans up the host cgroup entries and allows future guests to use
vhost-scsi devices.  (Otherwise the guest will silently end.)

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