net/colo-compare.c: Fix a crash in COLO Primary.
Because event_unhandled_count may be accessed concurrently, it needs to be protected by taking the lock. However the assert is outside the lock, probably causing it to read garbage and aborting Qemu erroneously. The Bug only happens when running Qemu in COLO mode. This Patch fixes the following bug: https://bugs.launchpad.net/qemu/+bug/1824622 Signed-off-by: Lukas Straub <lukasstraub2@web.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
178a0a5dea
commit
78e4f446d2
@ -813,9 +813,8 @@ static void colo_compare_handle_event(void *opaque)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(event_unhandled_count > 0);
|
|
||||||
|
|
||||||
qemu_mutex_lock(&event_mtx);
|
qemu_mutex_lock(&event_mtx);
|
||||||
|
assert(event_unhandled_count > 0);
|
||||||
event_unhandled_count--;
|
event_unhandled_count--;
|
||||||
qemu_cond_broadcast(&event_complete_cond);
|
qemu_cond_broadcast(&event_complete_cond);
|
||||||
qemu_mutex_unlock(&event_mtx);
|
qemu_mutex_unlock(&event_mtx);
|
||||||
|
Loading…
Reference in New Issue
Block a user