hvm: always use qrexec for clipboard operations

This is temporary solution until Windows GUI agent will handle
MSG_CLIPBOARD_* commands.

Also fix code style - wrap long lines
This commit is contained in:
Marek Marczykowski-Górecki 2013-12-02 03:30:26 +01:00
parent e9f08aefd7
commit 4ce3acd64d
2 changed files with 14 additions and 5 deletions

View File

@ -1437,12 +1437,17 @@ class QubesVm(object):
p = self.run('QUBESRPC qubes.WaitForSession none', user="root", passio_popen=True, gui=False, wait=True)
p.communicate(input=self.default_user)
def start_guid(self, verbose = True, notify_function = None):
def start_guid(self, verbose = True, notify_function = None, extra_guid_args=[]):
if verbose:
print >> sys.stderr, "--> Starting Qubes GUId..."
xid = self.get_xid()
guid_cmd = [system_path["qubes_guid_path"], "-d", str(xid), "-c", self.label.color, "-i", self.label.icon_path, "-l", str(self.label.index)]
guid_cmd = [system_path["qubes_guid_path"],
"-d", str(xid),
"-c", self.label.color,
"-i", self.label.icon_path,
"-l", str(self.label.index)]
guid_cmd += extra_guid_args
if self.debug:
guid_cmd += ['-v', '-v']
retcode = subprocess.call (guid_cmd)

View File

@ -325,15 +325,19 @@ class QubesHVm(QubesVm):
else:
raise
def start_guid(self, verbose = True, notify_function = None):
def start_guid(self, verbose = True, notify_function = None, **kwargs):
# If user force the guiagent, start_guid will mimic a standard QubesVM
if self.guiagent_installed:
super(QubesHVm, self).start_guid(verbose, notify_function)
super(QubesHVm, self).start_guid(verbose, notify_function, extra_guid_args=["-Q"], **kwargs)
else:
if verbose:
print >> sys.stderr, "--> Starting Qubes GUId..."
retcode = subprocess.call ([system_path["qubes_guid_path"], "-d", str(self.stubdom_xid), "-c", self.label.color, "-i", self.label.icon_path, "-l", str(self.label.index)])
retcode = subprocess.call ([system_path["qubes_guid_path"],
"-d", str(self.stubdom_xid),
"-c", self.label.color,
"-i", self.label.icon_path,
"-l", str(self.label.index)])
if (retcode != 0) :
raise QubesException("Cannot start qubes-guid!")