Start qrexec_daemon in vm.start()

Instead of three separate places - qvm-start, qvm-run, manager.
This commit is contained in:
Rafal Wojtczuk 2011-03-31 11:11:39 +02:00
parent 70bdc1272d
commit d6bdb85883
4 changed files with 10 additions and 22 deletions

View File

@ -46,6 +46,7 @@ if not dry_run:
qubes_guid_path = "/usr/bin/qubes_guid"
qrexec_daemon_path = "/usr/lib/qubes/qrexec_daemon"
qubes_base_dir = "/var/lib/qubes"
@ -618,6 +619,14 @@ class QubesVm(object):
print "--> Starting the VM..."
xend_session.session.xenapi.VM.unpause (self.session_uuid)
if not preparing_dvm:
if verbose:
print "--> Starting the qrexec daemon..."
retcode = subprocess.call ([qrexec_daemon_path, str(xid)])
if (retcode != 0) :
self.force_shutdown()
raise OSError ("ERROR: Cannot execute qrexec_daemon!")
# perhaps we should move it before unpause and fork?
if debug_console:
from xen.xm import console

View File

@ -34,7 +34,6 @@ import os.path
qubes_guid_path = "/usr/bin/qubes_guid"
qubes_clipd_path = "/usr/bin/qclipd"
qrexec_daemon_path = "/usr/lib/qubes/qrexec_daemon"
qrexec_client_path = "/usr/lib/qubes/qrexec_client"
notify_object = None
@ -114,14 +113,6 @@ def vm_run_cmd(vm, cmd, options):
tray_notify_error ("ERROR: Cannot start qubes_guid!")
exit (1)
if options.verbose:
print "--> Starting Qubes rexec daemon..."
retcode = subprocess.call ([qrexec_daemon_path, str(xid)])
if (retcode != 0) :
print "ERROR: Cannot start qrexec_daemon!"
exit (1)
actually_execute(str(xid), cmd, options);
else: # VM already running...

View File

@ -27,7 +27,6 @@ import subprocess
import os
qubes_guid_path = "/usr/bin/qubes_guid"
qrexec_daemon_path = "/usr/lib/qubes/qrexec_daemon"
def main():
usage = "usage: %prog [options] <vm-name>"
@ -35,8 +34,6 @@ def main():
parser.add_option ("-q", "--quiet", action="store_false", dest="verbose", default=True)
parser.add_option ("--no-guid", action="store_true", dest="noguid", default=False,
help="Do not start the GUId")
parser.add_option ("--no-rexec", action="store_true", dest="norexec", default=False,
help="Do not start rexec")
parser.add_option ("--console", action="store_true", dest="debug_console", default=False,
help="Attach debugging console to the newly started VM")
parser.add_option ("--dvm", action="store_true", dest="preparing_dvm", default=False,
@ -73,14 +70,5 @@ def main():
print "ERROR: Cannot start qubes_guid!"
exit (1)
if not options.norexec:
if options.verbose:
print "--> Starting Qubes rexec..."
retcode = subprocess.call ([qrexec_daemon_path, str(xid)])
if (retcode != 0) :
print "ERROR: Cannot start qrexec_daemon!"
exit (1)
main()

View File

@ -21,7 +21,7 @@ if ! [ -d $VMDIR ] ; then
echo $VMDIR does not exist ?
exit 1
fi
if ! qvm-start $1 --no-guid --no-rexec --dvm ; then
if ! qvm-start $1 --no-guid --dvm ; then
exit 1
fi