diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5b594a849a..491dfc7db0 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -811,8 +811,6 @@ qemuStateInitialize(bool privileged, conn = virConnectOpen(cfg->uri); - qemuProcessReconnectAll(conn, qemu_driver); - /* Then inactive persistent configs */ if (virDomainObjListLoadAllConfigs(qemu_driver->domains, cfg->configDir, @@ -823,6 +821,7 @@ qemuStateInitialize(bool privileged, NULL, NULL) < 0) goto error; + qemuProcessReconnectAll(conn, qemu_driver); virDomainObjListForEach(qemu_driver->domains, qemuDomainSnapshotLoad, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 393110b735..43a9156034 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3253,6 +3253,9 @@ qemuProcessReconnectHelper(virDomainObjPtr obj, struct qemuProcessReconnectData *src = opaque; struct qemuProcessReconnectData *data; + if (!obj->pid) + return 0; + if (VIR_ALLOC(data) < 0) return -1;