#ifndef _WIN32
-<<<<<<< HEAD
-#include "compatfd.h"
-
-static int io_thread_fd = -1;
-
-void qemu_notify_event(void)
-{
- /* Write 8 bytes to be compatible with eventfd. */
- static const uint64_t val = 1;
- ssize_t ret;
-
- if (io_thread_fd == -1) {
- return;
- }
-
- qemu_notify_hax_event();
-
- do {
- ret = write(io_thread_fd, &val, sizeof(val));
- } while (ret < 0 && errno == EINTR);
-
- /* EAGAIN is fine, a read must be pending. */
- if (ret < 0 && errno != EAGAIN) {
- fprintf(stderr, "qemu_notify_event: write() failed: %s\n",
- strerror(errno));
- exit(1);
- }
-}
-
-static void qemu_event_read(void *opaque)
-{
- int fd = (intptr_t)opaque;
- ssize_t len;
- char buffer[512];
-
- /* Drain the notify pipe. For eventfd, only 8 bytes will be read. */
- do {
- len = read(fd, buffer, sizeof(buffer));
- } while ((len == -1 && errno == EINTR) || len == sizeof(buffer));
-}
-
-static int qemu_event_init(void)
-{
- int err;
- int fds[2];
-
- err = qemu_eventfd(fds);
- if (err == -1) {
- return -errno;
- }
- err = fcntl_setfl(fds[0], O_NONBLOCK);
- if (err < 0) {
- goto fail;
- }
- err = fcntl_setfl(fds[1], O_NONBLOCK);
- if (err < 0) {
- goto fail;
- }
- qemu_set_fd_handler2(fds[0], NULL, qemu_event_read, NULL,
- (void *)(intptr_t)fds[0]);
-
- io_thread_fd = fds[1];
- return 0;
-
-fail:
- close(fds[0]);
- close(fds[1]);
- return err;
-}
-=======
#include "qemu/compatfd.h"
->>>>>>> test1.5
/* If we have signalfd, we mask out the signals we want to handle and then
* use signalfd to listen for them. We rely on whatever the current signal
if (!qemu_aio_context) {
return;
}
-<<<<<<< HEAD
-
+ // TODO: Mark HAX related code...
qemu_notify_hax_event();
-
- if (!SetEvent(qemu_event_handle)) {
- fprintf(stderr, "qemu_notify_event: SetEvent failed: %ld\n",
- GetLastError());
- exit(1);
- }
-=======
+ //
aio_notify(qemu_aio_context);
->>>>>>> test1.5
}
static GArray *gpollfds;
#include "sysemu/tpm.h"
#include "sysemu/dma.h"
#include "audio/audio.h"
-<<<<<<< HEAD
-#include "migration.h"
-#include "kvm.h"
-#include "hax.h"
-#include "qjson.h"
-#include "qemu-option.h"
-#include "qemu-config.h"
-=======
#include "migration/migration.h"
#include "sysemu/kvm.h"
+#include "hax.h"
#include "qapi/qmp/qjson.h"
#include "qemu/option.h"
#include "qemu/config-file.h"
->>>>>>> test1.5
#include "qemu-options.h"
#include "qmp-commands.h"
#include "qemu/main-loop.h"
#define MAX_VIRTIO_CONSOLES 1
#define MAX_SCLP_CONSOLES 1
-<<<<<<< HEAD
#ifdef CONFIG_MARU
int skin_disabled = 0;
//virtio-gl
extern int enable_yagl;
#endif
-static const char *data_dir;
-=======
static const char *data_dir[16];
static int data_dir_idx;
->>>>>>> test1.5
const char *bios_name = NULL;
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
DisplayType display_type = DT_DEFAULT;
static NotifierList machine_init_done_notifiers =
NOTIFIER_LIST_INITIALIZER(machine_init_done_notifiers);
-<<<<<<< HEAD
-static int tcg_allowed = 1;
-int kvm_allowed = 0;
-int xen_allowed = 0;
-int hax_allowed = 0;
-=======
static bool tcg_allowed = true;
bool xen_allowed;
->>>>>>> test1.5
+// FIXME: ??
+int hax_allowed = 0;
+//
uint32_t xen_domid;
enum xen_mode xen_mode = XEN_EMULATE;
static int tcg_tb_size;
hax_sync_vcpus();
do {
-<<<<<<< HEAD
- nonblocking = !(kvm_enabled()|| hax_enabled()) && last_io > 0;
-=======
- nonblocking = !kvm_enabled() && !xen_enabled() && last_io > 0;
->>>>>>> test1.5
+ nonblocking = !kvm_enabled() && !xen_enabled() && !hax_enabled() && last_io > 0;
#ifdef CONFIG_PROFILER
ti = profile_getclock();
#endif
} else if (strstart(p, "xenfb", &opts)) {
vga_interface_type = VGA_XENFB;
} else if (strstart(p, "qxl", &opts)) {
-<<<<<<< HEAD
- vga_interface_type = VGA_QXL;
-#ifdef CONFIG_MARU
- } else if (strstart(p, "maru", &opts)) {
- vga_interface_type = VGA_MARU;
-#endif
-=======
if (qxl_vga_available()) {
vga_interface_type = VGA_QXL;
} else {
fprintf(stderr, "Error: QXL VGA not available\n");
exit(0);
}
->>>>>>> test1.5
+#ifdef CONFIG_MARU
+ } else if (strstart(p, "maru", &opts)) {
+ vga_interface_type = VGA_MARU;
+#endif
} else if (!strstart(p, "none", &opts)) {
invalid_vga:
fprintf(stderr, "Unknown vga type: %s\n", p);
}
if (!accel_initialised) {
-<<<<<<< HEAD
- fprintf(stderr, "No accelerator found!\n");
-#ifdef CONFIG_MARU
- maru_register_exit_msg(MARU_EXIT_UNKNOWN, "No accelerator found.");
-#endif
-=======
if (!init_failed) {
fprintf(stderr, "No accelerator found!\n");
}
->>>>>>> test1.5
+#ifdef CONFIG_MARU
+ maru_register_exit_msg(MARU_EXIT_UNKNOWN, "No accelerator found.");
+#endif
exit(1);
}
exit(1);
}
break;
-<<<<<<< HEAD
case QEMU_OPTION_enable_hax:
#ifdef CONFIG_HAX_BACKEND
olist = qemu_find_opts("machine");
skin_disabled = 1;
break;
#endif
-=======
case QEMU_OPTION_add_fd:
#ifndef _WIN32
opts = qemu_opts_parse(qemu_find_opts("add-fd"), optarg, 0);
}
configure_realtime(opts);
break;
->>>>>>> test1.5
default:
os_parse_cmd_args(popt->index, optarg);
}
qdev_machine_init();
-<<<<<<< HEAD
#ifdef CONFIG_MARU
- // return variable points different address from input variable.
+ // Returned variable points different address from input variable.
kernel_cmdline = prepare_maru_devices(kernel_cmdline);
#endif
-
- machine->init(ram_size, boot_devices,
- kernel_filename, kernel_cmdline, initrd_filename, cpu_model);
-=======
QEMUMachineInitArgs args = { .ram_size = ram_size,
.boot_device = (boot_devices[0] == '\0') ?
machine->boot_order :
.cpu_model = cpu_model };
machine->init(&args);
+ // TODO: Check about it...
audio_init();
->>>>>>> test1.5
cpu_synchronize_all_post_init();