diff --git a/dom0/qvm-core/qubesutils.py b/dom0/qvm-core/qubesutils.py index b3a50d23..37ed1b00 100644 --- a/dom0/qvm-core/qubesutils.py +++ b/dom0/qvm-core/qubesutils.py @@ -260,7 +260,7 @@ def run_in_vm(vm, command, verbose = True, autostart = False, notify_function = if verbose: print >> sys.stderr, "Starting the VM '{0}'...".format(vm.name) if notify_function is not None: - notify_function ("info", "Starting the '{0}' VM...".format(vm.name), label=vm.label) + notify_function ("info", "Starting the '{0}' VM...".format(vm.name)) xid = vm.start(verbose=verbose) except (IOError, OSError, QubesException) as err: diff --git a/dom0/qvm-tools/qvm-run b/dom0/qvm-tools/qvm-run index c1bf1a3f..7b867a7c 100755 --- a/dom0/qvm-tools/qvm-run +++ b/dom0/qvm-tools/qvm-run @@ -47,12 +47,6 @@ def tray_notify(str, label, timeout = 3000): def tray_notify_error(str, timeout = 3000): notify_object.Notify("Qubes", 0, "dialog-error", "Qubes", str, [], [], timeout, dbus_interface="org.freedesktop.Notifications") -def tray_notify_generic(level, str): - if level == "info": - tray_notify(str) - elif level == "error": - tray_notify_error(str) - def vm_run_cmd(vm, cmd, options): if options.shutdown: if options.verbose: @@ -83,6 +77,12 @@ def vm_run_cmd(vm, cmd, options): print >> sys.stderr, "Running command on VM: '{0}'...".format(vm.name) try: + def tray_notify_generic(level, str): + if level == "info": + tray_notify(str, label=vm.label) + elif level == "error": + tray_notify_error(str) + return qubesutils.run_in_vm(vm, cmd, autostart = options.auto, verbose = options.verbose, notify_function = tray_notify_generic if options.tray else None,