提交 2d9c2725 编写于 作者: I Igor Mammedov 提交者: Michael S. Tsirkin

vl.c: daemonize before guest memory allocation

memory allocated for guest before QEMU is daemonized and then mapped
later in guest's address space after it is daemonized, leads to EPT
violation and QEMU aborts.

To avoid this and similar issues switch to daemonized mode early
before applying/processing other options.
Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
Acked-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 a790f4ec
......@@ -3965,6 +3965,8 @@ int main(int argc, char **argv, char **envp)
}
loc_set_none();
os_daemonize();
if (qemu_init_main_loop()) {
fprintf(stderr, "qemu_init_main_loop failed\n");
exit(1);
......@@ -4206,8 +4208,6 @@ int main(int argc, char **argv, char **envp)
}
#endif
os_daemonize();
if (pid_file && qemu_create_pidfile(pid_file) != 0) {
os_pidfile_error();
exit(1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册