Merge some conflicts
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 4 Jul 2013 05:29:02 +0000 (14:29 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Thu, 4 Jul 2013 05:29:02 +0000 (14:29 +0900)
Change-Id: Ifbd26ccbfa77a2beba870907a626771b45b0580a
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
main-loop.c
main-loop.h
vl.c

index 79b1e2b2c51d44608b6bdd77c122d47be9043bb5..7f81ac3580d2539002275bf22f37988489cb0766 100644 (file)
 
 #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
@@ -190,18 +119,10 @@ void qemu_notify_event(void)
     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;
index b84d15dfee0da9de9c9d710b4a5baa3a17dd45ca..e87578576df8868aef856f86b5abb643fd4cacc6 100644 (file)
@@ -104,6 +104,7 @@ int main_loop_wait(int nonblocking);
  */
 void qemu_notify_event(void);
 
+// TODO: Mark HAX related code...
 #ifdef CONFIG_HAX_BACKEND
 void qemu_notify_hax_event(void);
 #else
@@ -111,6 +112,7 @@ static inline void qemu_notify_hax_event(void)
 {
 }
 #endif
+//
 
 #ifdef _WIN32
 /* return TRUE if no sleep should be done afterwards */
diff --git a/vl.c b/vl.c
index 64c22889de2f2321b56d2789fa48afe3f4a9eeaa..1b4b1fbdc1180bc88c8dece10e42b581d5ea2d66 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -152,20 +152,12 @@ int qemu_main(int argc, char **argv, char **envp);
 #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"
@@ -207,7 +199,6 @@ int qemu_main(int argc, char **argv, char **envp);
 #define MAX_VIRTIO_CONSOLES 1
 #define MAX_SCLP_CONSOLES 1
 
-<<<<<<< HEAD
 #ifdef CONFIG_MARU
 int skin_disabled = 0;
 //virtio-gl
@@ -215,11 +206,8 @@ extern int enable_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;
@@ -306,15 +294,11 @@ static NotifierList exit_notifiers =
 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;
@@ -2077,11 +2061,7 @@ static void main_loop(void)
     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
@@ -2183,20 +2163,16 @@ static void select_vgahw (const char *p)
     } 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);
@@ -2774,16 +2750,12 @@ static int configure_accelerator(void)
     }
 
     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);
     }
 
@@ -3967,7 +3939,6 @@ int main(int argc, char **argv, char **envp)
                     exit(1);
                 }
                 break;
-<<<<<<< HEAD
             case QEMU_OPTION_enable_hax:
 #ifdef CONFIG_HAX_BACKEND
                 olist = qemu_find_opts("machine");
@@ -3991,7 +3962,6 @@ int main(int argc, char **argv, char **envp)
                 skin_disabled = 1;
                 break;
 #endif
-=======
             case QEMU_OPTION_add_fd:
 #ifndef _WIN32
                 opts = qemu_opts_parse(qemu_find_opts("add-fd"), optarg, 0);
@@ -4017,7 +3987,6 @@ int main(int argc, char **argv, char **envp)
                 }
                 configure_realtime(opts);
                 break;
->>>>>>> test1.5
             default:
                 os_parse_cmd_args(popt->index, optarg);
             }
@@ -4445,15 +4414,10 @@ int main(int argc, char **argv, char **envp)
 
     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 :
@@ -4464,8 +4428,8 @@ int main(int argc, char **argv, char **envp)
                                  .cpu_model = cpu_model };
     machine->init(&args);
 
+    // TODO: Check about it...
     audio_init();
->>>>>>> test1.5
 
     cpu_synchronize_all_post_init();