소스 검색

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 <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>
Colin Xu 4 년 전
부모
커밋
33d72145d7
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      ui/input-linux.c

+ 1 - 0
ui/input-linux.c

@@ -418,6 +418,7 @@ static void input_linux_instance_finalize(Object *obj)
 
 
     if (il->initialized) {
     if (il->initialized) {
         QTAILQ_REMOVE(&inputs, il, next);
         QTAILQ_REMOVE(&inputs, il, next);
+        qemu_set_fd_handler(il->fd, NULL, NULL, NULL);
         close(il->fd);
         close(il->fd);
     }
     }
     g_free(il->evdev);
     g_free(il->evdev);