Skip to contentSkip to conversation

runqemu: disable network

PATCH Superseded Juro Bystricky 1 participant 2 messages Jan 25, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover runqemu: disable network

Not all QEMU machines support network hardware emulation.
Those machines cannot be run by "runqemu", as network hardware is implicitly always assumed. Trying to run them using "runqemu" would end up in raise Exception('Failed to run %s' % cmd)

There is no way to disable network setup using qemuboot.conf nor command line argument.

The patch for runqemu contains a simple fix that can disable the network using qemuboot.conf. The patch was written to be as non-invasive as possible, it should not break anything that is known to work.
(A slightly more complex patch could contain support for command line argument "nonetwork", similar to "nographic")

Juro Bystricky (1):
runqemu: allow bypassing of network setup

 scripts/runqemu | 2 ++
 1 file changed, 2 insertions(+)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 runqemu: allow bypassing of network setup

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 qemuboot.conf file contains:

qb_net = none

[YOCTO#10661]

---
 scripts/runqemu | 2 ++
 1 file changed, 2 insertions(+)
scripts/runqemu +2 -0
index 30e5346..26b9283 100755
@@ -894,6 +894,8 @@ 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_NET') == '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
Signature · 1 line
2.7.4