aboutsummaryrefslogtreecommitdiff
path: root/contrib/libvhost-user
diff options
context:
space:
mode:
authorJens Freimann <jfreiman@redhat.com>2017-08-08 22:38:58 +0200
committerMichael S. Tsirkin <mst@redhat.com>2017-08-09 04:22:13 +0300
commit2566378d6d13bf4d28c7770bdbda5f7682594bbe (patch)
tree97be708f37cdc2d780491bac558b315324bb951f /contrib/libvhost-user
parent0f8c289ad539feb5135c545bea947b310a893f4b (diff)
downloadqemu-2566378d6d13bf4d28c7770bdbda5f7682594bbe.zip
qemu-2566378d6d13bf4d28c7770bdbda5f7682594bbe.tar.gz
qemu-2566378d6d13bf4d28c7770bdbda5f7682594bbe.tar.bz2
libvhost-user: quit when no more data received
End processing of messages when VHOST_USER_NONE is received. Without this we run into a vubr_panic() call and get "PANIC: Unhandled request: 0" Signed-off-by: Jens Freimann <jfreiman@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'contrib/libvhost-user')
-rw-r--r--contrib/libvhost-user/libvhost-user.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index 9efb9da..35fa0c5 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -161,7 +161,7 @@ vu_message_read(VuDev *dev, int conn_fd, VhostUserMsg *vmsg)
rc = recvmsg(conn_fd, &msg, 0);
} while (rc < 0 && (errno == EINTR || errno == EAGAIN));
- if (rc <= 0) {
+ if (rc < 0) {
vu_panic(dev, "Error while recvmsg: %s", strerror(errno));
return false;
}
@@ -806,6 +806,8 @@ vu_process_message(VuDev *dev, VhostUserMsg *vmsg)
return vu_get_queue_num_exec(dev, vmsg);
case VHOST_USER_SET_VRING_ENABLE:
return vu_set_vring_enable_exec(dev, vmsg);
+ case VHOST_USER_NONE:
+ break;
default:
vmsg_close_fds(vmsg);
vu_panic(dev, "Unhandled request: %d", vmsg->request);