]> code.ossystems Code Review - openembedded-core.git/commitdiff
runqemu: add user mode (SLIRP) support to x86 QEMU targets
authorTodor Minchev <todor.minchev@linux.intel.com>
Wed, 26 Oct 2016 17:05:59 +0000 (10:05 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 6 Nov 2016 23:35:21 +0000 (23:35 +0000)
Using 'slirp' as a command line option to runqemu will start QEMU
with user mode networking instead of creating tun/tap devices.
SLIRP does not require root access. By default port 2222 on the
host will be mapped to port 22 in the guest. The default port
mapping can be overwritten with the QB_SLIRP_OPT variable e.g.

QB_SLIRP_OPT = "-net nic,model=e1000 -net user,hostfwd=tcp::2222-:22"

Signed-off-by: Todor Minchev <todor.minchev@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/conf/machine/include/qemuboot-x86.inc
scripts/runqemu

index 06ac983d4d9411115fb5b04b41b2854a21a66b98..08702948e44eec00da6c7194c555c569cb92fc89 100644 (file)
@@ -13,3 +13,4 @@ QB_AUDIO_OPT = "-soundhw ac97,es1370"
 QB_KERNEL_CMDLINE_APPEND = "vga=0 uvesafb.mode_option=640x480-32 oprofile.timer=1 uvesafb.task_timeout=-1"
 # Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
 QB_OPT_APPEND = "-vga vmware -show-cursor -usb -usbdevice tablet -device virtio-rng-pci"
+QB_SLIRP_OPT = "-net nic,model=e1000 -net user,hostfwd=tcp::2222-:22"
index dbe17abfc586da8ca1670d46c731dc6575f0c848..6952f3210b577030a538db321465e01d4b1d526d 100755 (executable)
@@ -542,7 +542,8 @@ class BaseConfig(object):
     def check_and_set(self):
         """Check configs sanity and set when needed"""
         self.validate_paths()
-        check_tun()
+        if not self.slirp_enabled:
+            check_tun()
         # Check audio
         if self.audio_enabled:
             if not self.get('QB_AUDIO_DRV'):