From 96199058d16ca34180718f9116c40a49277bdeb0 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 25 Sep 2012 00:23:35 +0200 Subject: [PATCH] dom0/core: wait for user session on HVM start (#31 pro) --- dom0/qvm-core/qubes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index b407d2bd..e61b8541 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -2473,6 +2473,16 @@ class QubesHVm(QubesVm): if self.qrexec_installed: super(QubesHVm, self).start_qrexec_daemon(**kwargs) + if kwargs.get('verbose'): + print >> sys.stderr, "--> Waiting for user '%s' login..." % self.default_user + + p = self.run('SYSTEM:QUBESRPC qubes.WaitForSession', passio_popen=True, gui=False, wait=True) + p.communicate(input=self.default_user) + + retcode = subprocess.call([qubes_clipd_path]) + if retcode != 0: + print >> sys.stderr, "ERROR: Cannot start qclipd!" + def pause(self): if dry_run: return