diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-06 14:46:10 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-09 12:06:54 +0100 |
commit | c01962bf88786dd84ad83cc1d315297607d29f7c (patch) | |
tree | aadaadb7200b0a842877aef83a8c03bee488ece3 /scripts | |
parent | 14bacf7203ab7a638b67eb143225d8c75bbb703d (diff) | |
download | openembedded-core-c01962bf88786dd84ad83cc1d315297607d29f7c.tar.gz openembedded-core-c01962bf88786dd84ad83cc1d315297607d29f7c.tar.bz2 openembedded-core-c01962bf88786dd84ad83cc1d315297607d29f7c.zip |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 5 |
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): if self.fstype == 'nfs': self.setup_nfs() self.kernel_cmdline_script += " ip=192.168.7.%s::192.168.7.%s:255.255.255.0" % (n2, n1) + mac = "52:54:00:12:34:%02x" % n2 qb_tap_opt = self.get('QB_TAP_OPT') if qb_tap_opt: - qemu_tap_opt = qb_tap_opt.replace('@TAP@', tap) + qemu_tap_opt = qb_tap_opt.replace('@TAP@', tap).replace('@MAC@', mac) else: - qemu_tap_opt = "-net nic,model=virtio -net tap,vlan=0,ifname=%s,script=no,downscript=no" % self.tap + qemu_tap_opt = "-net nic,model=virtio,mac=%s -net tap,vlan=0,ifname=%s,script=no,downscript=no" % (mac, self.tap) if self.vhost_enabled: qemu_tap_opt += ',vhost=on' |