[OE-core] [PATCH v2 1/1] runqemu: allow bypassing of network setup
Juro Bystricky
juro.bystricky at intel.com
Mon Jan 30 18:02:13 UTC 2017
At present it is silently assumed all QEMU machines support networking.
As a consequence, one cannot run QEMUs without network emulation
using "runqemu".
This patch allows bypassing any network setup providing the user
specifies:
QB_NETWORK_DEVICE = "none"
[YOCTO#10661]
Signed-off-by: Juro Bystricky <juro.bystricky at intel.com>
---
meta/classes/qemuboot.bbclass | 3 ++-
scripts/runqemu | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/meta/classes/qemuboot.bbclass b/meta/classes/qemuboot.bbclass
index 3ca97ca..4deb201 100644
--- a/meta/classes/qemuboot.bbclass
+++ b/meta/classes/qemuboot.bbclass
@@ -36,8 +36,9 @@
# Note, runqemu will replace @MAC@ with a predefined mac, you can set
# a custom one, but that may cause conflicts when multiple qemus are
# running on the same host.
+# Set to "none" if qemu has no network support.
#
-# QB_TAP_OPT: netowrk option for 'tap' mode, e.g.,
+# QB_TAP_OPT: network option for 'tap' mode, e.g.,
# "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
# Note, runqemu will replace "@TAP@" with the one which is used, such as tap0, tap1 ...
#
diff --git a/scripts/runqemu b/scripts/runqemu
index 3d475d3..c846727 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -894,6 +894,9 @@ class BaseConfig(object):
self.set('NETWORK_CMD', '%s %s' % (self.network_device.replace('@MAC@', mac), qemu_tap_opt))
def setup_network(self):
+ if self.get('QB_NETWORK_DEVICE') == 'none':
+ return
+
cmd = "stty -g"
self.saved_stty = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8')
self.network_device = self.get('QB_NETWORK_DEVICE') or self.network_device
--
2.7.4
More information about the Openembedded-core
mailing list