Merge branch 'master' of git.qubes-os.org:/var/lib/qubes/git/marmarek/core
This commit is contained in:
		
						commit
						617656cd2a
					
				@ -1286,7 +1286,7 @@ class QubesVm(object):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        return conf
 | 
					        return conf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def run(self, command, verbose = True, autostart = False, notify_function = None, passio = False, passio_popen = False, localcmd = None, wait = False):
 | 
					    def run(self, command, verbose = True, autostart = False, notify_function = None, passio = False, passio_popen = False, localcmd = None, wait = False, gui = True):
 | 
				
			||||||
        """command should be in form 'user:cmdline'"""
 | 
					        """command should be in form 'user:cmdline'"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if not self.is_running():
 | 
					        if not self.is_running():
 | 
				
			||||||
@ -1306,7 +1306,7 @@ class QubesVm(object):
 | 
				
			|||||||
                raise QubesException("Not enough memory to start '{0}' VM! Close one or more running VMs and try again.".format(self.name))
 | 
					                raise QubesException("Not enough memory to start '{0}' VM! Close one or more running VMs and try again.".format(self.name))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        xid = self.get_xid()
 | 
					        xid = self.get_xid()
 | 
				
			||||||
        if os.getenv("DISPLAY") is not None and not self.is_guid_running():
 | 
					        if gui and os.getenv("DISPLAY") is not None and not self.is_guid_running():
 | 
				
			||||||
            self.start_guid(verbose = verbose, notify_function = notify_function)
 | 
					            self.start_guid(verbose = verbose, notify_function = notify_function)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        args = [qrexec_client_path, "-d", str(xid), command]
 | 
					        args = [qrexec_client_path, "-d", str(xid), command]
 | 
				
			||||||
@ -1983,10 +1983,7 @@ class QubesProxyVm(QubesNetVm):
 | 
				
			|||||||
        vms = [vm for vm in self.connected_vms.values()]
 | 
					        vms = [vm for vm in self.connected_vms.values()]
 | 
				
			||||||
        for vm in vms:
 | 
					        for vm in vms:
 | 
				
			||||||
            iptables="*filter\n"
 | 
					            iptables="*filter\n"
 | 
				
			||||||
            if vm.has_firewall():
 | 
					            conf = vm.get_firewall_conf()
 | 
				
			||||||
                conf = vm.get_firewall_conf()
 | 
					 | 
				
			||||||
            else:
 | 
					 | 
				
			||||||
                conf = { "rules": list(), "allow": True, "allowDns": True, "allowIcmp": True, "allowYumProxy": False }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            xid = vm.get_xid()
 | 
					            xid = vm.get_xid()
 | 
				
			||||||
            if xid < 0: # VM not active ATM
 | 
					            if xid < 0: # VM not active ATM
 | 
				
			||||||
 | 
				
			|||||||
@ -85,7 +85,7 @@ def vm_run_cmd(vm, cmd, options):
 | 
				
			|||||||
        return vm.run(cmd, autostart = options.auto,
 | 
					        return vm.run(cmd, autostart = options.auto,
 | 
				
			||||||
            verbose = options.verbose,
 | 
					            verbose = options.verbose,
 | 
				
			||||||
            notify_function = tray_notify_generic if options.tray else None,
 | 
					            notify_function = tray_notify_generic if options.tray else None,
 | 
				
			||||||
            passio = options.passio, localcmd = options.localcmd)
 | 
					            passio = options.passio, localcmd = options.localcmd, gui = options.gui)
 | 
				
			||||||
    except QubesException as err:
 | 
					    except QubesException as err:
 | 
				
			||||||
        if options.tray:
 | 
					        if options.tray:
 | 
				
			||||||
            tray_notify_error(str(err))
 | 
					            tray_notify_error(str(err))
 | 
				
			||||||
@ -130,6 +130,9 @@ def main():
 | 
				
			|||||||
    parser.add_option ("--force", action="store_true", dest="force", default=False,
 | 
					    parser.add_option ("--force", action="store_true", dest="force", default=False,
 | 
				
			||||||
                      help="Force operation, even if may damage other VMs (eg shutdown of NetVM)")
 | 
					                      help="Force operation, even if may damage other VMs (eg shutdown of NetVM)")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    parser.add_option ("--nogui", action="store_false", dest="gui", default=True,
 | 
				
			||||||
 | 
					                      help="Run command without gui")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    (options, args) = parser.parse_args ()
 | 
					    (options, args) = parser.parse_args ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -91,7 +91,8 @@ def main():
 | 
				
			|||||||
                print >> sys.stderr, '--> Syncing \'%s\' clock.' % vm.name
 | 
					                print >> sys.stderr, '--> Syncing \'%s\' clock.' % vm.name
 | 
				
			||||||
            try:
 | 
					            try:
 | 
				
			||||||
                vm.run('root:date -u -s "%s"' % date_out, verbose=verbose)
 | 
					                vm.run('root:date -u -s "%s"' % date_out, verbose=verbose)
 | 
				
			||||||
            except NotImplementedError:
 | 
					            except Exception as e:
 | 
				
			||||||
 | 
					                print >> sys.stderr, "ERROR syncing time in VM '%s': %s" % (vm.name, str(e))
 | 
				
			||||||
                pass
 | 
					                pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
main()
 | 
					main()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user