aboutsummaryrefslogtreecommitdiff
path: root/util/vhost-user-server.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/vhost-user-server.c')
-rw-r--r--util/vhost-user-server.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c
index 3bfb1ad..b192290 100644
--- a/util/vhost-user-server.c
+++ b/util/vhost-user-server.c
@@ -65,6 +65,18 @@ static void vmsg_close_fds(VhostUserMsg *vmsg)
static void vmsg_unblock_fds(VhostUserMsg *vmsg)
{
int i;
+
+ /*
+ * These messages carry fd used to map memory, not to send/receive messages,
+ * so this operation is useless. In addition, in some systems this
+ * operation can fail (e.g. in macOS setting an fd returned by shm_open()
+ * non-blocking fails with errno = ENOTTY)
+ */
+ if (vmsg->request == VHOST_USER_ADD_MEM_REG ||
+ vmsg->request == VHOST_USER_SET_MEM_TABLE) {
+ return;
+ }
+
for (i = 0; i < vmsg->fd_num; i++) {
qemu_socket_set_nonblock(vmsg->fds[i]);
}