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.
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);