diff options
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-x | scripts/runqemu | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index f061917c4b..ef454d67ff 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -1121,7 +1121,11 @@ class BaseConfig(object): | |||
1121 | uid = os.getuid() | 1121 | uid = os.getuid() |
1122 | logger.info("Setting up tap interface under sudo") | 1122 | logger.info("Setting up tap interface under sudo") |
1123 | cmd = ('sudo', self.qemuifup, str(uid), str(gid), self.bindir_native) | 1123 | cmd = ('sudo', self.qemuifup, str(uid), str(gid), self.bindir_native) |
1124 | tap = subprocess.check_output(cmd).decode('utf-8').strip() | 1124 | try: |
1125 | tap = subprocess.check_output(cmd).decode('utf-8').strip() | ||
1126 | except subprocess.CalledProcessError as e: | ||
1127 | logger.error('Setting up tap device failed:\n%s\nRun runqemu-gen-tapdevs to manually create one.' % str(e)) | ||
1128 | sys.exit(1) | ||
1125 | lockfile = os.path.join(lockdir, tap) | 1129 | lockfile = os.path.join(lockdir, tap) |
1126 | self.taplock = lockfile + '.lock' | 1130 | self.taplock = lockfile + '.lock' |
1127 | self.acquire_taplock() | 1131 | self.acquire_taplock() |
@@ -1130,7 +1134,7 @@ class BaseConfig(object): | |||
1130 | 1134 | ||
1131 | if not tap: | 1135 | if not tap: |
1132 | logger.error("Failed to setup tap device. Run runqemu-gen-tapdevs to manually create.") | 1136 | logger.error("Failed to setup tap device. Run runqemu-gen-tapdevs to manually create.") |
1133 | return 1 | 1137 | sys.exit(1) |
1134 | self.tap = tap | 1138 | self.tap = tap |
1135 | tapnum = int(tap[3:]) | 1139 | tapnum = int(tap[3:]) |
1136 | gateway = tapnum * 2 + 1 | 1140 | gateway = tapnum * 2 + 1 |