1 Star 0 Fork 71

yoo/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
nodedev-Mark-device-initialization-complete-even-in-.patch 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
From 557fe55a1c0c6f913cfa41c0b42b7d2fbb70c55a Mon Sep 17 00:00:00 2001
From: Michal Privoznik <mprivozn@redhat.com>
Date: Tue, 13 Apr 2021 10:45:24 +0200
Subject: [PATCH 060/108] nodedev: Mark device initialization complete even in
case of an error
To speed up nodedev driver initialization, the device enumeration
is done in a separate thread. Once finished, the thread sets a
boolean variable that allows public APIs to be called (instead of
waiting for the thread to finish).
However, if there's an error in the device enumeration thread
then the control jumps over at the 'error' label and the boolean
is never set. This means, that any virNodeDev*() API is stuck
forever. Mark the initialization as complete (the thread is
quitting anyway) and let the APIs proceed.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
(cherry picked from commit 54d97f020b6349b9e3e1cb966078625dcdd964a8)
---
src/node_device/node_device_udev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 000494f9e3..e65979c1b6 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1747,6 +1747,7 @@ nodeStateInitializeEnumerate(void *opaque)
if (udevEnumerateDevices(udev) != 0)
goto error;
+ cleanup:
nodeDeviceLock();
driver->initialized = true;
virCondBroadcast(&driver->initCond);
@@ -1761,6 +1762,8 @@ nodeStateInitializeEnumerate(void *opaque)
priv->threadQuit = true;
virCondSignal(&priv->threadCond);
virObjectUnlock(priv);
+
+ goto cleanup;
}
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdLUbG/libvirt.git
git@gitee.com:mdLUbG/libvirt.git
mdLUbG
libvirt
libvirt
master

搜索帮助