[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 4/5] libvhost-user: quit when no more data received
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 4/5] libvhost-user: quit when no more data received |
Date: |
Wed, 9 Aug 2017 04:50:56 +0300 |
From: Jens Freimann <address@hidden>
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 <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
contrib/libvhost-user/libvhost-user.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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);
--
MST
- [Qemu-devel] [PULL 0/5] pc, vhost: fixes for rc3, Michael S. Tsirkin, 2017/08/08
- [Qemu-devel] [PULL 1/5] acpi-test: update expected DSDT files, Michael S. Tsirkin, 2017/08/08
- [Qemu-devel] [PULL 2/5] Revert "cpu: add APIs to allocate/free CPU environment", Michael S. Tsirkin, 2017/08/08
- [Qemu-devel] [PULL 3/5] net: fix -netdev socket, fd= for UDP sockets, Michael S. Tsirkin, 2017/08/08
- [Qemu-devel] [PULL 4/5] libvhost-user: quit when no more data received,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 5/5] libqtest: always set up signal handler for SIGABRT, Michael S. Tsirkin, 2017/08/08
- Re: [Qemu-devel] [PULL 0/5] pc, vhost: fixes for rc3, Peter Maydell, 2017/08/10