From 33d72145d783457973e29aed703b84f820763f47 Mon Sep 17 00:00:00 2001 From: Colin Xu Date: Fri, 25 Sep 2020 10:18:08 +0800 Subject: [PATCH] input-linux: Reset il->fd handler before closing it If object-del input-linux object on-the-fly, instance finalize will close evdev fd without resetting it. However the main thread is still trying to lock_acquire/lock_release during ppoll, which leads to a very high CPU utilization. Signed-off-by: Colin Xu Reviewed-by: Li Qiang Message-id: 20200925021808.26471-1-colin.xu@intel.com Signed-off-by: Gerd Hoffmann --- ui/input-linux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/input-linux.c b/ui/input-linux.c index ab351a4187..34cc531190 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -418,6 +418,7 @@ static void input_linux_instance_finalize(Object *obj) if (il->initialized) { QTAILQ_REMOVE(&inputs, il, next); + qemu_set_fd_handler(il->fd, NULL, NULL, NULL); close(il->fd); } g_free(il->evdev); -- 2.11.0