Merge branch 'dispvm-speedup3'
This commit is contained in:
commit
74d90a2886
@ -1578,6 +1578,9 @@ class QubesVm(object):
|
|||||||
if (retcode != 0) :
|
if (retcode != 0) :
|
||||||
raise QubesException("Cannot start qubes-guid!")
|
raise QubesException("Cannot start qubes-guid!")
|
||||||
|
|
||||||
|
if not self.is_qrexec_running():
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import qubes.monitorlayoutnotify
|
import qubes.monitorlayoutnotify
|
||||||
if verbose:
|
if verbose:
|
||||||
@ -1707,14 +1710,22 @@ class QubesVm(object):
|
|||||||
if qmemman_present:
|
if qmemman_present:
|
||||||
qmemman_client.close()
|
qmemman_client.close()
|
||||||
|
|
||||||
if self._start_guid_first and start_guid and not preparing_dvm and os.path.exists('/var/run/shm.id'):
|
extra_guid_args = None
|
||||||
self.start_guid(verbose=verbose, notify_function=notify_function, before_qrexec=True)
|
if preparing_dvm:
|
||||||
|
# Run GUI daemon in "invisible" mode, so applications started by
|
||||||
|
# prerun script will not disturb the user
|
||||||
|
extra_guid_args = ['-I']
|
||||||
|
|
||||||
|
if self._start_guid_first and start_guid and os.path.exists('/var/run/shm.id'):
|
||||||
|
self.start_guid(verbose=verbose, notify_function=notify_function,
|
||||||
|
before_qrexec=True, extra_guid_args=extra_guid_args)
|
||||||
|
|
||||||
if not preparing_dvm:
|
if not preparing_dvm:
|
||||||
self.start_qrexec_daemon(verbose=verbose,notify_function=notify_function)
|
self.start_qrexec_daemon(verbose=verbose,notify_function=notify_function)
|
||||||
|
|
||||||
if start_guid and not preparing_dvm and os.path.exists('/var/run/shm.id'):
|
if start_guid and os.path.exists('/var/run/shm.id'):
|
||||||
self.start_guid(verbose=verbose, notify_function=notify_function)
|
self.start_guid(verbose=verbose, notify_function=notify_function,
|
||||||
|
extra_guid_args=extra_guid_args)
|
||||||
|
|
||||||
return xid
|
return xid
|
||||||
|
|
||||||
|
@ -117,6 +117,12 @@ class QubesDisposableVm(QubesVm):
|
|||||||
attrs['privatedev'] = ''
|
attrs['privatedev'] = ''
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
|
|
||||||
|
def create_xenstore_entries(self, xid):
|
||||||
|
super(QubesDisposableVm, self).create_xenstore_entries(xid)
|
||||||
|
|
||||||
|
self.qdb.write('/qubes-restore-complete', '1')
|
||||||
|
|
||||||
def start(self, verbose = False, **kwargs):
|
def start(self, verbose = False, **kwargs):
|
||||||
self.log.debug('start()')
|
self.log.debug('start()')
|
||||||
if dry_run:
|
if dry_run:
|
||||||
|
@ -25,10 +25,11 @@ if ! [ -d $VMDIR ] ; then
|
|||||||
echo "$VMDIR does not exist ?" >&2
|
echo "$VMDIR does not exist ?" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ! qvm-start $1 --no-guid --dvm ; then
|
if ! qvm-start $1 --dvm ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ID=`virsh -c xen:/// domid $1`
|
||||||
echo "Waiting for DVM $1 ..." >&2
|
echo "Waiting for DVM $1 ..." >&2
|
||||||
if [ -n "$ENCODED_SCRIPT" ] ; then
|
if [ -n "$ENCODED_SCRIPT" ] ; then
|
||||||
qubesdb-write -d $1 /qubes-save-script "$ENCODED_SCRIPT"
|
qubesdb-write -d $1 /qubes-save-script "$ENCODED_SCRIPT"
|
||||||
@ -38,6 +39,7 @@ qubesdb-write -d $1 /qubes-save-request 1
|
|||||||
qubesdb-watch -d $1 /qubes-used-mem
|
qubesdb-watch -d $1 /qubes-used-mem
|
||||||
qubesdb-read -d $1 /qubes-gateway | \
|
qubesdb-read -d $1 /qubes-gateway | \
|
||||||
cut -d . -f 3 | tr -d "\n" > $VMDIR/netvm-id.txt
|
cut -d . -f 3 | tr -d "\n" > $VMDIR/netvm-id.txt
|
||||||
|
kill `cat /var/run/qubes/guid-running.$ID`
|
||||||
# FIXME: get connection URI from core scripts
|
# FIXME: get connection URI from core scripts
|
||||||
virsh -c xen:/// detach-disk $1 xvdb
|
virsh -c xen:/// detach-disk $1 xvdb
|
||||||
MEM=$(qubesdb-read -d $1 /qubes-used-mem)
|
MEM=$(qubesdb-read -d $1 /qubes-used-mem)
|
||||||
|
@ -512,6 +512,7 @@ class TC_20_DispVM(qubes.tests.SystemTestsMixin, qubes.tests.QubesTestCase):
|
|||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
||||||
'windowactivate', 'type', 'test test 2\n'])
|
'windowactivate', 'type', 'test test 2\n'])
|
||||||
|
time.sleep(0.5)
|
||||||
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
subprocess.check_call(['xdotool', 'search', '--name', window_title,
|
||||||
'key', 'ctrl+s', 'ctrl+q'])
|
'key', 'ctrl+s', 'ctrl+q'])
|
||||||
p.wait()
|
p.wait()
|
||||||
|
Loading…
Reference in New Issue
Block a user