[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 8/9] input-linux: Reset il->fd handler before closing it
From: |
Gerd Hoffmann |
Subject: |
[PULL 8/9] input-linux: Reset il->fd handler before closing it |
Date: |
Wed, 14 Oct 2020 10:21:48 +0200 |
From: Colin Xu <colin.xu@intel.com>
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 <colin.xu@intel.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-id: 20200925021808.26471-1-colin.xu@intel.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/input-linux.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ui/input-linux.c b/ui/input-linux.c
index ab351a418701..34cc531190f9 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.27.0
- [PULL 0/9] Ui 20201014 patches, Gerd Hoffmann, 2020/10/14
- [PULL 8/9] input-linux: Reset il->fd handler before closing it,
Gerd Hoffmann <=
- [PULL 4/9] win32: Simplify gmtime_r detection not depends on if _POSIX_C_SOURCE are defined on msys2/mingw, Gerd Hoffmann, 2020/10/14
- [PULL 2/9] curses: Fixes compiler error that complain don't have langinfo.h on msys2/mingw, Gerd Hoffmann, 2020/10/14
- [PULL 7/9] SDL: enable OpenGL context creation, Gerd Hoffmann, 2020/10/14
- [PULL 9/9] ui: Fix default window_id value, Gerd Hoffmann, 2020/10/14
- Re: [PULL 0/9] Ui 20201014 patches, Peter Maydell, 2020/10/14