diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d930ff9a74..bfa742577f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -318,7 +318,9 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon, /* We don't want this EOF handler to be called over and over while the * thread is waiting for a job. */ + virObjectLock(mon); qemuMonitorUnregister(mon); + virObjectUnlock(mon); /* We don't want any cleanup from EOF handler (or any other * thread) to enter qemu namespace. */