Merge pull request #342 from shinji-s/devel

Fix umount timeout and failure to capture exception. Deal with config variable rename
pull/344/head
multibootusb 6 years ago committed by GitHub
commit 4cd19be0ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,7 +47,7 @@ class Qemu(QtWidgets.QMainWindow, Ui_MainWindow):
bios = getattr(config, 'qemu_bios', None)
if bios:
options.extend(['-bios', bios])
if platform.system()=='Linux' and getattr(config,'use_kvm', True):
if platform.system()=='Linux' and getattr(config,'qemu_use_kvm', True):
options.append('-enable-kvm')
cmd = [qemu] + options + qemu_more_params

@ -458,14 +458,14 @@ class UnmountedContext:
self.assert_no_access()
try:
gen.log("Unmounting %s" % self.usb_disk)
os.sync() # This is needed because UDISK.unmount() can timeout.
UDISKS.unmount(self.usb_disk)
except dbus.exceptions.DBusException:
except dbus.exceptions.DBusException as e:
gen.log("Unmount of %s has failed." % self.usb_disk)
# This may get the partition mounted. Don't call!
# self.exit_callback(details(self.usb_disk))
raise UnmountError(e)
gen.log("Unmounted %s" % self.usb_disk)
os.sync()
return self
def __exit__(self, type, value, traceback_):

Loading…
Cancel
Save