qemu: add an option to enable user mode networking (SLIRP)
authorCarlos Santos <casantos@datacom.com.br>
Mon, 27 Aug 2018 20:15:01 +0000 (17:15 -0300)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 29 Aug 2018 19:49:16 +0000 (21:49 +0200)
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>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/qemu/Config.in
package/qemu/qemu.mk

index 13b615bfba4d5402a12a799547beb0f94072787f..61a2a1072e1471475e77d448defce319cb1f77d8 100644 (file)
@@ -54,8 +54,29 @@ 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 "Enable user mode networking (SLIRP)"
+       help
+         Enable 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 = ""
 
index aec803c1ae1a8735e58172f3a24f094ea35e0f51..afb2aa92f6e0e268a0342907ac49864b8f33e9d0 100644 (file)
@@ -55,6 +55,11 @@ endif
 
 endif
 
+# There is no "--enable-slirp"
+ifeq ($(BR2_PACKAGE_QEMU_SLIRP),)
+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 \