1
0
mirror of https://passt.top/passt synced 2024-12-22 05:35:23 +00:00

tap: Call vu_init() with --fd

We need to initialize vhost-user structures with --fd too.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Laurent Vivier 2024-12-09 17:54:50 +01:00 committed by Stefano Brivio
parent 2139ad33fc
commit 947f5cdb93

8
tap.c
View File

@ -1405,10 +1405,12 @@ void tap_sock_update_pool(void *base, size_t size)
*/ */
void tap_backend_init(struct ctx *c) void tap_backend_init(struct ctx *c)
{ {
if (c->mode == MODE_VU) if (c->mode == MODE_VU) {
tap_sock_update_pool(NULL, 0); tap_sock_update_pool(NULL, 0);
else vu_init(c);
} else {
tap_sock_update_pool(pkt_buf, sizeof(pkt_buf)); tap_sock_update_pool(pkt_buf, sizeof(pkt_buf));
}
if (c->fd_tap != -1) { /* Passed as --fd */ if (c->fd_tap != -1) { /* Passed as --fd */
ASSERT(c->one_off); ASSERT(c->one_off);
@ -1421,8 +1423,6 @@ void tap_backend_init(struct ctx *c)
tap_sock_tun_init(c); tap_sock_tun_init(c);
break; break;
case MODE_VU: case MODE_VU:
vu_init(c);
/* fall through */
case MODE_PASST: case MODE_PASST:
tap_sock_unix_init(c); tap_sock_unix_init(c);