1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

introduce HERMIT_MONITOR to establish the Qemu monitor

This commit is contained in:
Stefan Lankes 2017-02-19 11:54:31 +01:00
parent 60a176a2f3
commit 495b48e2cd
2 changed files with 13 additions and 2 deletions

View file

@ -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.

View file

@ -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))
{