]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Restore label before reattach device to host
authorJohn Ferlan <jferlan@redhat.com>
Mon, 28 Mar 2016 11:34:03 +0000 (07:34 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 7 Apr 2016 00:22:29 +0000 (20:22 -0400)
commit409de00e3d8538dd357d2031cd8848aabe75207d
treef4969d0e095dca10634af51dd9b3a8c1f779eb65
parent12b239a9fafe84bf025437fe0324e7af5d12cd67
qemu: Restore label before reattach device to host

When a hostdev is attached to the guest (and removed from the host),
the order of operations is call qemuHostdevPreparePCIDevices to remove
the device from the host, call qemuSetupHostdevCgroup to setup the cgroups,
and virSecurityManagerSetHostdevLabel to set the labels.

When the device is removed from the guest, the code didn't use the
reverse order leading to possible issues (especially if the path to
the device no longer exists). This patch will move the call to
virSecurityManagerRestoreHostdevLabel to prior to reattaching the
device to the host.
src/qemu/qemu_hotplug.c