提交 3ed96444 编写于 作者: D Daniel P. Berrange

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: NDaniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 2c2bec94)
上级 c5554561
......@@ -3870,7 +3870,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);
......@@ -3884,7 +3884,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册