MCPcopy Create free account
hub / github.com/F-Stack/f-stack / validate_msg_fds

Function validate_msg_fds

dpdk/lib/vhost/vhost_user.c:90–104  ·  view source on GitHub ↗

* Ensure the expected number of FDs is received, * close all FDs and return an error if this is not the case. */

Source from the content-addressed store, hash-verified

88 * close all FDs and return an error if this is not the case.
89 */
90static int
91validate_msg_fds(struct virtio_net *dev, struct vhu_msg_context *ctx, int expected_fds)
92{
93 if (ctx->fd_num == expected_fds)
94 return 0;
95
96 VHOST_LOG_CONFIG(dev->ifname, ERR,
97 "expect %d FDs for request %s, received %d\n",
98 expected_fds, vhost_message_handlers[ctx->msg.request.frontend].description,
99 ctx->fd_num);
100
101 close_msg_fds(ctx);
102
103 return -1;
104}
105
106static uint64_t
107get_blk_size(int fd)

Callers 12

vhost_user_set_mem_tableFunction · 0.85
vhost_user_set_vring_errFunction · 0.85
vhost_user_set_log_baseFunction · 0.85
vhost_user_set_log_fdFunction · 0.85
vhost_user_set_req_fdFunction · 0.85
vhost_user_get_configFunction · 0.85
vhost_user_set_configFunction · 0.85
vhost_user_msg_handlerFunction · 0.85

Calls 1

close_msg_fdsFunction · 0.85

Tested by

no test coverage detected