dispvm: when updating savefile on demand, present zenity progress bar

This commit is contained in:
Rafal Wojtczuk 2011-07-26 16:36:59 +02:00
parent dc4d9b32f1
commit 3df2e9783d
3 changed files with 17 additions and 2 deletions

View File

@ -109,8 +109,7 @@ class QfileDaemonDvm:
def get_dvm(self):
if not self.dvm_setup_ok():
self.tray_notify("Updating DisposableVM savefile, please wait", 120000)
if os.system("qvm-create-default-dvm --default-template --default-script >/var/run/qubes/qvm-create-default-dvm.stdout </dev/null" ) != 0:
if os.system("/usr/lib/qubes/qubes_update_dispvm_savefile_with_progress.sh >/dev/null </dev/null" ) != 0:
self.tray_notify_error("DVM savefile creation failed")
return None
return self.do_get_dvm()

View File

@ -0,0 +1,14 @@
#!/bin/sh
trap "exit 1" USR1 TERM
export SHELL_PID=$$
(
echo "1"
if ! qvm-create-default-dvm --default-template --default-script >/var/run/qubes/qvm-create-default-dvm.stdout </dev/null ; then
kill -USR1 $SHELL_PID
fi
echo 100
) | zenity --progress --pulsate --auto-close \
--text="Please wait (up to 120s) while the DispVM savefile is being updated. This only happens when you have updated the template, next time will be much faster." \
--title="Updating default DispVM savefile"
exit 0

View File

@ -117,6 +117,7 @@ cp restore/qvm-create-default-dvm $RPM_BUILD_ROOT/usr/bin
cp restore/xenstore-watch $RPM_BUILD_ROOT/usr/bin/xenstore-watch-qubes
cp restore/qubes_restore restore/xenfreepages $RPM_BUILD_ROOT/usr/lib/qubes
cp restore/qubes_prepare_saved_domain.sh $RPM_BUILD_ROOT/usr/lib/qubes
cp restore/qubes_update_dispvm_savefile_with_progress.sh $RPM_BUILD_ROOT/usr/lib/qubes
cp restore/qfile-daemon-dvm $RPM_BUILD_ROOT/usr/lib/qubes
mkdir -p $RPM_BUILD_ROOT/etc/yum.real.repos.d
@ -333,6 +334,7 @@ fi
/usr/bin/xenstore-watch-qubes
/usr/lib/qubes/qubes_restore
/usr/lib/qubes/qubes_prepare_saved_domain.sh
/usr/lib/qubes/qubes_update_dispvm_savefile_with_progress.sh
/etc/xen/scripts/block.qubes
/etc/xen/scripts/block-snapshot
/etc/xen/scripts/block-origin