]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Tear down the cgroup before reattach device to host
authorJohn Ferlan <jferlan@redhat.com>
Mon, 28 Mar 2016 11:40:57 +0000 (07:40 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 7 Apr 2016 00:22:29 +0000 (20:22 -0400)
commit2fbf29a5295b1f6d331ba8a421905552662ca348
tree43d97f43326ce3f30073024e4348698b23247f0e
parent409de00e3d8538dd357d2031cd8848aabe75207d
qemu: Tear down the cgroup 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
qemuTeardownHostdevCgroup to prior to reattaching the device to
the host.
src/qemu/qemu_hotplug.c