提交 847efb32 编写于 作者: W Wen Congyang

qemu: avoid qemu_driver being unlocked twice when virThreadPoolNew() failed

We do not lock qemu_driver when calling virThreadPoolNew(). If it failed,
we will unlock qemu_driver. It is dangerous.

We may use this pool during auto starting domains. So we must create it before
calling qemuAutostartDomains(). Otherwise, libvirtd will crash.
上级 cf712494
......@@ -625,14 +625,14 @@ qemudStartup(int privileged) {
virHashForEach(qemu_driver->domains.objs, qemuDomainSnapshotLoad,
qemu_driver->snapshotDir);
qemuDriverUnlock(qemu_driver);
qemuAutostartDomains(qemu_driver);
qemu_driver->workerPool = virThreadPoolNew(0, 1, processWatchdogEvent, qemu_driver);
if (!qemu_driver->workerPool)
goto error;
qemuDriverUnlock(qemu_driver);
qemuAutostartDomains(qemu_driver);
if (conn)
virConnectClose(conn);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册