[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 05/26] libvhost-user: exit by default on VHOST_US
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v3 05/26] libvhost-user: exit by default on VHOST_USER_NONE |
Date: |
Mon, 18 Jun 2018 18:17:08 +0200 |
Since commit 2566378d6d13bf4d28c7770bdbda5f7682594bbe, libvhost-user
no longer panics on disconnect (rc == 0), and instead silently ignores
an invalid VHOST_USER_NONE message.
Without extra work from the API user, this will simply busy-loop on
HUP events. The obvious thing to do is to exit(0) instead, while
additional or different work can be done by overriding
iface->process_msg().
Signed-off-by: Marc-André Lureau <address@hidden>
---
contrib/libvhost-user/libvhost-user.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/contrib/libvhost-user/libvhost-user.c
b/contrib/libvhost-user/libvhost-user.c
index a6b46cdc03..41470daf57 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -1285,7 +1285,8 @@ vu_process_message(VuDev *dev, VhostUserMsg *vmsg)
case VHOST_USER_SET_CONFIG:
return vu_set_config(dev, vmsg);
case VHOST_USER_NONE:
- break;
+ /* if you need processing before exit, override iface->process_msg */
+ exit(0);
case VHOST_USER_POSTCOPY_ADVISE:
return vu_set_postcopy_advise(dev, vmsg);
case VHOST_USER_POSTCOPY_LISTEN:
--
2.18.0.rc1
- Re: [Qemu-devel] [PATCH v3 01/26] chardev: avoid crash if no associated address, (continued)
[Qemu-devel] [PATCH v3 05/26] libvhost-user: exit by default on VHOST_USER_NONE,
Marc-André Lureau <=
[Qemu-devel] [PATCH v3 06/26] vhost-user: wrap some read/write with retry handling, Marc-André Lureau, 2018/06/18
[Qemu-devel] [PATCH v3 09/26] HACK: vhost-user-backend: allow to specify binary to execute, Marc-André Lureau, 2018/06/18
[Qemu-devel] [PATCH v3 07/26] qio: add qio_channel_command_new_spawn_with_pre_exec(), Marc-André Lureau, 2018/06/18
[Qemu-devel] [PATCH v3 08/26] Add vhost-user-backend, Marc-André Lureau, 2018/06/18
[Qemu-devel] [PATCH v3 10/26] vhost-user: split vhost_user_read(), Marc-André Lureau, 2018/06/18