From f1baeee9ffeddcc068d3536f90b5c3e9f81d9309 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Fri, 18 Sep 2020 16:09:07 +0800 Subject: libvhost-user: remove watch for kick_fd when de-initialize vu-dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the client is running in gdb and quit command is run in gdb, QEMU will still dispatch the event which will cause segment fault in the callback function. Signed-off-by: Coiby Xu Reviewed-by: Stefan Hajnoczi Reviewed-by: Marc-André Lureau Message-id: 20200918080912.321299-3-coiby.xu@gmail.com Signed-off-by: Stefan Hajnoczi --- contrib/libvhost-user/libvhost-user.c | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/libvhost-user') diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c index 09bdff1..bfec8a8 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -1918,6 +1918,7 @@ vu_deinit(VuDev *dev) } if (vq->kick_fd != -1) { + dev->remove_watch(dev, vq->kick_fd); close(vq->kick_fd); vq->kick_fd = -1; } -- cgit v1.1