]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Auto-generate controller for hotplugged hostdev
authorEric Farman <farman@linux.vnet.ibm.com>
Thu, 21 Nov 2013 03:36:27 +0000 (22:36 -0500)
committerJán Tomko <jtomko@redhat.com>
Thu, 21 Nov 2013 09:38:57 +0000 (10:38 +0100)
commit881eb78064c1dcda8d8fc4b7758b583b87298c1d
treedc2891deb6661339b93ea5d0bec794d758627b2e
parent6f22f95f77cd0a0d3be5d561e49813db24a97da6
qemu: Auto-generate controller for hotplugged hostdev

If a SCSI hostdev is included in an initial domain XML, without a
corresponding controller statement, one is created silently when the
guest is booted.

When hotplugging a SCSI hostdev, a presumption is that the controller
is already present in the domain either from the original XML, or via
an earlier hotplug.

  [root@xxxxxxxx ~]# cat disk.xml
  <hostdev mode='subsystem' type='scsi'>
    <source>
      <adapter name='scsi_host0'/>
      <address bus='0' target='3' unit='1088438288'/>
    </source>
  </hostdev>
  [root@xxxxxxxx ~]# virsh attach-device guest01 disk.xml
  error: Failed to attach device from disk.xml
  error: internal error: unable to execute QEMU command 'device_add': Bus 'scsi0.0' not found

Since the infrastructure is in place, we can also create a controller
silently for use by the hotplugged hostdev device.

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