qemu: driver: Reload snapshots and managedsaves prior to reconnecting

Reconnect to the VM is a possibly long-running job spawned in a separate
thread. We should reload the snapshot defs and managedsave state prior
to spawning the thread to avoid blocking of the daemon startup which
would serialize on the VM lock.

Also the reloading code would violate the domain job held while
reconnecting as the loader functions don't create jobs.
This commit is contained in:
Peter Krempa 2014-12-03 11:18:53 +01:00
parent b17c0f0e9a
commit 48a055607c

View File

@ -873,8 +873,6 @@ qemuStateInitialize(bool privileged,
NULL, NULL) < 0)
goto error;
qemuProcessReconnectAll(conn, qemu_driver);
virDomainObjListForEach(qemu_driver->domains,
qemuDomainSnapshotLoad,
cfg->snapshotDir);
@ -883,6 +881,8 @@ qemuStateInitialize(bool privileged,
qemuDomainManagedSaveLoad,
qemu_driver);
qemuProcessReconnectAll(conn, qemu_driver);
qemu_driver->workerPool = virThreadPoolNew(0, 1, 0, qemuProcessEventHandler, qemu_driver);
if (!qemu_driver->workerPool)
goto error;