
From: Michal Privoznik <mprivozn@redhat.com> The aim of virCHEventStopProcess() is to clean up after stopped domain by calling virCHProcessStop(). But in order to do that it needs to acquire a job and in order to do that it needs to lock the domain object. Well, the object is not unlocked in all exit paths, i.e. when job acquiring fails the domain object is left locked. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- src/ch/ch_events.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ch/ch_events.c b/src/ch/ch_events.c index 25c7ecf90a..cd2f92a493 100644 --- a/src/ch/ch_events.c +++ b/src/ch/ch_events.c @@ -55,13 +55,12 @@ virCHEventStopProcess(virDomainObj *vm, virDomainShutoffReason reason) { virCHDriver *driver = CH_DOMAIN_PRIVATE(vm)->driver; + VIR_LOCK_GUARD lock = virObjectLockGuard(vm); - virObjectLock(vm); if (virDomainObjBeginJob(vm, VIR_JOB_DESTROY)) return -1; virCHProcessStop(driver, vm, reason, VIR_CH_PROCESS_STOP_FORCE); virDomainObjEndJob(vm); - virObjectUnlock(vm); return 0; } -- 2.49.1