diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index b50961b7..f18437c8 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -1707,13 +1707,13 @@ class QubesVm(object): if qmemman_present: qmemman_client.close() - if self._start_guid_first and start_guid and not preparing_dvm and os.path.exists('/var/run/shm.id'): + 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) if not preparing_dvm: 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) return xid diff --git a/dispvm/qubes-prepare-saved-domain.sh b/dispvm/qubes-prepare-saved-domain.sh index 24c6307b..eb7dacca 100755 --- a/dispvm/qubes-prepare-saved-domain.sh +++ b/dispvm/qubes-prepare-saved-domain.sh @@ -25,10 +25,11 @@ if ! [ -d $VMDIR ] ; then echo "$VMDIR does not exist ?" >&2 exit 1 fi -if ! qvm-start $1 --no-guid --dvm ; then +if ! qvm-start $1 --dvm ; then exit 1 fi +ID=`virsh -c xen:/// domid $1` echo "Waiting for DVM $1 ..." >&2 if [ -n "$ENCODED_SCRIPT" ] ; then 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-read -d $1 /qubes-gateway | \ 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 virsh -c xen:/// detach-disk $1 xvdb MEM=$(qubesdb-read -d $1 /qubes-used-mem)