Merge tag 'v2.6.0' into develop
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 20 Jun 2016 06:25:33 +0000 (15:25 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 20 Jun 2016 06:25:33 +0000 (15:25 +0900)
v2.6.0 release

Change-Id: I76aaeae2ace35ddf6dbbd4c11436724688b01929
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
71 files changed:
1  2 
Makefile
Makefile.objs
Makefile.target
accel.c
arch_init.c
audio/audio.c
audio/dsoundaudio.c
block.c
block/raw-win32.c
blockdev.c
configure
cpu-exec.c
cpus.c
exec.c
fsdev/9p-marshal.h
fsdev/qemu-fsdev.c
hmp-commands.hx
hmp.c
hmp.h
hw/9pfs/9p-posix-acl.c
hw/9pfs/9p-xattr-user.c
hw/9pfs/9p-xattr.c
hw/9pfs/9p-xattr.h
hw/9pfs/Makefile.objs
hw/9pfs/cofile.c
hw/Makefile.objs
hw/acpi/ich9.c
hw/acpi/piix4.c
hw/arm/Makefile.objs
hw/i386/pc.c
hw/i386/pc_piix.c
hw/i386/pc_sysfw.c
hw/input/pl050.c
hw/input/ps2.c
hw/intc/apic_common.c
hw/pci/pci.c
include/qemu/error-report.h
include/qemu/xattr.h
include/qom/cpu.h
include/sysemu/sysemu.h
include/ui/console.h
include/ui/qemu-pixman.h
main-loop.c
net/net.c
net/slirp.c
net/tap-win32.c
net/tap.c
os-win32.c
qapi-schema.json
qemu-char.c
qemu-options.hx
qmp-commands.hx
slirp/tcp_subr.c
target-i386/translate.c
target-s390x/kvm.c
tcg/tcg.c
ui/cocoa.m
ui/console.c
ui/input.c
ui/sdl.c
ui/spice-core.c
ui/spice-display.c
ui/spice-input.c
util/coroutine-win32.c
util/oslib-posix.c
util/oslib-win32.c
util/qemu-coroutine.c
util/qemu-error.c
util/qemu-sockets.c
util/qemu-thread-posix.c
vl.c

diff --cc Makefile
Simple merge
diff --cc Makefile.objs
Simple merge
diff --cc Makefile.target
Simple merge
diff --cc accel.c
Simple merge
diff --cc arch_init.c
Simple merge
diff --cc audio/audio.c
Simple merge
index 05a1403fa5650f67deb56b18d4dbf7ffa658993b,516846eb804bb7284e3f0df2a3901d30fc74910d..db77b6d5aa4f63bc5d9f203bbf61116dbcf8ba84
   * SEAL 1.07 by Carlos 'pel' Hasan was used as documentation
   */
  
 +/*
 + * Patched audio jack hot-plug event handling
 + *
 + * Contributors:
 + * - S-Core Co., Ltd
 + *
 + * Contact:
 + * Byeongki Shin <bk0121.shin@samsung.com>
 + */
 +
+ #include "qemu/osdep.h"
  #include "qemu-common.h"
  #include "audio.h"
 +#include "qemu/thread.h"
  
  #define AUDIO_CAP "dsound"
 +#define COBJMACROS
  #include "audio_int.h"
  
  #include <windows.h>
diff --cc block.c
index 32483e6cbfac3783506ad73169eb48767b409b2d,d4939b49bf05b1778306c4b13f2b2dce70af4ca9..4e445b0bc38dbc857b20c76e43fb65bfe73d404c
+++ b/block.c
@@@ -2125,11 -2340,11 +2340,13 @@@ static void bdrv_delete(BlockDriverStat
  
      bdrv_close(bs);
  
 +    bdrv_close(bs);
 +
      /* remove from list, if necessary */
-     bdrv_make_anon(bs);
+     if (bs->node_name[0] != '\0') {
+         QTAILQ_REMOVE(&graph_bdrv_states, bs, node_list);
+     }
+     QTAILQ_REMOVE(&all_bdrv_states, bs, bs_list);
  
      g_free(bs);
  }
Simple merge
diff --cc blockdev.c
index b9912ce573960bc7cf18046a8b6fcdd652674d7e,f1f520a2653baed5a9df4b0b223f9141a303c6dc..c891187d948d7b9d356f68a63fdaeb1a23fb1a7c
  #include "qmp-commands.h"
  #include "trace.h"
  #include "sysemu/arch_init.h"
+ #include "qemu/cutils.h"
+ #include "qemu/help_option.h"
+ static QTAILQ_HEAD(, BlockDriverState) monitor_bdrv_states =
+     QTAILQ_HEAD_INITIALIZER(monitor_bdrv_states);
  
 +#ifdef CONFIG_MARU
 +#include "tizen/src/util/exported_strings.h"
 +#endif
 +
  static const char *const if_name[IF_COUNT] = {
      [IF_NONE] = "none",
      [IF_IDE] = "ide",
diff --cc configure
index 5cdaaab527e9a2bbd3f8b9b5bcf1a56f1f4ef1da,c37fc5fe758a672ff8f7b5a4689e8abbe9f7351a..3bbc31ccea89886198f9a6e569514a6089a4f476
+++ b/configure
@@@ -5177,29 -4867,8 +5201,30 @@@ echo "bzip2 support     $bzip2
  echo "NUMA host support $numa"
  echo "tcmalloc support  $tcmalloc"
  echo "jemalloc support  $jemalloc"
+ echo "avx2 optimization $avx2_opt"
  
 +echo "Qt support        $qt"
 +echo "HAX support       $hax"
 +echo "YaGL support      $yagl"
 +echo "YaGL stats        $yagl_stats"
 +echo "VIGS support      $vigs"
 +
 +# for TIZEN-maru
 +if test "$maru" = "yes"; then
 +echo "TIZEN-maru options:"
 +echo "maru enabled               $maru"
 +    if test "$mingw32" = "yes"; then
 +echo "WINVER                     $winver"
 +    fi
 +echo "libav support              $libav"
 +echo "libpng support             $libpng"
 +echo "DXVA2 support              $dxva2"
 +echo "vaapi support              $vaapi"
 +echo "libtizenusb support        $libtizenusb"
 +echo "extension path             $extension_path"
 +fi
 +#
 +
  if test "$sdl_too_old" = "yes"; then
  echo "-> Your SDL version is too old - please upgrade to have SDL support"
  fi
diff --cc cpu-exec.c
index 62eb0eddb256f465d5e8db5bf0aca8f886977ace,bbfcbfb543850458083e85f40edb186aaf8e0989..e98ae319c03d465a918198b9e9004c7dd337e015
@@@ -33,6 -33,6 +33,8 @@@
  #endif
  #include "sysemu/replay.h"
  
++#include "sysemu/hax.h"
++
  /* -icount align implementation. */
  
  typedef struct SyncClocks {
diff --cc cpus.c
index 53a76f9fbc4d430e8d79089f4cd0c5913a6e772a,cbeb1f6139ea35de86b7684b5a527ae72bf306d4..07d6bd70ddbc34c70609816054c793df6eea2a1e
--- 1/cpus.c
--- 2/cpus.c
+++ b/cpus.c
@@@ -1505,12 -1385,18 +1517,22 @@@ void qemu_init_vcpu(CPUState *cpu
      cpu->nr_threads = smp_threads;
      cpu->stopped = true;
  
+     if (!cpu->as) {
+         /* If the target cpu hasn't set up any address spaces itself,
+          * give it the default one.
+          */
+         AddressSpace *as = address_space_init_shareable(cpu->memory,
+                                                         "cpu-memory");
+         cpu->num_ases = 1;
+         cpu_address_space_init(cpu, as, 0);
+     }
      if (kvm_enabled()) {
          qemu_kvm_start_vcpu(cpu);
 +#ifdef CONFIG_HAX
 +    } else if (hax_enabled() && hax_ug_platform()) {
 +        qemu_hax_start_vcpu(cpu);
 +#endif
      } else if (tcg_enabled()) {
          qemu_tcg_init_vcpu(cpu);
      } else {
diff --cc exec.c
index edbe1e0d8ee8ad92766e16c972fe53838a0fc363,c4f9036184d82b8e3cce4e493caa068e0217d2ee..6dcb8d327bcb2acf06b85ce802ba95265eefa69b
--- 1/exec.c
--- 2/exec.c
+++ b/exec.c
@@@ -30,9 -30,7 +30,8 @@@
  #include "hw/boards.h"
  #endif
  #include "hw/qdev.h"
- #include "qemu/osdep.h"
  #include "sysemu/kvm.h"
 +#include "sysemu/hax.h"
  #include "sysemu/sysemu.h"
  #include "hw/xen/xen.h"
  #include "qemu/timer.h"
@@@ -1566,24 -1648,7 +1649,22 @@@ static void ram_block_add(RAMBlock *new
          if (kvm_enabled()) {
              kvm_setup_guest_memory(new_block->host, new_block->max_length);
          }
-     }
 +#ifdef CONFIG_HAX
-     /*
-      * In Hax, the qemu allocate the virtual address, and HAX kernel
-      * populate the memory with physical memory. Currently we have no
-      * paging, so user should make sure enough free memory in advance
-      */
-     if (hax_enabled()) {
-         int ret = hax_populate_ram((uint64_t)(uintptr_t)new_block->host,
-                                 new_block->max_length);
-         if (ret < 0) {
-             fprintf(stderr, "HAX failed to populate ram\n");
-             exit(-1);
++        /*
++         * In Hax, the qemu allocate the virtual address, and HAX kernel
++         * populate the memory with physical memory. Currently we have no
++         * paging, so user should make sure enough free memory in advance
++         */
++        if (hax_enabled()) {
++            int ret = hax_populate_ram((uint64_t)(uintptr_t)new_block->host,
++                    new_block->max_length);
++            if (ret < 0) {
++                fprintf(stderr, "HAX failed to populate ram\n");
++                exit(-1);
++            }
 +        }
-     }
 +#endif
-     return new_block->offset;
+     }
  }
  
  #ifdef __linux__
index 0000000000000000000000000000000000000000,e91b24e9ca6918d845f52412b66426179275c9d0..0c262f81b94301e0c57c92a52aa097a8fa496d26
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,84 +1,90 @@@
+ #ifndef _QEMU_9P_MARSHAL_H
+ #define _QEMU_9P_MARSHAL_H
++#ifdef CONFIG_MARU
++#ifdef CONFIG_WIN32
++#include "tizen/src/resources_win32.h"
++#endif
++#endif
++
+ typedef struct V9fsString
+ {
+     uint16_t size;
+     char *data;
+ } V9fsString;
+ typedef struct V9fsQID
+ {
+     int8_t type;
+     int32_t version;
+     int64_t path;
+ } V9fsQID;
+ typedef struct V9fsStat
+ {
+     int16_t size;
+     int16_t type;
+     int32_t dev;
+     V9fsQID qid;
+     int32_t mode;
+     int32_t atime;
+     int32_t mtime;
+     int64_t length;
+     V9fsString name;
+     V9fsString uid;
+     V9fsString gid;
+     V9fsString muid;
+     /* 9p2000.u */
+     V9fsString extension;
+     int32_t n_uid;
+     int32_t n_gid;
+     int32_t n_muid;
+ } V9fsStat;
+ typedef struct V9fsIattr
+ {
+     int32_t valid;
+     int32_t mode;
+     int32_t uid;
+     int32_t gid;
+     int64_t size;
+     int64_t atime_sec;
+     int64_t atime_nsec;
+     int64_t mtime_sec;
+     int64_t mtime_nsec;
+ } V9fsIattr;
+ typedef struct V9fsStatDotl {
+     uint64_t st_result_mask;
+     V9fsQID qid;
+     uint32_t st_mode;
+     uint32_t st_uid;
+     uint32_t st_gid;
+     uint64_t st_nlink;
+     uint64_t st_rdev;
+     uint64_t st_size;
+     uint64_t st_blksize;
+     uint64_t st_blocks;
+     uint64_t st_atime_sec;
+     uint64_t st_atime_nsec;
+     uint64_t st_mtime_sec;
+     uint64_t st_mtime_nsec;
+     uint64_t st_ctime_sec;
+     uint64_t st_ctime_nsec;
+     uint64_t st_btime_sec;
+     uint64_t st_btime_nsec;
+     uint64_t st_gen;
+     uint64_t st_data_version;
+ } V9fsStatDotl;
+ static inline void v9fs_string_init(V9fsString *str)
+ {
+     str->data = NULL;
+     str->size = 0;
+ }
+ extern void v9fs_string_free(V9fsString *str);
+ extern void v9fs_string_null(V9fsString *str);
+ extern void v9fs_string_sprintf(V9fsString *str, const char *fmt, ...);
+ extern void v9fs_string_copy(V9fsString *lhs, V9fsString *rhs);
+ #endif
Simple merge
diff --cc hmp-commands.hx
Simple merge
diff --cc hmp.c
Simple merge
diff --cc hmp.h
Simple merge
index 0000000000000000000000000000000000000000,ec003181cd33d6e3c87f5a9b448e3f99d43c770f..37839915219dcac6866a2b77b16b2a395489c167
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,184 +1,212 @@@
 -    ret = lsetxattr(buffer, MAP_ACL_DEFAULT, value, size, flags);
+ /*
+  * 9p system.posix* xattr callback
+  *
+  * Copyright IBM, Corp. 2010
+  *
+  * Authors:
+  * Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
+  *
+  * This work is licensed under the terms of the GNU GPL, version 2.  See
+  * the COPYING file in the top-level directory.
+  *
+  */
+ #include "qemu/osdep.h"
+ #include "qemu/xattr.h"
+ #include "9p.h"
+ #include "fsdev/file-op-9p.h"
+ #include "9p-xattr.h"
+ #define MAP_ACL_ACCESS "user.virtfs.system.posix_acl_access"
+ #define MAP_ACL_DEFAULT "user.virtfs.system.posix_acl_default"
+ #define ACL_ACCESS "system.posix_acl_access"
+ #define ACL_DEFAULT "system.posix_acl_default"
+ static ssize_t mp_pacl_getxattr(FsContext *ctx, const char *path,
+                                 const char *name, void *value, size_t size)
+ {
+     char *buffer;
+     ssize_t ret;
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
+     ret = lgetxattr(buffer, MAP_ACL_ACCESS, value, size);
++#else
++    ret = getxattr(buffer, MAP_ACL_ACCESS, value, size, 0, XATTR_NOFOLLOW);
++#endif
+     g_free(buffer);
+     return ret;
+ }
+ static ssize_t mp_pacl_listxattr(FsContext *ctx, const char *path,
+                                  char *name, void *value, size_t osize)
+ {
+     ssize_t len = sizeof(ACL_ACCESS);
+     if (!value) {
+         return len;
+     }
+     if (osize < len) {
+         errno = ERANGE;
+         return -1;
+     }
+     /* len includes the trailing NUL */
+     memcpy(value, ACL_ACCESS, len);
+     return 0;
+ }
+ static int mp_pacl_setxattr(FsContext *ctx, const char *path, const char *name,
+                             void *value, size_t size, int flags)
+ {
+     char *buffer;
+     int ret;
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
+     ret = lsetxattr(buffer, MAP_ACL_ACCESS, value, size, flags);
++#else
++    ret = setxattr(buffer, MAP_ACL_ACCESS, value, size, 0, flags | XATTR_NOFOLLOW);
++#endif
++
+     g_free(buffer);
+     return ret;
+ }
+ static int mp_pacl_removexattr(FsContext *ctx,
+                                const char *path, const char *name)
+ {
+     int ret;
+     char *buffer;
+     buffer = rpath(ctx, path);
++
++#ifdef CONFIG_LINUX
+     ret  = lremovexattr(buffer, MAP_ACL_ACCESS);
++#else
++    ret  = removexattr(buffer, MAP_ACL_ACCESS, XATTR_NOFOLLOW);
++#endif
+     if (ret == -1 && errno == ENODATA) {
+         /*
+          * We don't get ENODATA error when trying to remove a
+          * posix acl that is not present. So don't throw the error
+          * even in case of mapped security model
+          */
+         errno = 0;
+         ret = 0;
+     }
+     g_free(buffer);
+     return ret;
+ }
+ static ssize_t mp_dacl_getxattr(FsContext *ctx, const char *path,
+                                 const char *name, void *value, size_t size)
+ {
+     char *buffer;
+     ssize_t ret;
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
+     ret = lgetxattr(buffer, MAP_ACL_DEFAULT, value, size);
++#else
++    ret = getxattr(buffer, MAP_ACL_DEFAULT, value, size, 0, XATTR_NOFOLLOW);
++#endif
+     g_free(buffer);
+     return ret;
+ }
+ static ssize_t mp_dacl_listxattr(FsContext *ctx, const char *path,
+                                  char *name, void *value, size_t osize)
+ {
+     ssize_t len = sizeof(ACL_DEFAULT);
+     if (!value) {
+         return len;
+     }
+     if (osize < len) {
+         errno = ERANGE;
+         return -1;
+     }
+     /* len includes the trailing NUL */
+     memcpy(value, ACL_DEFAULT, len);
+     return 0;
+ }
+ static int mp_dacl_setxattr(FsContext *ctx, const char *path, const char *name,
+                             void *value, size_t size, int flags)
+ {
+     char *buffer;
+     int ret;
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
++    ret = lsetxattr(buffer, MAP_ACL_DEFAULT, value,
++            size, flags);
++#else
++    ret = setxattr(buffer, MAP_ACL_DEFAULT, value,
++            size, 0, flags | XATTR_NOFOLLOW);
++#endif
+     g_free(buffer);
+     return ret;
+ }
+ static int mp_dacl_removexattr(FsContext *ctx,
+                                const char *path, const char *name)
+ {
+     int ret;
+     char *buffer;
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
+     ret  = lremovexattr(buffer, MAP_ACL_DEFAULT);
++#else
++    ret  = removexattr(buffer, MAP_ACL_DEFAULT, XATTR_NOFOLLOW);
++#endif
+     if (ret == -1 && errno == ENODATA) {
+         /*
+          * We don't get ENODATA error when trying to remove a
+          * posix acl that is not present. So don't throw the error
+          * even in case of mapped security model
+          */
+         errno = 0;
+         ret = 0;
+     }
+     g_free(buffer);
+     return ret;
+ }
+ XattrOperations mapped_pacl_xattr = {
+     .name = "system.posix_acl_access",
+     .getxattr = mp_pacl_getxattr,
+     .setxattr = mp_pacl_setxattr,
+     .listxattr = mp_pacl_listxattr,
+     .removexattr = mp_pacl_removexattr,
+ };
+ XattrOperations mapped_dacl_xattr = {
+     .name = "system.posix_acl_default",
+     .getxattr = mp_dacl_getxattr,
+     .setxattr = mp_dacl_setxattr,
+     .listxattr = mp_dacl_listxattr,
+     .removexattr = mp_dacl_removexattr,
+ };
+ XattrOperations passthrough_acl_xattr = {
+     .name = "system.posix_acl_",
+     .getxattr = pt_getxattr,
+     .setxattr = pt_setxattr,
+     .listxattr = pt_listxattr,
+     .removexattr = pt_removexattr,
+ };
+ XattrOperations none_acl_xattr = {
+     .name = "system.posix_acl_",
+     .getxattr = notsup_getxattr,
+     .setxattr = notsup_setxattr,
+     .listxattr = notsup_listxattr,
+     .removexattr = notsup_removexattr,
+ };
index 0000000000000000000000000000000000000000,f87530c8b5269f914ce0b0527acf6857aa69b596..45e18e93390cc60ad3c82a4673e98daf6191684f
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,127 +1,139 @@@
+ /*
+  * 9p user. xattr callback
+  *
+  * Copyright IBM, Corp. 2010
+  *
+  * Authors:
+  * Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
+  *
+  * This work is licensed under the terms of the GNU GPL, version 2.  See
+  * the COPYING file in the top-level directory.
+  *
+  */
+ #include "qemu/osdep.h"
+ #include "9p.h"
+ #include "fsdev/file-op-9p.h"
+ #include "9p-xattr.h"
+ static ssize_t mp_user_getxattr(FsContext *ctx, const char *path,
+                                 const char *name, void *value, size_t size)
+ {
+     char *buffer;
+     ssize_t ret;
+     if (strncmp(name, "user.virtfs.", 12) == 0) {
+         /*
+          * Don't allow fetch of user.virtfs namesapce
+          * in case of mapped security
+          */
+         errno = ENOATTR;
+         return -1;
+     }
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
+     ret = lgetxattr(buffer, name, value, size);
++#else
++    ret = getxattr(buffer, name, value, size, 0, XATTR_NOFOLLOW);
++#endif
+     g_free(buffer);
+     return ret;
+ }
+ static ssize_t mp_user_listxattr(FsContext *ctx, const char *path,
+                                  char *name, void *value, size_t size)
+ {
+     int name_size = strlen(name) + 1;
+     if (strncmp(name, "user.virtfs.", 12) == 0) {
+         /*  check if it is a mapped posix acl */
+         if (strncmp(name, "user.virtfs.system.posix_acl_", 29) == 0) {
+             /* adjust the name and size */
+             name += 12;
+             name_size -= 12;
+         } else {
+             /*
+              * Don't allow fetch of user.virtfs namesapce
+              * in case of mapped security
+              */
+             return 0;
+         }
+     }
+     if (!value) {
+         return name_size;
+     }
+     if (size < name_size) {
+         errno = ERANGE;
+         return -1;
+     }
+     /* name_size includes the trailing NUL. */
+     memcpy(value, name, name_size);
+     return name_size;
+ }
+ static int mp_user_setxattr(FsContext *ctx, const char *path, const char *name,
+                             void *value, size_t size, int flags)
+ {
+     char *buffer;
+     int ret;
+     if (strncmp(name, "user.virtfs.", 12) == 0) {
+         /*
+          * Don't allow fetch of user.virtfs namesapce
+          * in case of mapped security
+          */
+         errno = EACCES;
+         return -1;
+     }
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
+     ret = lsetxattr(buffer, name, value, size, flags);
++#else
++    ret = setxattr(buffer, name, value, size, 0, flags | XATTR_NOFOLLOW);
++#endif
+     g_free(buffer);
+     return ret;
+ }
+ static int mp_user_removexattr(FsContext *ctx,
+                                const char *path, const char *name)
+ {
+     char *buffer;
+     int ret;
+     if (strncmp(name, "user.virtfs.", 12) == 0) {
+         /*
+          * Don't allow fetch of user.virtfs namesapce
+          * in case of mapped security
+          */
+         errno = EACCES;
+         return -1;
+     }
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
+     ret = lremovexattr(buffer, name);
++#else
++    ret = removexattr(buffer, name, XATTR_NOFOLLOW);
++#endif
+     g_free(buffer);
+     return ret;
+ }
+ XattrOperations mapped_user_xattr = {
+     .name = "user.",
+     .getxattr = mp_user_getxattr,
+     .setxattr = mp_user_setxattr,
+     .listxattr = mp_user_listxattr,
+     .removexattr = mp_user_removexattr,
+ };
+ XattrOperations passthrough_user_xattr = {
+     .name = "user.",
+     .getxattr = pt_getxattr,
+     .setxattr = pt_setxattr,
+     .listxattr = pt_listxattr,
+     .removexattr = pt_removexattr,
+ };
index 0000000000000000000000000000000000000000,5d8595ed932a6f1431faba4e93bf16d1f86898ac..488d3fd5e157bd00d070bd15ea2392fc4df536c1
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,164 +1,172 @@@
+ /*
+  * 9p  xattr callback
+  *
+  * Copyright IBM, Corp. 2010
+  *
+  * Authors:
+  * Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
+  *
+  * This work is licensed under the terms of the GNU GPL, version 2.  See
+  * the COPYING file in the top-level directory.
+  *
+  */
+ #include "qemu/osdep.h"
+ #include "9p.h"
+ #include "fsdev/file-op-9p.h"
+ #include "9p-xattr.h"
+ static XattrOperations *get_xattr_operations(XattrOperations **h,
+                                              const char *name)
+ {
+     XattrOperations *xops;
+     for (xops = *(h)++; xops != NULL; xops = *(h)++) {
+         if (!strncmp(name, xops->name, strlen(xops->name))) {
+             return xops;
+         }
+     }
+     return NULL;
+ }
+ ssize_t v9fs_get_xattr(FsContext *ctx, const char *path,
+                        const char *name, void *value, size_t size)
+ {
+     XattrOperations *xops = get_xattr_operations(ctx->xops, name);
+     if (xops) {
+         return xops->getxattr(ctx, path, name, value, size);
+     }
+     errno = EOPNOTSUPP;
+     return -1;
+ }
+ ssize_t pt_listxattr(FsContext *ctx, const char *path,
+                      char *name, void *value, size_t size)
+ {
+     int name_size = strlen(name) + 1;
+     if (!value) {
+         return name_size;
+     }
+     if (size < name_size) {
+         errno = ERANGE;
+         return -1;
+     }
+     /* no need for strncpy: name_size is strlen(name)+1 */
+     memcpy(value, name, name_size);
+     return name_size;
+ }
+ /*
+  * Get the list and pass to each layer to find out whether
+  * to send the data or not
+  */
+ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path,
+                         void *value, size_t vsize)
+ {
+     ssize_t size = 0;
+     char *buffer;
+     void *ovalue = value;
+     XattrOperations *xops;
+     char *orig_value, *orig_value_start;
+     ssize_t xattr_len, parsed_len = 0, attr_len;
+     /* Get the actual len */
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
+     xattr_len = llistxattr(buffer, value, 0);
++#else
++    xattr_len = listxattr(buffer, value, 0, XATTR_NOFOLLOW);
++#endif
+     if (xattr_len <= 0) {
+         g_free(buffer);
+         return xattr_len;
+     }
+     /* Now fetch the xattr and find the actual size */
+     orig_value = g_malloc(xattr_len);
++#ifdef CONFIG_LINUX
+     xattr_len = llistxattr(buffer, orig_value, xattr_len);
++#else
++    xattr_len = listxattr(buffer, orig_value, xattr_len, XATTR_NOFOLLOW);
++#endif
+     g_free(buffer);
+     /* store the orig pointer */
+     orig_value_start = orig_value;
+     while (xattr_len > parsed_len) {
+         xops = get_xattr_operations(ctx->xops, orig_value);
+         if (!xops) {
+             goto next_entry;
+         }
+         if (!value) {
+             size += xops->listxattr(ctx, path, orig_value, value, vsize);
+         } else {
+             size = xops->listxattr(ctx, path, orig_value, value, vsize);
+             if (size < 0) {
+                 goto err_out;
+             }
+             value += size;
+             vsize -= size;
+         }
+ next_entry:
+         /* Got the next entry */
+         attr_len = strlen(orig_value) + 1;
+         parsed_len += attr_len;
+         orig_value += attr_len;
+     }
+     if (value) {
+         size = value - ovalue;
+     }
+ err_out:
+     g_free(orig_value_start);
+     return size;
+ }
+ int v9fs_set_xattr(FsContext *ctx, const char *path, const char *name,
+                    void *value, size_t size, int flags)
+ {
+     XattrOperations *xops = get_xattr_operations(ctx->xops, name);
+     if (xops) {
+         return xops->setxattr(ctx, path, name, value, size, flags);
+     }
+     errno = EOPNOTSUPP;
+     return -1;
+ }
+ int v9fs_remove_xattr(FsContext *ctx,
+                       const char *path, const char *name)
+ {
+     XattrOperations *xops = get_xattr_operations(ctx->xops, name);
+     if (xops) {
+         return xops->removexattr(ctx, path, name);
+     }
+     errno = EOPNOTSUPP;
+     return -1;
+ }
+ XattrOperations *mapped_xattr_ops[] = {
+     &mapped_user_xattr,
+     &mapped_pacl_xattr,
+     &mapped_dacl_xattr,
+     NULL,
+ };
+ XattrOperations *passthrough_xattr_ops[] = {
+     &passthrough_user_xattr,
+     &passthrough_acl_xattr,
+     NULL,
+ };
+ /* for .user none model should be same as passthrough */
+ XattrOperations *none_xattr_ops[] = {
+     &passthrough_user_xattr,
+     &none_acl_xattr,
+     NULL,
+ };
index 0000000000000000000000000000000000000000,4d39a20262ad2aba7e652725e3991a819ead96f4..fe0c9652bc33e159f9e8d7460684cee6a1cbb625
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,120 +1,174 @@@
+ /*
+  * 9p
+  *
+  * Copyright IBM, Corp. 2010
+  *
+  * Authors:
+  *  Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
+  *
+  * This work is licensed under the terms of the GNU GPL, version 2.  See
+  * the COPYING file in the top-level directory.
+  *
+  */
+ #ifndef _QEMU_9P_XATTR_H
+ #define _QEMU_9P_XATTR_H
+ #include "qemu/xattr.h"
+ typedef struct xattr_operations
+ {
+     const char *name;
+     ssize_t (*getxattr)(FsContext *ctx, const char *path,
+                         const char *name, void *value, size_t size);
+     ssize_t (*listxattr)(FsContext *ctx, const char *path,
+                          char *name, void *value, size_t size);
+     int (*setxattr)(FsContext *ctx, const char *path, const char *name,
+                     void *value, size_t size, int flags);
+     int (*removexattr)(FsContext *ctx,
+                        const char *path, const char *name);
+ } XattrOperations;
+ extern XattrOperations mapped_user_xattr;
+ extern XattrOperations passthrough_user_xattr;
+ extern XattrOperations mapped_pacl_xattr;
+ extern XattrOperations mapped_dacl_xattr;
+ extern XattrOperations passthrough_acl_xattr;
+ extern XattrOperations none_acl_xattr;
+ extern XattrOperations *mapped_xattr_ops[];
+ extern XattrOperations *passthrough_xattr_ops[];
+ extern XattrOperations *none_xattr_ops[];
+ ssize_t v9fs_get_xattr(FsContext *ctx, const char *path, const char *name,
+                        void *value, size_t size);
+ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path, void *value,
+                         size_t vsize);
+ int v9fs_set_xattr(FsContext *ctx, const char *path, const char *name,
+                           void *value, size_t size, int flags);
+ int v9fs_remove_xattr(FsContext *ctx, const char *path, const char *name);
+ ssize_t pt_listxattr(FsContext *ctx, const char *path, char *name, void *value,
+                      size_t size);
+ static inline ssize_t pt_getxattr(FsContext *ctx, const char *path,
+                                   const char *name, void *value, size_t size)
+ {
++#ifdef CONFIG_MARU
++#ifndef CONFIG_WIN32
+     char *buffer;
+     ssize_t ret;
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
+     ret = lgetxattr(buffer, name, value, size);
++#else
++    ret = getxattr(buffer, name, value, size, 0, XATTR_NOFOLLOW);
++#endif
+     g_free(buffer);
+     return ret;
++#else
++    return 0;
++#endif
++#else
++    char *buffer;
++    ssize_t ret;
++
++    buffer = rpath(ctx, path);
++    ret = lgetxattr(buffer, name, value, size);
++    g_free(buffer);
++    return ret;
++#endif
+ }
+ static inline int pt_setxattr(FsContext *ctx, const char *path,
+                               const char *name, void *value,
+                               size_t size, int flags)
+ {
++#ifdef CONFIG_MARU
++#ifndef CONFIG_WIN32
+     char *buffer;
+     int ret;
+     buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
+     ret = lsetxattr(buffer, name, value, size, flags);
++#else
++    ret =  setxattr(buffer, name, value, size, 0, flags | XATTR_NOFOLLOW);
++#endif
+     g_free(buffer);
+     return ret;
++#else
++    return 0;
++#endif
++#else
++    char *buffer;
++    int ret;
++
++    buffer = rpath(ctx, path);
++    ret = lsetxattr(buffer, name, value, size, flags);
++    g_free(buffer);
++    return ret;
++#endif
+ }
+ static inline int pt_removexattr(FsContext *ctx,
+                                  const char *path, const char *name)
+ {
++#ifdef CONFIG_MARU
++#ifndef CONFIG_WIN32
++    char *buffer;
++    int ret;
++
++    buffer = rpath(ctx, path);
++#ifdef CONFIG_LINUX
++    ret = lremovexattr(path, name);
++#else
++    ret = removexattr(path, name, XATTR_NOFOLLOW);
++#endif
++    g_free(buffer);
++    return ret;
++#else
++    return 0;
++#endif
++#else
+     char *buffer;
+     int ret;
+     buffer = rpath(ctx, path);
+     ret = lremovexattr(path, name);
+     g_free(buffer);
+     return ret;
++#endif
+ }
+ static inline ssize_t notsup_getxattr(FsContext *ctx, const char *path,
+                                       const char *name, void *value,
+                                       size_t size)
+ {
+     errno = ENOTSUP;
+     return -1;
+ }
+ static inline int notsup_setxattr(FsContext *ctx, const char *path,
+                                   const char *name, void *value,
+                                   size_t size, int flags)
+ {
+     errno = ENOTSUP;
+     return -1;
+ }
+ static inline ssize_t notsup_listxattr(FsContext *ctx, const char *path,
+                                        char *name, void *value, size_t size)
+ {
+     return 0;
+ }
+ static inline int notsup_removexattr(FsContext *ctx,
+                                      const char *path, const char *name)
+ {
+     errno = ENOTSUP;
+     return -1;
+ }
+ #endif
index 6bd86c1d30b01f05b0d691805853e80d9b6efafd,da0ae0cfdbaec6f89f556d1f57b85639eac80893..ac3e5910d9e2ce5d9781fd846d950d163cc5e165
@@@ -1,20 -1,9 +1,30 @@@
++<<<<<<< HEAD
 +ifeq ($(CONFIG_MARU),y)
 +common-obj-y  = virtio-9p-maru.o
 +common-obj-y += virtio-9p-local-maru.o
 +endif
 +
 +ifneq ($(CONFIG_MARU),y)
 +common-obj-y  = virtio-9p.o
 +common-obj-y += virtio-9p-local.o
 +endif
 +
 +common-obj-y += virtio-9p-coth.o cofs.o codir.o cofile.o
 +ifneq ($(CONFIG_WIN32),y)
 +common-obj-y += virtio-9p-xattr-user.o virtio-9p-posix-acl.o
 +common-obj-y += virtio-9p-xattr.o coxattr.o
 +endif
 +common-obj-$(CONFIG_LINUX) += virtio-9p-synth.o
 +common-obj-$(CONFIG_LINUX) += virtio-9p-proxy.o
 +common-obj-$(CONFIG_OPEN_BY_HANDLE) +=  virtio-9p-handle.o
++=======
+ common-obj-y  = 9p.o
+ common-obj-y += 9p-local.o 9p-xattr.o
+ common-obj-y += 9p-xattr-user.o 9p-posix-acl.o
+ common-obj-y += coth.o cofs.o codir.o cofile.o
+ common-obj-y += coxattr.o 9p-synth.o
+ common-obj-$(CONFIG_OPEN_BY_HANDLE) +=  9p-handle.o
+ common-obj-y += 9p-proxy.o
++>>>>>>> v2.6.0
  
  obj-y += virtio-9p-device.o
index 3d3688b0537f9ae762000c57a1946215c120128d,293483e0c92712a60b6894ad1700c31bbab35795..9e8a457f8e725995eb4122de3e4f2122da6eb012
  #include "fsdev/qemu-fsdev.h"
  #include "qemu/thread.h"
  #include "qemu/coroutine.h"
- #include "virtio-9p-coth.h"
+ #include "coth.h"
  
 +#ifdef CONFIG_MARU
 +#ifdef CONFIG_WIN32
 +#ifdef fsync
 +#undef fsync
 +#endif
 +#endif
 +#endif
 +
  int v9fs_co_st_gen(V9fsPDU *pdu, V9fsPath *path, mode_t st_mode,
                     V9fsStatDotl *v9stat)
  {
Simple merge
diff --cc hw/acpi/ich9.c
Simple merge
diff --cc hw/acpi/piix4.c
index 218fae33dc5b405d23246d39db81b1519375445d,16abdf1624097fd81d5bdc1f171c7ff946623f5c..0f4b623db7ae9737f40e2cbb2ae3668ddfbf1669
  #include "hw/acpi/acpi_dev_interface.h"
  #include "hw/xen/xen.h"
  
++#include "sysemu/hax.h"
++
 +#ifdef CONFIG_MARU
 +#include "tizen/src/hw/maru_pm.h"
 +#endif
 +
  //#define DEBUG
  
  #ifdef DEBUG
Simple merge
diff --cc hw/i386/pc.c
index 7c6041770500acb4d312b61b9b4c051fdfc9c1d1,99437e0b787353c34e122ad22f5025c0822217a3..06f89bd09b55f76e51ff8361b6af9595ccb6a83d
  #include "hw/mem/pc-dimm.h"
  #include "qapi/visitor.h"
  #include "qapi-visit.h"
+ #include "qom/cpu.h"
 +#include "sysemu/hax.h"
 +
  /* debug PC/ISA interrupts */
  //#define DEBUG_IRQ
  
index de01fda28453118d5af95dd928cee83870dc28c4,7f50116bc757f6e6b0a1fe3b7525e01fe302c64e..d48a7ec38f57541c82e5d4a6cd4265b990cb5a80
@@@ -181,10 -161,10 +161,10 @@@ static void pc_init1(MachineState *mach
      }
  
      gsi_state = g_malloc0(sizeof(*gsi_state));
-     if (kvm_irqchip_in_kernel()) {
-         kvm_pc_setup_irq_routing(pci_enabled);
+     if (kvm_ioapic_in_kernel()) {
+         kvm_pc_setup_irq_routing(pcmc->pci_enabled);
          gsi = qemu_allocate_irqs(kvm_pc_gsi_handler, gsi_state,
 -                                 GSI_NUM_PINS);
 +                GSI_NUM_PINS);
      } else {
          gsi = qemu_allocate_irqs(gsi_handler, gsi_state, GSI_NUM_PINS);
      }
                                   PC_MACHINE_ACPI_DEVICE_PROP, &error_abort);
      }
  
-     if (pci_enabled) {
+     if (pcmc->pci_enabled) {
          pc_pci_device_init(pci_bus);
      }
+     if (pcms->acpi_nvdimm_state.is_enabled) {
+         nvdimm_init_acpi_state(&pcms->acpi_nvdimm_state, system_io,
+                                pcms->fw_cfg, OBJECT(pcms));
+     }
  }
  
 +#ifdef CONFIG_MARU
 +void maru_pc_init(MachineState *machine);
 +
 +void maru_pc_init(MachineState *machine)
 +{
 +    pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, TYPE_I440FX_PCI_DEVICE);
 +}
 +#endif
 +
  /* Looking for a pc_compat_2_4() function? It doesn't exist.
   * pc_compat_*() functions that run on machine-init time and
   * change global QEMU state are deprecated. Please don't create
Simple merge
Simple merge
diff --cc hw/input/ps2.c
Simple merge
Simple merge
diff --cc hw/pci/pci.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index ee54668e2e14e7c3dbfa4662d18ea3dd22f72540,4a67e01232d7acd66498b4e55f731b52a109fa4e..d24e35164f5eaa25b63e07aaefd10d3286db0c0b
@@@ -16,9 -16,6 +16,8 @@@
  #pragma GCC diagnostic pop
  #endif
  
- #include "qemu/typedefs.h"
 +#include <stdbool.h>
 +
  /*
   * pixman image formats are defined to be native endian,
   * that means host byte order on qemu.  So we go define
diff --cc main-loop.c
Simple merge
diff --cc net/net.c
Simple merge
diff --cc net/slirp.c
Simple merge
diff --cc net/tap-win32.c
Simple merge
diff --cc net/tap.c
index e377aab3ee3a97c38e9c138fa8863df16256dac3,740e8a26138cc4cf66a31de38304f620fd6ad38c..29b1bbf960c298e7f12505b7d491b712dbe5a71a
+++ b/net/tap.c
@@@ -791,9 -730,10 +792,9 @@@ int net_init_tap(const NetClientOption
      char ifname[128];
  
      assert(opts->type == NET_CLIENT_OPTIONS_KIND_TAP);
-     tap = opts->u.tap;
+     tap = opts->u.tap.data;
      queues = tap->has_queues ? tap->queues : 1;
      vhostfdname = tap->has_vhostfd ? tap->vhostfd : NULL;
 -
      /* QEMU vlans does not support multiqueue tap, in this case peer is set.
       * For -netdev, peer is always NULL. */
      if (peer && (tap->has_queues || tap->has_fds || tap->has_vhostfds)) {
diff --cc os-win32.c
Simple merge
Simple merge
diff --cc qemu-char.c
Simple merge
diff --cc qemu-options.hx
Simple merge
diff --cc qmp-commands.hx
Simple merge
Simple merge
index f0abc1a6721b1836e0a0511eeddf5754305f6b19,1a1214dcb12ec6c874dd488a2af56e8d6de97a67..99f763b5b0bd1a4ca5b8142a0bd08d330830e590
@@@ -32,8 -28,8 +28,9 @@@
  #include "exec/helper-gen.h"
  
  #include "trace-tcg.h"
+ #include "exec/log.h"
  
 +#include "sysemu/hax.h"
  
  #define PREFIX_REPZ   0x01
  #define PREFIX_REPNZ  0x02
Simple merge
diff --cc tcg/tcg.c
Simple merge
diff --cc ui/cocoa.m
Simple merge
diff --cc ui/console.c
Simple merge
diff --cc ui/input.c
Simple merge
diff --cc ui/sdl.c
Simple merge
diff --cc ui/spice-core.c
Simple merge
Simple merge
Simple merge
Simple merge
index 6f18866cad91230e31f55d72c625d416c3cf5c27,6cc4b8f0010a58bed6589bcf3c49891b434bb78d..7afc05ca7daa86fd8fafdd913904780dce20502a
  
  #include <glib/gprintf.h>
  
- #include "config-host.h"
  #include "sysemu/sysemu.h"
  #include "trace.h"
+ #include "qapi/error.h"
  #include "qemu/sockets.h"
 +#include "qemu/error-report.h"
  #include <sys/mman.h>
  #include <libgen.h>
- #include <setjmp.h>
  #include <sys/signal.h>
+ #include "qemu/cutils.h"
  
  #ifdef CONFIG_LINUX
  #include <sys/syscall.h>
index 11f528a4df561661d243d0cf487ef6e8b4e6fb5e,c926db4a5c44b4df5d8a6e99d155ce41bc547c65..9ab9e21cc897eb4a177184f68cd6c0bd524797ad
@@@ -37,7 -37,8 +37,9 @@@
  #include "qemu/main-loop.h"
  #include "trace.h"
  #include "qemu/sockets.h"
+ #include "qemu/cutils.h"
 +#include "qemu/error-report.h"
  /* this must come after including "trace.h" */
  #include <shlobj.h>
  
Simple merge
Simple merge
index a96a8d7960bf1ce12d49ca72cbcfd1b7cdaa94de,0d536911c90be352d4aad7d3007673a37f64919f..5bbc9eee7e9712ffa75e0c6aa19c2aafb08a7095
@@@ -360,26 -371,28 +371,36 @@@ static struct addrinfo *inet_parse_conn
          return NULL;
      }
  
-     if (qemu_opt_get_bool(opts, "ipv4", 0)) {
-         ai.ai_family = PF_INET;
-     }
-     if (qemu_opt_get_bool(opts, "ipv6", 0)) {
-         ai.ai_family = PF_INET6;
+     if (saddr->host == NULL || saddr->port == NULL) {
+         error_setg(errp, "host and/or port not specified");
+         return NULL;
      }
  
 +#ifdef CONFIG_MARU
 +    // for lookup loopback interface...
 +    if (addr[0] == '\0') {
 +        ai.ai_flags = 0;
 +        addr = NULL;
 +    }
 +#endif
 +
      /* lookup */
-     rc = getaddrinfo(addr, port, &ai, &res);
+     rc = getaddrinfo(saddr->host, saddr->port, &ai, &res);
+     /* At least FreeBSD and OS-X 10.6 declare AI_V4MAPPED but
+      * then don't implement it in their getaddrinfo(). Detect
+      * this and retry without the flag since that's preferrable
+      * to a fatal error
+      */
+     if (rc == EAI_BADFLAGS &&
+         (ai.ai_flags & AI_V4MAPPED)) {
+         atomic_set(&useV4Mapped, 0);
+         ai.ai_flags &= ~AI_V4MAPPED;
+         rc = getaddrinfo(saddr->host, saddr->port, &ai, &res);
+     }
      if (rc != 0) {
-         error_setg(errp, "address resolution failed for %s:%s: %s", addr, port,
-                    gai_strerror(rc));
+         error_setg(errp, "address resolution failed for %s:%s: %s",
+                    saddr->host, saddr->port, gai_strerror(rc));
          return NULL;
      }
      return res;
Simple merge
diff --cc vl.c
index 36172f619911c6097108765dd5167d7f0d19f826,5fd22cb2e919462d676790d907dbf74f32865096..76783f64fed663b0de9463441d52d728e2af1bc0
--- 1/vl.c
--- 2/vl.c
+++ b/vl.c
@@@ -3053,13 -2951,10 +3041,15 @@@ static void set_memory_options(uint64_
                  "'%s' option", slots_str ? "maxmem" : "slots");
          exit(EXIT_FAILURE);
      }
+     loc_pop(&loc);
  }
  
 +#ifdef CONFIG_MARU
 +// W/A for preserve larger continuous heap for RAM.
 +extern void *preallocated_ram_ptr;
 +extern int preallocated_ram_size;
 +#endif
  int main(int argc, char **argv, char **envp)
  {
      int i;
  
      replay_configure(icount_opts);
  
-     opts = qemu_get_machine_opts();
-     optarg = qemu_opt_get(opts, "type");
-     if (optarg) {
-         machine_class = machine_parse(optarg);
-     }
-     if (machine_class == NULL) {
-         error_report("No machine specified, and there is no default");
-         error_printf("Use -machine help to list supported machines\n");
-         exit(1);
-     }
+     machine_class = select_machine();
  
 +#if defined(CONFIG_MARU)
 +    if (is_maru_machine(machine_class)) {
 +        preallocated_ram_ptr = qemu_anon_ram_alloc(ram_size, NULL);
 +        if (preallocated_ram_ptr) {
 +            preallocated_ram_size = ram_size;
 +        }
 +    }
 +#endif
 +
      set_memory_options(&ram_slots, &maxram_size, machine_class);
  
-     loc_set_none();
      os_daemonize();
  
      if (qemu_init_main_loop(&main_loop_err)) {
          exit(1);
      }
  
 -    configure_accelerator(current_machine);
 -
      if (qtest_chrdev) {
-         Error *local_err = NULL;
-         qtest_init(qtest_chrdev, qtest_log, &local_err);
-         if (local_err) {
-             error_report_err(local_err);
-             exit(1);
-         }
+         qtest_init(qtest_chrdev, qtest_log, &error_fatal);
      }
  
      machine_opts = qemu_get_machine_opts();
                            device_init_func, NULL, NULL)) {
          exit(1);
      }
+     rom_reset_order_override();
  
 +#if defined(CONFIG_MARU)
 +    if (is_maru_machine(machine_class)) {
 +        prepare_maru_after_device_init();
 +    }
 +#endif
 +#ifdef CONFIG_VIGS
 +    // To support legacy VIGS options
 +    if (vigs_enabled) {
 +        PCIBus *pci_bus = (PCIBus *) object_resolve_path_type("", TYPE_PCI_BUS, NULL);
 +        PCIDevice *pci_dev = pci_create(pci_bus, -1, "vigs");
 +        if (vigs_backend) {
 +            qdev_prop_set_string(&pci_dev->qdev, "backend", vigs_backend);
 +        } else {
 +            qdev_prop_set_string(&pci_dev->qdev, "backend", "gl");
 +        }
 +        qdev_prop_set_string(&pci_dev->qdev, "wsi", "wsi0");
 +        qdev_init_nofail(&pci_dev->qdev);
 +    }
 +#endif
 +#ifdef CONFIG_YAGL
 +    // To support legacy YaGL options
 +    if (yagl_enabled) {
 +        PCIBus *pci_bus = (PCIBus *) object_resolve_path_type("", TYPE_PCI_BUS, NULL);
 +        PCIDevice *pci_dev = pci_create(pci_bus, -1, "yagl");
 +        if (vigs_enabled) {
 +            qdev_prop_set_string(&pci_dev->qdev, "wsi", "wsi0");
 +        }
 +        qdev_init_nofail(&pci_dev->qdev);
 +    }
 +#endif
 +
      /* Did we create any drives that we failed to create a device for? */
      drive_check_orphaned();
  
  
      os_setup_post();
  
-     if (is_daemonized()) {
-         if (!trace_init_backends(trace_events, trace_file)) {
-             exit(1);
-         }
-     }
 +#ifdef CONFIG_MARU
 +    enable_print_backtrace_at_normal_exit();
 +#endif
      main_loop();
      replay_disable_events();