From 1b05978ec68881cbbf81e3036a2d5903d50c6950 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 26 Feb 2013 05:35:50 +0100 Subject: [PATCH] dom0: pass nogui option down to QubesVM.start() From qubes-dom0-update, then from QubesVM.run(). --- dom0/qvm-core/qubes.py | 2 +- dom0/qvm-tools/qubes-dom0-update | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dom0/qvm-core/qubes.py b/dom0/qvm-core/qubes.py index 89294449..51f94da0 100755 --- a/dom0/qvm-core/qubes.py +++ b/dom0/qvm-core/qubes.py @@ -1400,7 +1400,7 @@ class QubesVm(object): notify_function ("info", "Starting the '{0}' VM...".format(self.name)) elif verbose: print >> sys.stderr, "Starting the VM '{0}'...".format(self.name) - xid = self.start(verbose=verbose, notify_function=notify_function) + xid = self.start(verbose=verbose, start_guid = gui, notify_function=notify_function) except (IOError, OSError, QubesException) as err: raise QubesException("Error while starting the '{0}' VM: {1}".format(self.name, err)) diff --git a/dom0/qvm-tools/qubes-dom0-update b/dom0/qvm-tools/qubes-dom0-update index ae46a78d..ff1d39e0 100755 --- a/dom0/qvm-tools/qubes-dom0-update +++ b/dom0/qvm-tools/qubes-dom0-update @@ -26,6 +26,7 @@ YUM_OPTS= GUI= CHECK_ONLY= ALL_OPTS=$* +QVMRUN_OPTS= # Filter out some yum options and collect packages list while [ $# -gt 0 ]; do case "$1" in @@ -60,6 +61,10 @@ if [ "$GUI" == "1" -a -n "$PKGS" ]; then exit 1 fi +if [ "$GUI" != "1" ]; then + QVMRUN_OPTS=--nogui +fi + # Do not start VM automaticaly when running from cron (only checking for updates) if [ "$CHECK_ONLY" == "1" ] && ! xl domid $UPDATEVM > /dev/null 2>&1; then echo "ERROR: UpdateVM not running, not starting it in non-interactive mode" >&2 @@ -73,11 +78,11 @@ qvm-sync-clock echo "Checking for dom0 updates" >&2 # Start VM if not running already -qvm-run -a $UPDATEVM true || exit 1 +qvm-run $QVMRUN_OPTS -a $UPDATEVM true || exit 1 /usr/lib/qubes/qrexec_client -d "$UPDATEVM" -l 'tar c /var/lib/rpm /etc/yum.repos.d /etc/yum.conf 2>/dev/null' 'user:tar x -C /var/lib/qubes/dom0-updates' 2> /dev/null -qvm-run --pass-io $UPDATEVM "/usr/lib/qubes/qubes_download_dom0_updates.sh --doit --nogui $ALL_OPTS" +qvm-run $QVMRUN_OPTS --pass-io $UPDATEVM "/usr/lib/qubes/qubes_download_dom0_updates.sh --doit --nogui $ALL_OPTS" RETCODE=$? if [ "$CHECK_ONLY" == "1" ]; then exit $RETCODE