summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2014-02-04 17:41:22 +0000
committerDaniel P. Berrange <berrange@redhat.com>2014-02-18 15:52:22 +0000
commit045ab83be86ab960ab8358d96de110e98930740c (patch)
treee3ea07f5b57281eab138e974cf24587026ce3494
parent869961c1a2dc718d6272b3218e0263d58d4a6648 (diff)
downloadlibvirt-045ab83be86ab960ab8358d96de110e98930740c.tar.gz
Fix reset of cgroup when detaching USB device from LXC guests
When detaching a USB device from an LXC guest we must remove the device from the cgroup ACL. Unfortunately we were telling the cgroup code to use the guest /dev path, not the host /dev path, and the guest device node had already been unlinked. This was, however, fortunate since the code passed &priv->cgroup instead of priv->cgroup, so would have crash if the device node were accessible. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> (cherry picked from commit 2c2bec94d27ccd070bee18a6113b1cfea6d80126)
-rw-r--r--src/lxc/lxc_driver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 4da2a44421..75a86ebe09 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3912,7 +3912,7 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
}
if (!(usb = virUSBDeviceNew(def->source.subsys.u.usb.bus,
- def->source.subsys.u.usb.device, vroot)))
+ def->source.subsys.u.usb.device, NULL)))
goto cleanup;
VIR_DEBUG("Unlinking %s", dst);
@@ -3926,7 +3926,7 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
if (virUSBDeviceFileIterate(usb,
virLXCTeardownHostUsbDeviceCgroup,
- &priv->cgroup) < 0)
+ priv->cgroup) < 0)
VIR_WARN("cannot deny device %s for domain %s",
dst, vm->def->name);