]> git.ipfire.org Git - thirdparty/libvirt.git/commit
hostdev: Stop early if unmanaged devices have not been detached
authorAndrea Bolognani <abologna@redhat.com>
Fri, 4 Mar 2016 15:16:16 +0000 (16:16 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 23 Mar 2016 09:58:18 +0000 (10:58 +0100)
commit6da6bf2f30b4d8a8004a026e7762d3aa086fa58b
tree7b676266d79af3e5c64823c5742319318e45cd70
parentdf490e7c9b183b0a22cd0ed991b18640dad2696f
hostdev: Stop early if unmanaged devices have not been detached

Unmanaged devices, as the name suggests, are not detached
automatically from the host by libvirt before being attached to a
guest: it's the user's responsability to detach them manually
beforehand. If that preliminary step has not been performed, the
attach operation can't complete successfully.

Instead of relying on the lower layers to error out with cryptic
messages such as

  error: Failed to attach device from /tmp/hostdev.xml
  error: Path '/dev/vfio/12' is not accessible: No such file or directory

prevent the situation altogether and provide the user with a more
useful error message.
src/util/virhostdev.c