Skip to content
Snippets Groups Projects
Commit 33d72145 authored by Colin Xu's avatar Colin Xu Committed by Gerd Hoffmann
Browse files

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: default avatarColin Xu <colin.xu@intel.com>
Reviewed-by: default avatarLi Qiang <liq3ea@gmail.com>
Message-id: 20200925021808.26471-1-colin.xu@intel.com
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 67c6f1db
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment