Merge branch 'master' of git.qubes-os.org:/var/lib/qubes/git/marmarek/core

This commit is contained in:
Joanna Rutkowska 2011-04-08 22:50:57 +02:00
commit b9f6962716
2 changed files with 21 additions and 15 deletions

View File

@ -123,6 +123,7 @@ def main():
files_to_backup += file_to_backup(vm.conf_file)
if vm.is_updateable():
files_to_backup += file_to_backup(vm.dir_path + "/apps")
files_to_backup += file_to_backup(vm.dir_path + "/kernels")
if os.path.exists (vm.firewall_conf):
files_to_backup += file_to_backup(vm.firewall_conf)

View File

@ -57,6 +57,24 @@ def actually_execute(domid, cmd, options):
args += ["-e"]
subprocess.call(args)
def start_guid(vm, options):
if options.verbose:
print "--> Starting Qubes GUId..."
xid = vm.get_xid()
retcode = subprocess.call ([qubes_guid_path, "-d", str(xid), "-c", vm.label.color, "-i", vm.label.icon, "-l", str(vm.label.index)])
if (retcode != 0) :
print "ERROR: Cannot start qubes_guid!"
if options.tray:
tray_notify_error ("ERROR: Cannot start qubes_guid!")
exit (1)
if options.verbose:
print "--> Waiting for qubes-session..."
subprocess.call([qrexec_client_path, "-d", str(xid), "user:echo $$ >> /tmp/qubes-session-waiter; [ ! -f /tmp/qubes-session-env ] && exec sleep 365d"])
def vm_run_cmd(vm, cmd, options):
if options.shutdown:
if options.verbose:
@ -103,27 +121,14 @@ def vm_run_cmd(vm, cmd, options):
exit (1)
if os.getenv("DISPLAY") is not None:
if options.verbose:
print "--> Starting Qubes GUId..."
retcode = subprocess.call ([qubes_guid_path, "-d", str(xid), "-c", vm.label.color, "-i", vm.label.icon, "-l", str(vm.label.index)])
if (retcode != 0) :
print "ERROR: Cannot start qubes_guid!"
if options.tray:
tray_notify_error ("ERROR: Cannot start qubes_guid!")
exit (1)
start_guid(vm, options)
actually_execute(str(xid), cmd, options);
else: # VM already running...
xid = vm.get_xid()
if os.getenv("DISPLAY") is not None and not os.path.isfile("/var/run/qubes/guid_running.{0}".format(xid)):
retcode = subprocess.call ([qubes_guid_path, "-d", str(xid), "-c", vm.label.color, "-i", vm.label.icon, "-l", str(vm.label.index)])
if (retcode != 0) :
print "ERROR: Cannot start qubes_guid!"
if options.tray:
tray_notify_error ("ERROR: Cannot start the GUI daemon for this VM!")
exit (1)
start_guid(vm, options)
actually_execute(str(xid), cmd, options);
def main():