From: Stefano Brivio <sbrivio@redhat.com>
To: passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>,
Laurent Vivier <lvivier@redhat.com>,
Andrea Bolognani <abologna@redhat.com>
Subject: [PATCH 3/3] passt, qrap, README: Update notes and documentation for AF_UNIX support in qemu
Date: Fri, 4 Nov 2022 02:54:42 +0100 [thread overview]
Message-ID: <20221104015442.3831762-4-sbrivio@redhat.com> (raw)
In-Reply-To: <20221104015442.3831762-1-sbrivio@redhat.com>
We can't get rid of qrap quite yet, but at least we should start
telling users it's not going to be needed anymore starting from qemu
7.2.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
---
README.md | 10 ++++------
passt.1 | 8 ++------
qrap.1 | 13 +++++--------
qrap.c | 5 +++--
tap.c | 10 ++++------
5 files changed, 18 insertions(+), 28 deletions(-)
diff --git a/README.md b/README.md
index e1df972..0e2ca78 100644
--- a/README.md
+++ b/README.md
@@ -368,13 +368,11 @@ speeding up local connections, and usually requiring NAT. _pasta_:
## Interfaces and Environment
_passt_ exchanges packets with _qemu_ via UNIX domain socket, using the `socket`
-back-end in qemu. Currently, qemu can only connect to a listening process via
-TCP. Two temporary solutions are available:
+back-end in qemu. This is supported since qemu 7.2.
-* a [patch](/passt/tree/qemu) for qemu
-* a wrapper, [qrap](/passt/tree/qrap.c), that connects to a
- UNIX domain socket and starts qemu, which can now use the file descriptor
- that's already opened
+For older versions, the [qrap](/passt/tree/qrap.c) wrapper can be used to
+connect to a UNIX domain socket and to start qemu, which can now use the file
+descriptor that's already opened.
This approach, compared to using a _tap_ device, doesn't require any security
capabilities, as we don't need to create any interface.
diff --git a/passt.1 b/passt.1
index 2c93907..e34a3e0 100644
--- a/passt.1
+++ b/passt.1
@@ -51,12 +51,8 @@ one peer's observed parameters (congestion window size, acknowledged data, etc.)
to the corresponding peer.
Currently, the only supported hypervisor is \fBqemu\fR(1), connecting to
-\fBpasst\fR by means of a UNIX domain socket. This configuration can be obtained
-via out-of-tree qemu patches, available at:
-
- \fIhttps://passt.top/passt/tree/contrib/qemu\fR
-
-or with the \fBqrap\fR(1) wrapper.
+\fBpasst\fR by means of a UNIX domain socket. This is supported starting from
+qemu 7.2. For older qemu versions, see the \fBqrap\fR(1) wrapper.
.SS pasta
diff --git a/qrap.1 b/qrap.1
index cc73f1e..5246e1b 100644
--- a/qrap.1
+++ b/qrap.1
@@ -5,7 +5,7 @@
.SH NAME
.B qrap
-\- qemu wrapper connecting UNIX domain socket to file descriptor
+\- temporary qemu wrapper connecting UNIX domain socket to file descriptor
.SH SYNOPSIS
.B qrap
@@ -47,13 +47,10 @@ $ ./qrap test.qcow2 -m 1024 -display none -nodefaults -nographic
.SH NOTES
-This wrapper is temporary and needed only as long as \fBqemu\fR(1) does not
-directly support a UNIX domain socket as \fInetdev\fR back-end.
-
-Out-of-tree patches for \fBqemu\fR(1) introducing support for a UNIX domain
-socket back-end are available at:
-
- \fIhttps://passt.top/passt/tree/contrib/qemu\fR
+This wrapper is temporary: qemu commit 13c6be96618c ("net: stream: add unix
+socket") introduces native AF_UNIX socket support, and it should be included in
+qemu starting from the 7.2 release. It will be around for a little bit longer to
+give users enough time to switch.
.SH AUTHOR
diff --git a/qrap.c b/qrap.c
index 3c6f5b8..287198e 100644
--- a/qrap.c
+++ b/qrap.c
@@ -7,8 +7,9 @@
* Copyright (c) 2020-2021 Red Hat GmbH
* Author: Stefano Brivio <sbrivio@redhat.com>
*
- * TODO: Implement this functionality directly in qemu: we have TCP and UDP
- * socket back-ends already.
+ * TODO: Drop this implementation once qemu commit 13c6be96618c ("net: stream:
+ * add unix socket") is included in a release (7.2), and once we can reasonably
+ * assume existing users switched to it.
*/
#include <stdio.h>
diff --git a/tap.c b/tap.c
index 84e93c2..ceb6e1d 100644
--- a/tap.c
+++ b/tap.c
@@ -943,13 +943,11 @@ static void tap_sock_unix_init(struct ctx *c)
ev.events = EPOLLIN | EPOLLET | EPOLLRDHUP;
epoll_ctl(c->epollfd, EPOLL_CTL_ADD, c->fd_tap_listen, &ev);
- info("You can now start qrap:");
- info(" ./qrap 5 kvm ... -net socket,fd=5 -net nic,model=virtio");
- info("or directly qemu, patched with:");
- info(" qemu/0001-net-Allow-also-UNIX-domain-sockets-to-be-used-as-net.patch");
- info("as follows:");
- info(" kvm ... -net socket,connect=%s -net nic,model=virtio",
+ info("You can now start qemu (>= 7.2, with commit 13c6be96618c):");
+ info(" kvm ... -device virtio-net-pci,netdev=s -netdev stream,id=s,server=off,addr.type=unix,addr.path=%s",
addr.sun_path);
+ info("or qrap, for earlier qemu versions:");
+ info(" ./qrap 5 kvm ... -net socket,fd=5 -net nic,model=virtio");
}
/**
--
@@ -943,13 +943,11 @@ static void tap_sock_unix_init(struct ctx *c)
ev.events = EPOLLIN | EPOLLET | EPOLLRDHUP;
epoll_ctl(c->epollfd, EPOLL_CTL_ADD, c->fd_tap_listen, &ev);
- info("You can now start qrap:");
- info(" ./qrap 5 kvm ... -net socket,fd=5 -net nic,model=virtio");
- info("or directly qemu, patched with:");
- info(" qemu/0001-net-Allow-also-UNIX-domain-sockets-to-be-used-as-net.patch");
- info("as follows:");
- info(" kvm ... -net socket,connect=%s -net nic,model=virtio",
+ info("You can now start qemu (>= 7.2, with commit 13c6be96618c):");
+ info(" kvm ... -device virtio-net-pci,netdev=s -netdev stream,id=s,server=off,addr.type=unix,addr.path=%s",
addr.sun_path);
+ info("or qrap, for earlier qemu versions:");
+ info(" ./qrap 5 kvm ... -net socket,fd=5 -net nic,model=virtio");
}
/**
--
2.35.1
prev parent reply other threads:[~2022-11-04 1:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 1:54 [PATCH 0/3] Prepare for native AF_UNIX socket support in qemu 7.2 Stefano Brivio
2022-11-04 1:54 ` [PATCH 1/3] test: Switch to qemu -netdev stream option instead of using qrap Stefano Brivio
2022-11-04 1:54 ` [PATCH 2/3] test/perf: Finally drop workaround for virtio_net TX stall Stefano Brivio
2022-11-04 1:54 ` Stefano Brivio [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221104015442.3831762-4-sbrivio@redhat.com \
--to=sbrivio@redhat.com \
--cc=abologna@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=lvivier@redhat.com \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).