summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-06 14:46:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-09 12:07:32 +0100
commitd1cb381977840a8b9dc0bc2c824e7a2d0c627ef3 (patch)
treebd3cae58fdd59f03e0a925310c7eac3b34fb285c /scripts/runqemu
parent95331c6d4e5a478cfb7a90b91fefeac06f57a4ac (diff)
downloadpoky-d1cb381977840a8b9dc0bc2c824e7a2d0c627ef3.tar.gz
runqemu: Allow unique network interface MAC addresses
Current qemu instances all share the same MAC address. This shouldn't be an issue as they are all on separate network interfaces, however on the slight chance this is causing problems, its easy enough to ensure we use unique MAC addresses based on the IP numbers we assign. (From OE-Core rev: c01962bf88786dd84ad83cc1d315297607d29f7c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 91e72cbc50..c43db8c227 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -736,11 +736,12 @@ class BaseConfig(object):
736 if self.fstype == 'nfs': 736 if self.fstype == 'nfs':
737 self.setup_nfs() 737 self.setup_nfs()
738 self.kernel_cmdline_script += " ip=192.168.7.%s::192.168.7.%s:255.255.255.0" % (n2, n1) 738 self.kernel_cmdline_script += " ip=192.168.7.%s::192.168.7.%s:255.255.255.0" % (n2, n1)
739 mac = "52:54:00:12:34:%02x" % n2
739 qb_tap_opt = self.get('QB_TAP_OPT') 740 qb_tap_opt = self.get('QB_TAP_OPT')
740 if qb_tap_opt: 741 if qb_tap_opt:
741 qemu_tap_opt = qb_tap_opt.replace('@TAP@', tap) 742 qemu_tap_opt = qb_tap_opt.replace('@TAP@', tap).replace('@MAC@', mac)
742 else: 743 else:
743 qemu_tap_opt = "-net nic,model=virtio -net tap,vlan=0,ifname=%s,script=no,downscript=no" % self.tap 744 qemu_tap_opt = "-net nic,model=virtio,mac=%s -net tap,vlan=0,ifname=%s,script=no,downscript=no" % (mac, self.tap)
744 745
745 if self.vhost_enabled: 746 if self.vhost_enabled:
746 qemu_tap_opt += ',vhost=on' 747 qemu_tap_opt += ',vhost=on'