Merge branch 'spring-merge' of git.qubes-os.org:/var/lib/qubes/git/rafal/core

This commit is contained in:
Joanna Rutkowska 2011-03-31 14:00:44 +02:00
commit e7e7c48acc
5 changed files with 18 additions and 25 deletions

View File

@ -46,6 +46,7 @@ if not dry_run:
qubes_guid_path = "/usr/bin/qubes_guid" qubes_guid_path = "/usr/bin/qubes_guid"
qrexec_daemon_path = "/usr/lib/qubes/qrexec_daemon"
qubes_base_dir = "/var/lib/qubes" qubes_base_dir = "/var/lib/qubes"
@ -618,6 +619,14 @@ class QubesVm(object):
print "--> Starting the VM..." print "--> Starting the VM..."
xend_session.session.xenapi.VM.unpause (self.session_uuid) 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? # perhaps we should move it before unpause and fork?
if debug_console: if debug_console:
from xen.xm import console from xen.xm import console

View File

@ -34,7 +34,6 @@ import os.path
qubes_guid_path = "/usr/bin/qubes_guid" qubes_guid_path = "/usr/bin/qubes_guid"
qubes_clipd_path = "/usr/bin/qclipd" qubes_clipd_path = "/usr/bin/qclipd"
qrexec_daemon_path = "/usr/lib/qubes/qrexec_daemon"
qrexec_client_path = "/usr/lib/qubes/qrexec_client" qrexec_client_path = "/usr/lib/qubes/qrexec_client"
notify_object = None notify_object = None
@ -114,14 +113,6 @@ def vm_run_cmd(vm, cmd, options):
tray_notify_error ("ERROR: Cannot start qubes_guid!") tray_notify_error ("ERROR: Cannot start qubes_guid!")
exit (1) 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); actually_execute(str(xid), cmd, options);
else: # VM already running... else: # VM already running...

View File

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

View File

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

View File

@ -53,6 +53,7 @@ int server_fd;
void handle_usr1(int x) void handle_usr1(int x)
{ {
fprintf(stderr, "connected\n");
exit(0); exit(0);
} }
@ -77,7 +78,11 @@ void init(int xid)
case 0: case 0:
break; break;
default: default:
pause(); fprintf(stderr, "Waiting for VM's qrexec agent.");
for (;;) {
sleep(1);
fprintf(stderr, ".");
}
exit(0); exit(0);
} }
close(0); close(0);
@ -126,9 +131,9 @@ void flush_client(int fd)
{ {
int i; int i;
struct server_header s_hdr; struct server_header s_hdr;
if (fork_and_flush_stdin(fd, &clients[fd].buffer)) if (fork_and_flush_stdin(fd, &clients[fd].buffer))
children_count++; children_count++;
close(fd); close(fd);
clients[fd].state = CLIENT_INVALID; clients[fd].state = CLIENT_INVALID;
buffer_free(&clients[fd].buffer); buffer_free(&clients[fd].buffer);