提交 1229ef49 编写于 作者: J Ján Tomko

Track privileged state in udev nodedev driver

Remember if libvirtd is running as root or not.
上级 ec7b9225
......@@ -53,6 +53,7 @@ VIR_LOG_INIT("node_device.node_device_udev");
struct _udevPrivate {
struct udev_monitor *udev_monitor;
int watch;
bool privileged;
};
static virNodeDeviceDriverStatePtr driverState = NULL;
......@@ -1712,7 +1713,7 @@ static int udevSetupSystemDev(void)
return ret;
}
static int nodeStateInitialize(bool privileged ATTRIBUTE_UNUSED,
static int nodeStateInitialize(bool privileged,
virStateInhibitCallback callback ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED)
{
......@@ -1746,6 +1747,7 @@ static int nodeStateInitialize(bool privileged ATTRIBUTE_UNUSED,
}
priv->watch = -1;
priv->privileged = privileged;
if (VIR_ALLOC(driverState) < 0) {
VIR_FREE(priv);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册