* [Buildroot] [PATCH/next] qemu: add an option to enable user mode networking (SLIRP)
@ 2018-08-27 20:15 Carlos Santos
2018-08-29 20:04 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Carlos Santos @ 2018-08-27 20:15 UTC (permalink / raw)
To: buildroot
User mode networking is a useful feature that does not depend on other
packages. Add an option to enable it but keep it disabled by default,
for backwards compatibility.
Signed-off-by: Carlos Santos <casantos@datacom.com.br>
---
package/qemu/Config.in | 24 ++++++++++++++++++++++--
package/qemu/qemu.mk | 6 +++++-
2 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/package/qemu/Config.in b/package/qemu/Config.in
index 13b615bfba..44545ded60 100644
--- a/package/qemu/Config.in
+++ b/package/qemu/Config.in
@@ -54,8 +54,28 @@ config BR2_PACKAGE_QEMU_CUSTOM_TARGETS
x86_64-softmmu | sparc-bsd-user
... | ...
-config QEMU_FOO
- bool # To break the indentation
+comment "Networking options"
+
+config BR2_PACKAGE_QEMU_SLIRP
+ bool "Keep user mode networking (SLIRP)"
+ help
+ Keep user mode network stack, which is the default networking
+ backend. It requires no administrator privileges and generally
+ is the easiest to use but has some limitations:
+
+ - there is a lot of overhead so the performance is poor;
+ - in general ICMP does not work (can't ping from/to a guest)
+ - on Linux hosts, ping does work from within the guest, but it
+ needs initial setup by root (once per host)
+ - the guest is not directly accessible from the host or the
+ external network
+
+ User Networking is implemented using "slirp", which provides a
+ full TCP/IP stack within QEMU and uses that stack to implement
+ a virtual NAT'd network.
+
+ Notice that this option does not disable other networking
+ modes.
if BR2_PACKAGE_QEMU_CUSTOM_TARGETS = ""
diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
index aec803c1ae..016e3311a7 100644
--- a/package/qemu/qemu.mk
+++ b/package/qemu/qemu.mk
@@ -55,6 +55,11 @@ endif
endif
+# There is no "--enable-slirp"
+ifneq ($(BR2_PACKAGE_QEMU_SLIRP),y)
+QEMU_OPTS += --disable-slirp
+endif
+
ifeq ($(BR2_PACKAGE_QEMU_SDL),y)
QEMU_OPTS += --enable-sdl
QEMU_DEPENDENCIES += sdl
@@ -101,7 +106,6 @@ define QEMU_CONFIGURE_CMDS
--enable-vhost-net \
--disable-bsd-user \
--disable-xen \
- --disable-slirp \
--disable-vnc \
--disable-virtfs \
--disable-brlapi \
--
2.14.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH/next] qemu: add an option to enable user mode networking (SLIRP)
2018-08-27 20:15 [Buildroot] [PATCH/next] qemu: add an option to enable user mode networking (SLIRP) Carlos Santos
@ 2018-08-29 20:04 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2018-08-29 20:04 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 27 Aug 2018 17:15:01 -0300, Carlos Santos wrote:
> User mode networking is a useful feature that does not depend on other
> packages. Add an option to enable it but keep it disabled by default,
> for backwards compatibility.
>
> Signed-off-by: Carlos Santos <casantos@datacom.com.br>
I've applied to next, with some minor tweaks, see below.
> +config BR2_PACKAGE_QEMU_SLIRP
> + bool "Keep user mode networking (SLIRP)"
I understand you want to use "Keep" because SLIRP is normally enabled
by default in Qemu, and enabling this option allows to "keep" it.
However, I don't think such details really need to surface up to the
Config.in option prompts, so I've changed "Keep" to "Enable".
Indeed, if the option is selected, SLIRP support is enabled, if the
option is not selected SLIRP support is disabled.
> + help
> + Keep user mode network stack, which is the default networking
I've changed Keep to Enable here as well.
> +# There is no "--enable-slirp"
> +ifneq ($(BR2_PACKAGE_QEMU_SLIRP),y)
and used positive logic here:
ifeq ($(BR2_PACKAGE_QEMU_SLIRP),)
Applied to next with those changes. Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-29 20:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-27 20:15 [Buildroot] [PATCH/next] qemu: add an option to enable user mode networking (SLIRP) Carlos Santos
2018-08-29 20:04 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox