summary refs log tree commit diff stats
path: root/net/net.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2025-07-09 10:24:24 +0200
committerJason Wang <jasowang@redhat.com>2025-07-14 13:27:09 +0800
commit854ee02b22220377f3fa3806adf7e0718c3a5c5a (patch)
treea1a079cf7cbfa9cf6e8ff7d71dc5a4e338e49a74 /net/net.c
parentba5acc5d6e0bc9ab86619c92cb76493aa197d7a2 (diff)
downloadfocaccia-qemu-854ee02b22220377f3fa3806adf7e0718c3a5c5a.tar.gz
focaccia-qemu-854ee02b22220377f3fa3806adf7e0718c3a5c5a.zip
net: Add passt network backend
This commit introduces support for passt as a new network backend.
passt is an unprivileged, user-mode networking solution that provides
connectivity for virtual machines by launching an external helper process.

The implementation reuses the generic stream data handling logic. It
launches the passt binary using GSubprocess, passing it a file
descriptor from a socketpair() for communication. QEMU connects to
the other end of the socket pair to establish the network data stream.

The PID of the passt daemon is tracked via a temporary file to
ensure it is terminated when QEMU exits.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c
index cfa2d8e958..90f69fdf39 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1248,6 +1248,9 @@ static int (* const net_client_init_fun[NET_CLIENT_DRIVER__MAX])(
     const char *name,
     NetClientState *peer, Error **errp) = {
         [NET_CLIENT_DRIVER_NIC]       = net_init_nic,
+#ifdef CONFIG_PASST
+        [NET_CLIENT_DRIVER_PASST]     = net_init_passt,
+#endif
 #ifdef CONFIG_SLIRP
         [NET_CLIENT_DRIVER_USER]      = net_init_slirp,
 #endif
@@ -1353,6 +1356,7 @@ void show_netdevs(void)
         "dgram",
         "hubport",
         "tap",
+        "passt",
 #ifdef CONFIG_SLIRP
         "user",
 #endif