summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/runqemu29
1 files changed, 13 insertions, 16 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 56715c3e1e..cef5b8d4a4 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1087,6 +1087,17 @@ to your build configuration.
1087 self.set('NETWORK_CMD', '-netdev bridge,br=%s,id=net0,helper=%s -device virtio-net-pci,netdev=net0 ' % ( 1087 self.set('NETWORK_CMD', '-netdev bridge,br=%s,id=net0,helper=%s -device virtio-net-pci,netdev=net0 ' % (
1088 self.net_bridge, os.path.join(self.bindir_native, 'qemu-oe-bridge-helper'))) 1088 self.net_bridge, os.path.join(self.bindir_native, 'qemu-oe-bridge-helper')))
1089 1089
1090 def make_lock_dir(self, lockdir):
1091 if not os.path.exists(lockdir):
1092 # There might be a race issue when multi runqemu processess are
1093 # running at the same time.
1094 try:
1095 os.mkdir(lockdir)
1096 os.chmod(lockdir, 0o777)
1097 except FileExistsError:
1098 pass
1099 return
1100
1090 def setup_slirp(self): 1101 def setup_slirp(self):
1091 """Setup user networking""" 1102 """Setup user networking"""
1092 1103
@@ -1105,14 +1116,7 @@ to your build configuration.
1105 mac = 2 1116 mac = 2
1106 1117
1107 lockdir = "/tmp/qemu-port-locks" 1118 lockdir = "/tmp/qemu-port-locks"
1108 if not os.path.exists(lockdir): 1119 self.make_lock_dir(lockdir)
1109 # There might be a race issue when multi runqemu processess are
1110 # running at the same time.
1111 try:
1112 os.mkdir(lockdir)
1113 os.chmod(lockdir, 0o777)
1114 except FileExistsError:
1115 pass
1116 1120
1117 # Find a free port to avoid conflicts 1121 # Find a free port to avoid conflicts
1118 for p in ports[:]: 1122 for p in ports[:]:
@@ -1152,14 +1156,7 @@ to your build configuration.
1152 logger.error("ip: %s" % ip) 1156 logger.error("ip: %s" % ip)
1153 raise OEPathError("runqemu-ifup, runqemu-ifdown or ip not found") 1157 raise OEPathError("runqemu-ifup, runqemu-ifdown or ip not found")
1154 1158
1155 if not os.path.exists(lockdir): 1159 self.make_lock_dir(lockdir)
1156 # There might be a race issue when multi runqemu processess are
1157 # running at the same time.
1158 try:
1159 os.mkdir(lockdir)
1160 os.chmod(lockdir, 0o777)
1161 except FileExistsError:
1162 pass
1163 1160
1164 cmd = (ip, 'link') 1161 cmd = (ip, 'link')
1165 logger.debug('Running %s...' % str(cmd)) 1162 logger.debug('Running %s...' % str(cmd))