Skip to content

Commit 330ad56

Browse files
committed
Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging
trivial patches for 2025-03-21 # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCgAdFiEEZKoqtTHVaQM2a/75gqpKJDselHgFAmfdIHgACgkQgqpKJDse # lHgPChAAmwahVIuN3PQOEZxCYC91vwB7hu1ANCF1C96YIP1A4ybCeglkEtUPLgZn # Jn7u5xzyOaIG5chlRxrc6mEq/AbYPj3N76rcBpX1XZiCabI7kqkiPShrOXL0FEK/ # +ULGv50D8cPMYHBWKrlgUOXo3LLrXDw4ct0DwdGDSy4O13raN2yAxnmui2KADnfX # 9jszAspeELWgMXStBqobzMNL2SZy2n0BXBYMGWyrUOrzs0zDmQ0p5z12NwlN+ecg # vChAF83Rk96rMRJ1Mx9Ewaf5ydAs1OwZk1HQO72+jKabUrJM111w/EJABPJFv9pY # jhJgbQjUxXFmEdKHWtbrExrSAPOjzRlxG3Z3WDnM+W6zLrI7siDgxNrGbEuDo9ve # 4DT8ldUuRkr4d1SwUq257RGu+qzTm2WvW7mkraCt+0NAPQNCZ22oZM7E79uKKv81 # 2XNKWr/0uElgUVgb+wOh0IWcCt8PDV4dkM8ivGNFmbP+z7+ckIJtXtWpD7/sHIzb # zlMyUtbk7iDDqP7IwOiB19alcKHojOTeyXQAs/eZmnR8K0Rh6DaBYs5pMmVgou38 # 746POQteXsf78KzXCBG88WqbbI1cxZH8me9byFB9BRlTTVG/qo90OIzk+/A1x7uv # 4uiVuzMcBtV3fp6r47V5Ru2HGonZAuaTbzTcWeJJ6rPm23MGNXg= # =nng2 # -----END PGP SIGNATURE----- # gpg: Signature made Fri 21 Mar 2025 04:16:56 EDT # gpg: using RSA key 64AA2AB531D56903366BFEF982AA4A243B1E9478 # gpg: Good signature from "Michael Tokarev <[email protected]>" [unknown] # gpg: aka "Michael Tokarev <[email protected]>" [unknown] # gpg: aka "Michael Tokarev <[email protected]>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 9D8B E14E 3F2A 9DD7 9199 28F1 61AD 3D98 ECDF 2C8E # Subkey fingerprint: 64AA 2AB5 31D5 6903 366B FEF9 82AA 4A24 3B1E 9478 * tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu: mailmap: Update email address for Akihiko Odaki docs: Explain how to use passt Makefile: "make dist" generates a .xz, not .bz2 Signed-off-by: Stefan Hajnoczi <[email protected]>
2 parents 3907add + a028e04 commit 330ad56

File tree

3 files changed

+104
-3
lines changed

3 files changed

+104
-3
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Andrey Drobyshev <[email protected]> Andrey Drobyshev via <qemu-blo
6767
BALATON Zoltan <[email protected]> BALATON Zoltan via <[email protected]>
6868

6969
# Next, replace old addresses by a more recent one.
70+
7071
Aleksandar Markovic <[email protected]> <[email protected]>
7172
Aleksandar Markovic <[email protected]> <[email protected]>
7273
Aleksandar Markovic <[email protected]> <[email protected]>

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ clean: recurse-clean
207207

208208
VERSION = $(shell cat $(SRC_PATH)/VERSION)
209209

210-
dist: qemu-$(VERSION).tar.bz2
210+
dist: qemu-$(VERSION).tar.xz
211211

212-
qemu-%.tar.bz2:
213-
$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)"
212+
qemu-%.tar.xz:
213+
$(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.xz,%,$@)"
214214

215215
distclean: clean recurse-distclean
216216
-$(quiet-@)test -f build.ninja && $(NINJA) $(NINJAFLAGS) -t clean -g || :

docs/system/devices/net.rst

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,106 @@ When using the ``'-netdev user,hostfwd=...'`` option, TCP or UDP
7777
connections can be redirected from the host to the guest. It allows for
7878
example to redirect X11, telnet or SSH connections.
7979

80+
Using passt as the user mode network stack
81+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82+
83+
passt_ can be used as a simple replacement for SLIRP (``-net user``).
84+
passt doesn't require any capability or privilege. passt has
85+
better performance than ``-net user``, full IPv6 support and better security
86+
as it's a daemon that is not executed in QEMU context.
87+
88+
passt can be connected to QEMU either by using a socket
89+
(``-netdev stream``) or using the vhost-user interface (``-netdev vhost-user``).
90+
See `passt(1)`_ for more details on passt.
91+
92+
.. _passt: https://passt.top/
93+
.. _passt(1): https://passt.top/builds/latest/web/passt.1.html
94+
95+
To use socket based passt interface:
96+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97+
98+
Start passt as a daemon::
99+
100+
passt --socket ~/passt.socket
101+
102+
If ``--socket`` is not provided, passt will print the path of the UNIX domain socket QEMU can connect to (``/tmp/passt_1.socket``, ``/tmp/passt_2.socket``,
103+
...). Then you can connect your QEMU instance to passt:
104+
105+
.. parsed-literal::
106+
|qemu_system| [...OPTIONS...] -device virtio-net-pci,netdev=netdev0 -netdev stream,id=netdev0,server=off,addr.type=unix,addr.path=~/passt.socket
107+
108+
Where ``~/passt.socket`` is the UNIX socket created by passt to
109+
communicate with QEMU.
110+
111+
To use vhost-based interface:
112+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
113+
114+
Start passt with ``--vhost-user``::
115+
116+
passt --vhost-user --socket ~/passt.socket
117+
118+
Then to connect QEMU:
119+
120+
.. parsed-literal::
121+
|qemu_system| [...OPTIONS...] -m $RAMSIZE -chardev socket,id=chr0,path=~/passt.socket -netdev vhost-user,id=netdev0,chardev=chr0 -device virtio-net,netdev=netdev0 -object memory-backend-memfd,id=memfd0,share=on,size=$RAMSIZE -numa node,memdev=memfd0
122+
123+
Where ``$RAMSIZE`` is the memory size of your VM ``-m`` and ``-object memory-backend-memfd,size=`` must match.
124+
125+
Migration of passt:
126+
^^^^^^^^^^^^^^^^^^^
127+
128+
When passt is connected to QEMU using the vhost-user interface it can
129+
be migrated with QEMU and the network connections are not interrupted.
130+
131+
As passt runs with no privileges, it relies on passt-repair to save and
132+
load the TCP connections state, using the TCP_REPAIR socket option.
133+
The passt-repair helper needs to have the CAP_NET_ADMIN capability, or run as root. If passt-repair is not available, TCP connections will not be preserved.
134+
135+
Example of migration of a guest on the same host
136+
________________________________________________
137+
138+
Before being able to run passt-repair, the CAP_NET_ADMIN capability must be set
139+
on the file, run as root::
140+
141+
setcap cap_net_admin+eip ./passt-repair
142+
143+
Start passt for the source side::
144+
145+
passt --vhost-user --socket ~/passt_src.socket --repair-path ~/passt-repair_src.socket
146+
147+
Where ``~/passt-repair_src.socket`` is the UNIX socket created by passt to
148+
communicate with passt-repair. The default value is the ``--socket`` path
149+
appended with ``.repair``.
150+
151+
Start passt-repair::
152+
153+
passt-repair ~/passt-repair_src.socket
154+
155+
Start source side QEMU with a monitor to be able to send the migrate command:
156+
157+
.. parsed-literal::
158+
|qemu_system| [...OPTIONS...] [...VHOST USER OPTIONS...] -monitor stdio
159+
160+
Start passt for the destination side::
161+
162+
passt --vhost-user --socket ~/passt_dst.socket --repair-path ~/passt-repair_dst.socket
163+
164+
Start passt-repair::
165+
166+
passt-repair ~/passt-repair_dst.socket
167+
168+
Start QEMU with the ``-incoming`` parameter:
169+
170+
.. parsed-literal::
171+
|qemu_system| [...OPTIONS...] [...VHOST USER OPTIONS...] -incoming tcp:localhost:4444
172+
173+
Then in the source guest monitor the migration can be started::
174+
175+
(qemu) migrate tcp:localhost:4444
176+
177+
A separate passt-repair instance must be started for every migration. In the case of a failed migration, passt-repair also needs to be restarted before trying
178+
again.
179+
80180
Hubs
81181
~~~~
82182

0 commit comments

Comments
 (0)