diff --git a/README.md b/README.md index 577728f7c..2875ce4b9 100644 --- a/README.md +++ b/README.md @@ -153,8 +153,9 @@ For network support, you have to link the Go application with the flag `-lnetgo` 2. If Qemu is started by our proxy and the environment variable `HERMIT_KVM` is set to `0`, the virtual machine will be not accelerated by KVM. In this case, the configuration flag `--with-mtune=name` should be avoided. With the environment variable `HERMIT_APP_PORT`, an additional port can be open to establish an TCP/IP connection with your application. -3. By setting the environment variable `HERMIT_VERBOSE` to `1`, the proxy prints at termination the kernel log messages onto the screen. +3. By setting the environment variable `HERMIT_VERBOSE` to `1`, the proxy prints at termination the kernel log messages onto the screen. 4. If `HERMIT_DEBUG` is set to `1`, Qemu will establish an gdbserver, which will be listen port 1234. Afterwards you are able debug HermitCore applications remotely. 5. By setting the environment variable `HERMIT_CAPTURE_NET' to `1` and `HERMIT_ISLE` to `qemu`, Qemu captures the network traffic and creates the trace file *qemu-vlan0.pcap*. For instance with [Wireshark](https://www.wireshark.org) you are able to analyze the file. +6. If `HERMIT_MONITOR` is set to `1` and `HERMIT_ISLE` to `qemu`, Qemu establishes a monitor which is available via telnet at port 18767. diff --git a/tools/proxy.c b/tools/proxy.c index 9fed53237..4e8af739a 100644 --- a/tools/proxy.c +++ b/tools/proxy.c @@ -306,7 +306,7 @@ static int init_qemu(char *path) char chardev_file[MAX_PATH]; char port_str[MAX_PATH]; char* qemu_str = "qemu-system-x86_64"; - char* qemu_argv[] = {qemu_str, "-nographic", "-smp", "1", "-m", "2G", "-net", "nic,model=rtl8139", "-net", hostfwd, "-chardev", chardev_file, "-device", "pci-serial,chardev=gnc0", "-monitor", monitor_str, "-kernel", loader_path, "-initrd", path, "-append", cpufreq(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; + char* qemu_argv[] = {qemu_str, "-nographic", "-smp", "1", "-m", "2G", "-net", "nic,model=rtl8139", "-net", hostfwd, "-chardev", chardev_file, "-device", "pci-serial,chardev=gnc0", "-kernel", loader_path, "-initrd", path, "-append", cpufreq(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; struct sigaction sa; memset(&sa, 0, sizeof(sa)); @@ -383,6 +383,16 @@ static int init_qemu(char *path) qemu_argv[i+1] = "SandyBridge"; }*/ + str = getenv("HERMIT_MONITOR") + if (str && (strcmp(str, "0") != 0)) + { + for(; qemu_argv[i] != NULL; i++) + ; + + qemu_argv[i] = "-monitor"; + qemu_argv[i+1] = monitor_str; + } + str = getenv("HERMIT_DEBUG"); if (str && (strcmp(str, "0") != 0)) {