diff mbox series

[v10,2/7] libvhost-user: remove watch for kick_fd when de-initialize vu-dev

Message ID 20200918080912.321299-3-coiby.xu@gmail.com
State Superseded
Headers show
Series vhost-user block device backend implementation | expand

Commit Message

Coiby Xu Sept. 18, 2020, 8:09 a.m. UTC
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 <coiby.xu@gmail.com>
---
 contrib/libvhost-user/libvhost-user.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stefan Hajnoczi Sept. 18, 2020, 10:28 a.m. UTC | #1
On Fri, Sep 18, 2020 at 04:09:07PM +0800, Coiby Xu wrote:
> 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 <coiby.xu@gmail.com>
> ---
>  contrib/libvhost-user/libvhost-user.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox series

Patch

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index 73732b928f..5fdfa64294 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -1909,6 +1909,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;
         }