Merge branch 'upstream_qemu_2.0' into tizen
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 21 Apr 2014 06:32:27 +0000 (15:32 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 21 Apr 2014 06:57:17 +0000 (15:57 +0900)
Initial merge

Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
Conflicts:
.gitignore
Makefile.target
block/raw-win32.c
configure
cpu-exec.c
cpus.c
hw/9pfs/virtio-9p-device.c
hw/i386/pc_piix.c
include/exec/cpu-defs.h
include/qemu-common.h
include/sysemu/sysemu.h
include/ui/console.h
tcg/i386/tcg-target.c
tcg/tcg.h
ui/console.c
ui/input.c
util/oslib-posix.c
vl.c

Change-Id: I52df9052942eea8d541bde75fd936e58a9f2f8ff

52 files changed:
1  2 
.gitignore
Makefile
Makefile.target
arch_init.c
audio/audio.c
block.c
block/raw-win32.c
blockdev.c
configure
cpu-exec.c
cpus.c
default-configs/arm-softmmu.mak
exec.c
hw/9pfs/virtio-9p-device.c
hw/Makefile.objs
hw/acpi/piix4.c
hw/arm/Makefile.objs
hw/display/vga-pci.c
hw/i386/pc.c
hw/i386/pc_piix.c
hw/i386/pc_sysfw.c
hw/intc/apic_common.c
hw/pci/pci-hotplug-old.c
hw/pci/pci.c
hw/usb/dev-hid.c
hw/usb/dev-storage.c
hw/virtio/virtio-pci.c
hw/virtio/virtio-pci.h
include/hw/i386/pc.h
include/qemu-common.h
include/sysemu/kvm.h
include/sysemu/sysemu.h
include/ui/console.h
main-loop.c
net/tap-win32.c
os-win32.c
qapi-schema.json
qemu-char.c
qemu-options.hx
qom/object.c
target-i386/translate.c
tcg/tcg.c
ui/console.c
ui/input.c
ui/sdl.c
ui/spice-input.c
util/oslib-posix.c
util/oslib-win32.c
util/qemu-sockets.c
util/qemu-thread-posix.c
vl.c
xen-all.c

diff --cc .gitignore
Simple merge
diff --cc Makefile
Simple merge
diff --cc Makefile.target
@@@ -149,19 -137,26 +147,33 @@@ endif # CONFIG_SOFTMM
  # Workaround for http://gcc.gnu.org/PR55489, see configure.
  %/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
  
- nested-vars += obj-y
+ dummy := $(call unnest-vars,,obj-y)
+ # we are making another call to unnest-vars with different vars, protect obj-y,
+ # it can be overriden in subdir Makefile.objs
+ obj-y-save := $(obj-y)
+ block-obj-y :=
+ common-obj-y :=
 +
 +# Makefile for TIZEN-maru
 +ifdef CONFIG_MARU
 +include $(SRC_PATH)/tizen/src/Makefile.tizen
 +endif
 +##
 +
- # This resolves all nested paths, so it must come last
  include $(SRC_PATH)/Makefile.objs
+ dummy := $(call unnest-vars,.., \
+                block-obj-y \
+                block-obj-m \
+                common-obj-y \
+                common-obj-m)
+ # Now restore obj-y
+ obj-y := $(obj-y-save)
  
- all-obj-y = $(obj-y)
- all-obj-y += $(addprefix ../, $(common-obj-y))
+ all-obj-y = $(obj-y) $(common-obj-y)
+ all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
  
  ifndef CONFIG_HAIKU
  LIBS+=-lm
diff --cc arch_init.c
Simple merge
diff --cc audio/audio.c
Simple merge
diff --cc block.c
Simple merge
@@@ -205,7 -202,35 +205,36 @@@ static int set_sparse(int fd
                                 NULL, 0, NULL, 0, &returned, NULL);
  }
  
+ static void raw_probe_alignment(BlockDriverState *bs)
+ {
+     BDRVRawState *s = bs->opaque;
+     DWORD sectorsPerCluster, freeClusters, totalClusters, count;
+     DISK_GEOMETRY_EX dg;
+     BOOL status;
+     if (s->type == FTYPE_CD) {
+         bs->request_alignment = 2048;
+         return;
+     }
+     if (s->type == FTYPE_HARDDISK) {
+         status = DeviceIoControl(s->hfile, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX,
+                                  NULL, 0, &dg, sizeof(dg), &count, NULL);
+         if (status != 0) {
+             bs->request_alignment = dg.Geometry.BytesPerSector;
+             return;
+         }
+         /* try GetDiskFreeSpace too */
+     }
+     if (s->drive_path[0]) {
+         GetDiskFreeSpace(s->drive_path, &sectorsPerCluster,
+                          &dg.Geometry.BytesPerSector,
+                          &freeClusters, &totalClusters);
+         bs->request_alignment = dg.Geometry.BytesPerSector;
+     }
+ }
 +#ifndef CONFIG_MARU
  static void raw_parse_flags(int flags, int *access_flags, DWORD *overlapped)
  {
      assert(access_flags != NULL);
          *overlapped |= FILE_FLAG_NO_BUFFERING;
      }
  }
 +#endif
  
+ static void raw_parse_filename(const char *filename, QDict *options,
+                                Error **errp)
+ {
+     /* The filename does not have to be prefixed by the protocol name, since
+      * "file" is the default protocol; therefore, the return value of this
+      * function call can be ignored. */
+     strstart(filename, "file:", &filename);
+     qdict_put_obj(options, "filename", QOBJECT(qstring_from_str(filename)));
+ }
  static QemuOptsList raw_runtime_opts = {
      .name = "raw",
      .head = QTAILQ_HEAD_INITIALIZER(raw_runtime_opts.head),
diff --cc blockdev.c
@@@ -517,20 -504,9 +509,20 @@@ static DriveInfo *blockdev_init(const c
      bdrv_flags |= ro ? 0 : BDRV_O_RDWR;
  
      QINCREF(bs_opts);
-     ret = bdrv_open(dinfo->bdrv, file, bs_opts, bdrv_flags, drv, &error);
+     ret = bdrv_open(&dinfo->bdrv, file, NULL, bs_opts, bdrv_flags, drv, &error);
  
      if (ret < 0) {
 +#ifdef CONFIG_MARU
 +        const char _msg[] = "Failed to load disk file from the following path. Check if the file is corrupted or missing.\n\n";
 +        char* err_msg = NULL;
 +
 +        err_msg = maru_convert_path((char*)_msg, file);
 +        if (err_msg) {
 +            start_simple_client(err_msg);
 +            g_free(err_msg);
 +        }
 +#endif
 +
          error_setg(errp, "could not open disk image %s: %s",
                     file ?: dinfo->id, error_get_pretty(error));
          error_free(error);
diff --cc configure
+++ b/configure
@@@ -243,13 -299,10 +300,15 @@@ rbd="
  smartcard_nss=""
  libusb=""
  usb_redir=""
 +opengl=""
 +efence="no"
 +yagl="no"
 +yagl_stats="no"
  glx=""
 +vigs="no"
  zlib="yes"
+ lzo="no"
+ snappy="no"
  guest_agent=""
  guest_agent_with_vss="no"
  vss_win32_sdk=""
@@@ -259,16 -313,9 +319,17 @@@ libnfs="
  coroutine=""
  coroutine_pool=""
  seccomp=""
 +gl="yes"
 +
 +# for TIZEN-maru 
 +maru="no"
 +shm="no"
 +libav="no"
 +png="no"
 +#
  glusterfs=""
  glusterfs_discard="no"
+ glusterfs_zerofill="no"
  virtio_blk_data_plane=""
  gtk=""
  gtkabi="2.0"
@@@ -1124,190 -1181,178 +1237,195 @@@ cat << EO
  Usage: configure [options]
  Options: [defaults in brackets after descriptions]
  
+ Standard options:
+   --help                   print this message
+   --prefix=PREFIX          install in PREFIX [$prefix]
+   --interp-prefix=PREFIX   where to find shared libraries, etc.
+                            use %M for cpu name [$interp_prefix]
+   --target-list=LIST       set target list (default: build everything)
+ $(echo Available targets: $default_target_list | \
+   fold -s -w 53 | sed -e 's/^/                           /')
+ Advanced options (experts only):
+   --source-path=PATH       path of source code [$source_path]
+   --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]
+   --cc=CC                  use C compiler CC [$cc]
+   --iasl=IASL              use ACPI compiler IASL [$iasl]
+   --host-cc=CC             use C compiler CC [$host_cc] for code run at
+                            build time
+   --cxx=CXX                use C++ compiler CXX [$cxx]
+   --objcc=OBJCC            use Objective-C compiler OBJCC [$objcc]
+   --extra-cflags=CFLAGS    append extra C compiler flags QEMU_CFLAGS
+   --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS
+   --make=MAKE              use specified make [$make]
+   --install=INSTALL        use specified install [$install]
+   --python=PYTHON          use specified python [$python]
+   --smbd=SMBD              use specified smbd [$smbd]
+   --static                 enable static build [$static]
+   --mandir=PATH            install man pages in PATH
+   --datadir=PATH           install firmware in PATH$confsuffix
+   --docdir=PATH            install documentation in PATH$confsuffix
+   --bindir=PATH            install binaries in PATH
+   --libdir=PATH            install libraries in PATH
+   --sysconfdir=PATH        install config in PATH$confsuffix
+   --localstatedir=PATH     install local state in PATH (set at runtime on win32)
+   --with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix]
+   --enable-modules         enable modules support
+   --enable-debug-tcg       enable TCG debugging
+   --disable-debug-tcg      disable TCG debugging (default)
+   --enable-debug-info       enable debugging information (default)
+   --disable-debug-info      disable debugging information
+   --enable-debug           enable common debug build options
+   --enable-sparse          enable sparse checker
+   --disable-sparse         disable sparse checker (default)
+   --disable-strip          disable stripping binaries
+   --disable-werror         disable compilation abort on warning
+   --disable-stack-protector disable compiler-provided stack protection
+   --disable-sdl            disable SDL
+   --enable-sdl             enable SDL
+   --with-sdlabi            select preferred SDL ABI 1.2 or 2.0
+   --disable-gtk            disable gtk UI
+   --enable-gtk             enable gtk UI
+   --disable-virtfs         disable VirtFS
+   --enable-virtfs          enable VirtFS
+   --disable-vnc            disable VNC
+   --enable-vnc             enable VNC
+   --disable-cocoa          disable Cocoa (Mac OS X only)
+   --enable-cocoa           enable Cocoa (default on Mac OS X)
+   --audio-drv-list=LIST    set audio drivers list:
+                            Available drivers: $audio_possible_drivers
+   --block-drv-whitelist=L  Same as --block-drv-rw-whitelist=L
+   --block-drv-rw-whitelist=L
+                            set block driver read-write whitelist
+                            (affects only QEMU, not qemu-img)
+   --block-drv-ro-whitelist=L
+                            set block driver read-only whitelist
+                            (affects only QEMU, not qemu-img)
+   --disable-xen            disable xen backend driver support
+   --enable-xen             enable xen backend driver support
+   --disable-xen-pci-passthrough
+   --enable-xen-pci-passthrough
+   --disable-brlapi         disable BrlAPI
+   --enable-brlapi          enable BrlAPI
+   --disable-vnc-tls        disable TLS encryption for VNC server
+   --enable-vnc-tls         enable TLS encryption for VNC server
+   --disable-vnc-sasl       disable SASL encryption for VNC server
+   --enable-vnc-sasl        enable SASL encryption for VNC server
+   --disable-vnc-jpeg       disable JPEG lossy compression for VNC server
+   --enable-vnc-jpeg        enable JPEG lossy compression for VNC server
+   --disable-vnc-png        disable PNG compression for VNC server (default)
+   --enable-vnc-png         enable PNG compression for VNC server
+   --disable-vnc-ws         disable Websockets support for VNC server
+   --enable-vnc-ws          enable Websockets support for VNC server
+   --disable-curses         disable curses output
+   --enable-curses          enable curses output
+   --disable-curl           disable curl connectivity
+   --enable-curl            enable curl connectivity
+   --disable-fdt            disable fdt device tree
+   --enable-fdt             enable fdt device tree
+   --disable-bluez          disable bluez stack connectivity
+   --enable-bluez           enable bluez stack connectivity
+   --disable-slirp          disable SLIRP userspace network connectivity
+   --disable-kvm            disable KVM acceleration support
+   --enable-kvm             enable KVM acceleration support
+   --disable-rdma           disable RDMA-based migration support
+   --enable-rdma            enable RDMA-based migration support
+   --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)
+   --enable-system          enable all system emulation targets
+   --disable-system         disable all system emulation targets
+   --enable-user            enable supported user emulation targets
+   --disable-user           disable all user emulation targets
+   --enable-linux-user      enable all linux usermode emulation targets
+   --disable-linux-user     disable all linux usermode emulation targets
+   --enable-bsd-user        enable all BSD usermode emulation targets
+   --disable-bsd-user       disable all BSD usermode emulation targets
+   --enable-guest-base      enable GUEST_BASE support for usermode
+                            emulation targets
+   --disable-guest-base     disable GUEST_BASE support
+   --enable-pie             build Position Independent Executables
+   --disable-pie            do not build Position Independent Executables
+   --fmod-lib               path to FMOD library
+   --fmod-inc               path to FMOD includes
+   --oss-lib                path to OSS library
+   --enable-uname-release=R Return R for uname -r in usermode emulation
+   --cpu=CPU                Build for host CPU [$cpu]
+   --disable-uuid           disable uuid support
+   --enable-uuid            enable uuid support
+   --disable-vde            disable support for vde network
+   --enable-vde             enable support for vde network
+   --disable-netmap         disable support for netmap network
+   --enable-netmap          enable support for netmap network
+   --disable-linux-aio      disable Linux AIO support
+   --enable-linux-aio       enable Linux AIO support
+   --disable-cap-ng         disable libcap-ng support
+   --enable-cap-ng          enable libcap-ng support
+   --disable-attr           disables attr and xattr support
+   --enable-attr            enable attr and xattr support
+   --disable-blobs          disable installing provided firmware blobs
+   --enable-docs            enable documentation build
+   --disable-docs           disable documentation build
+   --disable-vhost-net      disable vhost-net acceleration support
+   --enable-vhost-net       enable vhost-net acceleration support
+   --enable-trace-backend=B Set trace backend
+                            Available backends: $($python $source_path/scripts/tracetool.py --list-backends)
+   --with-trace-file=NAME   Full PATH,NAME of file to store traces
+                            Default:trace-<pid>
+   --disable-spice          disable spice
+   --enable-spice           enable spice
+   --enable-rbd             enable building the rados block device (rbd)
+   --disable-libiscsi       disable iscsi support
+   --enable-libiscsi        enable iscsi support
+   --disable-libnfs         disable nfs support
+   --enable-libnfs          enable nfs support
+   --disable-smartcard-nss  disable smartcard nss support
+   --enable-smartcard-nss   enable smartcard nss support
+   --disable-libusb         disable libusb (for usb passthrough)
+   --enable-libusb          enable libusb (for usb passthrough)
+   --disable-usb-redir      disable usb network redirection support
+   --enable-usb-redir       enable usb network redirection support
+   --enable-lzo             enable the support of lzo compression library
+   --enable-snappy          enable the support of snappy compression library
+   --disable-guest-agent    disable building of the QEMU Guest Agent
+   --enable-guest-agent     enable building of the QEMU Guest Agent
+   --with-vss-sdk=SDK-path  enable Windows VSS support in QEMU Guest Agent
+   --with-win-sdk=SDK-path  path to Windows Platform SDK (to build VSS .tlb)
+   --disable-seccomp        disable seccomp support
+   --enable-seccomp         enables seccomp support
+   --with-coroutine=BACKEND coroutine backend. Supported options:
+                            gthread, ucontext, sigaltstack, windows
+   --disable-coroutine-pool disable coroutine freelist (worse performance)
+   --enable-coroutine-pool  enable coroutine freelist (better performance)
+   --enable-glusterfs       enable GlusterFS backend
+   --disable-glusterfs      disable GlusterFS backend
+   --enable-gcov            enable test coverage analysis with gcov
+   --gcov=GCOV              use specified gcov [$gcov_tool]
+   --enable-tpm             enable TPM support
+   --disable-libssh2        disable ssh block device support
+   --enable-libssh2         enable ssh block device support
+   --disable-vhdx           disables support for the Microsoft VHDX image format
+   --enable-vhdx            enable support for the Microsoft VHDX image format
+   --disable-quorum         disable quorum block filter support
+   --enable-quorum          enable quorum block filter support
++  --disable-hax            disable HAX acceleration support
++  --enable-hax             enable HAX acceleration support
++  --disable-gl             disable GL acceleration support
++  --enable-gl              enable GL acceleration support
++  --enable-yagl            enable YaGL device
++  --disable-yagl           disable YaGL device
++  --enable-yagl-stats      enable YaGL stats
++  --disable-yagl-stats     disable YaGL stats
++  --enable-vigs            enable VIGS device
++  --disable-vigs           disable VIGS device
++
++TIZEN-maru options:
++  --enable-maru            enable maru board
++  --enable-shm             enable shared memory for framebuffer
++  --enable-libav           enable libav library
++  --enable-png             enable png library
++
+ NOTE: The object files are built at the place where configure is launched
  EOF
- echo "Standard options:"
- echo "  --help                   print this message"
- echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
- echo "  --interp-prefix=PREFIX   where to find shared libraries, etc."
- echo "                           use %M for cpu name [$interp_prefix]"
- echo "  --target-list=LIST       set target list (default: build everything)"
- echo "Available targets: $default_target_list" | \
-     fold -s -w 53 | sed -e 's/^/                           /'
- echo ""
- echo "Advanced options (experts only):"
- echo "  --source-path=PATH       path of source code [$source_path]"
- echo "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
- echo "  --cc=CC                  use C compiler CC [$cc]"
- echo "  --iasl=IASL              use ACPI compiler IASL [$iasl]"
- echo "  --host-cc=CC             use C compiler CC [$host_cc] for code run at"
- echo "                           build time"
- echo "  --cxx=CXX                use C++ compiler CXX [$cxx]"
- echo "  --objcc=OBJCC            use Objective-C compiler OBJCC [$objcc]"
- echo "  --extra-cflags=CFLAGS    append extra C compiler flags QEMU_CFLAGS"
- echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
- echo "  --make=MAKE              use specified make [$make]"
- echo "  --install=INSTALL        use specified install [$install]"
- echo "  --python=PYTHON          use specified python [$python]"
- echo "  --smbd=SMBD              use specified smbd [$smbd]"
- echo "  --static                 enable static build [$static]"
- echo "  --mandir=PATH            install man pages in PATH"
- echo "  --datadir=PATH           install firmware in PATH$confsuffix"
- echo "  --docdir=PATH            install documentation in PATH$confsuffix"
- echo "  --bindir=PATH            install binaries in PATH"
- echo "  --libdir=PATH            install libraries in PATH"
- echo "  --sysconfdir=PATH        install config in PATH$confsuffix"
- echo "  --localstatedir=PATH     install local state in PATH (set at runtime on win32)"
- echo "  --with-confsuffix=SUFFIX suffix for QEMU data inside datadir and sysconfdir [$confsuffix]"
- echo "  --enable-debug-tcg       enable TCG debugging"
- echo "  --disable-debug-tcg      disable TCG debugging (default)"
- echo "  --enable-debug-info       enable debugging information (default)"
- echo "  --disable-debug-info      disable debugging information"
- echo "  --enable-debug           enable common debug build options"
- echo "  --enable-sparse          enable sparse checker"
- echo "  --disable-sparse         disable sparse checker (default)"
- echo "  --disable-strip          disable stripping binaries"
- echo "  --disable-werror         disable compilation abort on warning"
- echo "  --disable-sdl            disable SDL"
- echo "  --enable-sdl             enable SDL"
- echo "  --disable-gtk            disable gtk UI"
- echo "  --enable-gtk             enable gtk UI"
- echo "  --disable-virtfs         disable VirtFS"
- echo "  --enable-virtfs          enable VirtFS"
- echo "  --disable-vnc            disable VNC"
- echo "  --enable-vnc             enable VNC"
- echo "  --disable-cocoa          disable Cocoa (Mac OS X only)"
- echo "  --enable-cocoa           enable Cocoa (default on Mac OS X)"
- echo "  --audio-drv-list=LIST    set audio drivers list:"
- echo "                           Available drivers: $audio_possible_drivers"
- echo "  --block-drv-whitelist=L  Same as --block-drv-rw-whitelist=L"
- echo "  --block-drv-rw-whitelist=L"
- echo "                           set block driver read-write whitelist"
- echo "                           (affects only QEMU, not qemu-img)"
- echo "  --block-drv-ro-whitelist=L"
- echo "                           set block driver read-only whitelist"
- echo "                           (affects only QEMU, not qemu-img)"
- echo "  --disable-xen            disable xen backend driver support"
- echo "  --enable-xen             enable xen backend driver support"
- echo "  --disable-xen-pci-passthrough"
- echo "  --enable-xen-pci-passthrough"
- echo "  --disable-brlapi         disable BrlAPI"
- echo "  --enable-brlapi          enable BrlAPI"
- echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
- echo "  --enable-vnc-tls         enable TLS encryption for VNC server"
- echo "  --disable-vnc-sasl       disable SASL encryption for VNC server"
- echo "  --enable-vnc-sasl        enable SASL encryption for VNC server"
- echo "  --disable-vnc-jpeg       disable JPEG lossy compression for VNC server"
- echo "  --enable-vnc-jpeg        enable JPEG lossy compression for VNC server"
- echo "  --disable-vnc-png        disable PNG compression for VNC server (default)"
- echo "  --enable-vnc-png         enable PNG compression for VNC server"
- echo "  --disable-vnc-ws         disable Websockets support for VNC server"
- echo "  --enable-vnc-ws          enable Websockets support for VNC server"
- echo "  --disable-curses         disable curses output"
- echo "  --enable-curses          enable curses output"
- echo "  --disable-curl           disable curl connectivity"
- echo "  --enable-curl            enable curl connectivity"
- echo "  --disable-fdt            disable fdt device tree"
- echo "  --enable-fdt             enable fdt device tree"
- echo "  --disable-bluez          disable bluez stack connectivity"
- echo "  --enable-bluez           enable bluez stack connectivity"
- echo "  --disable-slirp          disable SLIRP userspace network connectivity"
- echo "  --disable-kvm            disable KVM acceleration support"
- echo "  --enable-kvm             enable KVM acceleration support"
- echo "  --disable-hax            disable HAX acceleration support"
- echo "  --enable-hax             enable HAX acceleration support"
- echo "  --disable-gl             disable GL acceleration support"
- echo "  --enable-gl              enable GL acceleration support"
- echo "  --disable-rdma           disable RDMA-based migration support"
- echo "  --enable-rdma            enable RDMA-based migration support"
- echo "  --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)"
- echo "  --enable-system          enable all system emulation targets"
- echo "  --disable-system         disable all system emulation targets"
- echo "  --enable-user            enable supported user emulation targets"
- echo "  --disable-user           disable all user emulation targets"
- echo "  --enable-linux-user      enable all linux usermode emulation targets"
- echo "  --disable-linux-user     disable all linux usermode emulation targets"
- echo "  --enable-bsd-user        enable all BSD usermode emulation targets"
- echo "  --disable-bsd-user       disable all BSD usermode emulation targets"
- echo "  --enable-guest-base      enable GUEST_BASE support for usermode"
- echo "                           emulation targets"
- echo "  --disable-guest-base     disable GUEST_BASE support"
- echo "  --enable-pie             build Position Independent Executables"
- echo "  --disable-pie            do not build Position Independent Executables"
- echo "  --fmod-lib               path to FMOD library"
- echo "  --fmod-inc               path to FMOD includes"
- echo "  --oss-lib                path to OSS library"
- echo "  --enable-uname-release=R Return R for uname -r in usermode emulation"
- echo "  --cpu=CPU                Build for host CPU [$cpu]"
- echo "  --disable-uuid           disable uuid support"
- echo "  --enable-uuid            enable uuid support"
- echo "  --disable-vde            disable support for vde network"
- echo "  --enable-vde             enable support for vde network"
- echo "  --disable-linux-aio      disable Linux AIO support"
- echo "  --enable-linux-aio       enable Linux AIO support"
- echo "  --disable-cap-ng         disable libcap-ng support"
- echo "  --enable-cap-ng          enable libcap-ng support"
- echo "  --disable-attr           disables attr and xattr support"
- echo "  --enable-attr            enable attr and xattr support"
- echo "  --disable-blobs          disable installing provided firmware blobs"
- echo "  --enable-docs            enable documentation build"
- echo "  --disable-docs           disable documentation build"
- echo "  --disable-vhost-net      disable vhost-net acceleration support"
- echo "  --enable-vhost-net       enable vhost-net acceleration support"
- echo "  --enable-trace-backend=B Set trace backend"
- echo "                           Available backends:" $($python "$source_path"/scripts/tracetool.py --list-backends)
- echo "  --with-trace-file=NAME   Full PATH,NAME of file to store traces"
- echo "                           Default:trace-<pid>"
- echo "  --disable-spice          disable spice"
- echo "  --enable-spice           enable spice"
- echo "  --enable-rbd             enable building the rados block device (rbd)"
- echo "  --disable-libiscsi       disable iscsi support"
- echo "  --enable-libiscsi        enable iscsi support"
- echo "  --enable-efence          enable Electic Fence"
- echo "  --disable-efence         disable Electic Fence"
- echo "  --enable-yagl            enable YaGL device"
- echo "  --disable-yagl           disable YaGL device"
- echo "  --enable-yagl-stats      enable YaGL stats"
- echo "  --disable-yagl-stats     disable YaGL stats"
- echo "  --enable-vigs            enable VIGS device"
- echo "  --disable-vigs           disable VIGS device"
- echo "  --disable-smartcard      disable smartcard support"
- echo "  --enable-smartcard       enable smartcard support"
- echo "  --disable-smartcard-nss  disable smartcard nss support"
- echo "  --enable-smartcard-nss   enable smartcard nss support"
- echo "  --disable-libusb         disable libusb (for usb passthrough)"
- echo "  --enable-libusb          enable libusb (for usb passthrough)"
- echo "  --disable-usb-redir      disable usb network redirection support"
- echo "  --enable-usb-redir       enable usb network redirection support"
- echo "  --disable-guest-agent    disable building of the QEMU Guest Agent"
- echo "  --enable-guest-agent     enable building of the QEMU Guest Agent"
- echo "  --with-vss-sdk=SDK-path  enable Windows VSS support in QEMU Guest Agent"
- echo "  --with-win-sdk=SDK-path  path to Windows Platform SDK (to build VSS .tlb)"
- echo "  --disable-seccomp        disable seccomp support"
- echo "  --enable-seccomp         enables seccomp support"
- echo "  --with-coroutine=BACKEND coroutine backend. Supported options:"
- echo "                           gthread, ucontext, sigaltstack, windows"
- echo "  --disable-coroutine-pool disable coroutine freelist (worse performance)"
- echo "  --enable-coroutine-pool  enable coroutine freelist (better performance)"
- echo "  --enable-glusterfs       enable GlusterFS backend"
- echo "  --disable-glusterfs      disable GlusterFS backend"
- echo "  --enable-gcov            enable test coverage analysis with gcov"
- echo "  --gcov=GCOV              use specified gcov [$gcov_tool]"
- echo "  --enable-tpm             enable TPM support"
- echo "  --disable-libssh2        disable ssh block device support"
- echo "  --enable-libssh2         enable ssh block device support"
- echo "  --disable-vhdx           disables support for the Microsoft VHDX image format"
- echo "  --enable-vhdx            enable support for the Microsoft VHDX image format"
- echo ""
- # for TIZEN-maru
- echo "TIZEN-maru options:"
- echo "  --enable-maru            enable maru board"
- echo "  --enable-shm             enable shared memory for framebuffer"
- echo "  --enable-libav           enable libav library"
- echo "  --enable-png             enable png library"
- echo "NOTE: The object files are built at the place where configure is launched"
  exit 1
  fi
  
@@@ -3937,13 -4159,13 +4313,14 @@@ echo "xfsctl support    $xfs
  echo "nss used          $smartcard_nss"
  echo "libusb            $libusb"
  echo "usb net redir     $usb_redir"
- echo "OpenGL support    $opengl"
 +echo "EFence support    $efence"
- echo "YaGL support      $yagl"
- echo "YaGL stats        $yagl_stats"
  echo "GLX support       $glx"
- echo "VIGS support      $vigs"
+ if test "$libiscsi_version" = "1.4.0"; then
+ echo "libiscsi support  $libiscsi (1.4.0)"
+ else
  echo "libiscsi support  $libiscsi"
+ fi
+ echo "libnfs support    $libnfs"
  echo "build guest agent $guest_agent"
  echo "QGA VSS support   $guest_agent_with_vss"
  echo "seccomp support   $seccomp"
@@@ -3958,14 -4180,10 +4335,24 @@@ echo "libssh2 support   $libssh2
  echo "TPM passthrough   $tpm_passthrough"
  echo "QOM debugging     $qom_cast_debug"
  echo "vhdx              $vhdx"
+ echo "Quorum            $quorum"
+ echo "lzo support       $lzo"
+ echo "snappy support    $snappy"
++echo "HAX support       $hax"
++echo "GL support        $gl"
++echo "YaGL support      $yagl"
++echo "YaGL stats        $yagl_stats"
++echo "OpenGL support    $opengl"
++echo "VIGS support      $vigs"
 +
 +# for TIZEN-maru
 +echo "TIZEN-maru support $maru"
 +echo "TIZEN-maru shared framebuffer support $shm"
 +echo "TIZEN-maru libav support $libav"
 +echo "TIZEN-maru png support $png"
 +#
 +
  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
  #include "tcg.h"
  #include "qemu/atomic.h"
  #include "sysemu/qtest.h"
 +#include "sysemu/hax.h"
  
bool qemu_cpu_has_work(CPUState *cpu)
void cpu_loop_exit(CPUState *cpu)
  {
-     return cpu_has_work(cpu);
- }
- void cpu_loop_exit(CPUArchState *env)
- {
-     CPUState *cpu = ENV_GET_CPU(env);
      cpu->current_tb = NULL;
-     siglongjmp(env->jmp_env, 1);
+     siglongjmp(cpu->jmp_env, 1);
  }
  
  /* exit the current TB from a signal handler. The host registers are
@@@ -363,11 -356,7 +381,11 @@@ int cpu_exec(CPUArchState *env
                              cpu_svm_check_intercept_param(env, SVM_EXIT_SMI,
                                                            0);
                              cpu->interrupt_request &= ~CPU_INTERRUPT_SMI;
-                             do_smm_enter(x86_env_get_cpu(env));
 +#ifdef CONFIG_HAX
 +                            if (hax_enabled())
 +                                env->hax_vcpu->resync = 1;
 +#endif
+                             do_smm_enter(x86_cpu);
                              next_tb = 0;
                          } else if ((interrupt_request & CPU_INTERRUPT_NMI) &&
                                     !(env->hflags2 & HF2_NMI_MASK)) {
diff --cc cpus.c
--- 1/cpus.c
--- 2/cpus.c
+++ b/cpus.c
@@@ -1125,12 -1116,15 +1124,19 @@@ void resume_all_vcpus(void
      }
  }
  
+ /* For temporary buffers for forming a name */
+ #define VCPU_THREAD_NAME_SIZE 16
  static void qemu_tcg_init_vcpu(CPUState *cpu)
  {
 +#ifdef        CONFIG_HAX
 +      if (hax_enabled())
 +              hax_init_vcpu(cpu->env_ptr);
 +#endif
+     char thread_name[VCPU_THREAD_NAME_SIZE];
+     tcg_cpu_address_space_init(cpu, cpu->as);
      /* share a single thread for all cpus with TCG */
      if (!tcg_cpu_thread) {
          cpu->thread = g_malloc0(sizeof(QemuThread));
@@@ -80,6 -82,9 +83,10 @@@ CONFIG_ZYNQ=
  CONFIG_VERSATILE_PCI=y
  CONFIG_VERSATILE_I2C=y
  
 +CONFIG_SOUND=y
  CONFIG_SDHCI=y
  CONFIG_INTEGRATOR_DEBUG=y
+ CONFIG_ALLWINNER_A10_PIT=y
+ CONFIG_ALLWINNER_A10_PIC=y
+ CONFIG_ALLWINNER_A10=y
diff --cc exec.c
Simple merge
@@@ -104,18 -100,8 +105,17 @@@ static void virtio_9p_device_realize(De
      qemu_co_rwlock_init(&s->rename_lock);
  
      if (s->ops->init(&s->ctx) < 0) {
-         fprintf(stderr, "Virtio-9p Failed to initialize fs-driver with id:%s"
-                 " and export path:%s\n", s->fsconf.fsdev_id, s->ctx.fs_root);
+         error_setg(errp, "Virtio-9p Failed to initialize fs-driver with id:%s"
+                    " and export path:%s", s->fsconf.fsdev_id, s->ctx.fs_root);
 +#ifdef CONFIG_MARU
 +        const char _msg[] = "Failed to find the file sharing path. Check if the path is correct or not.\n\n";
 +        char* err_msg = NULL;
 +        err_msg = maru_convert_path((char*)_msg, s->ctx.fs_root);
 +              maru_register_exit_msg(MARU_EXIT_UNKNOWN, err_msg);
 +        if (err_msg) {
 +            g_free(err_msg);
 +        }
 +#endif
          goto out;
      }
      if (v9fs_init_worker_threads() < 0) {
Simple merge
diff --cc hw/acpi/piix4.c
  #include "hw/nvram/fw_cfg.h"
  #include "exec/address-spaces.h"
  #include "hw/acpi/piix4.h"
+ #include "hw/acpi/pcihp.h"
+ #include "hw/acpi/cpu_hotplug.h"
+ #include "hw/hotplug.h"
  
 +#ifdef CONFIG_MARU
 +#include "tizen/src/hw/maru_pm.h"
 +#endif
 +
  //#define DEBUG
  
  #ifdef DEBUG
@@@ -1,35 -1,10 +1,38 @@@
 +obj-y = arm_pic.o
 +obj-y += arm_boot.o
 +obj-y += zynq_slcr.o
 +obj-y += arm_gic.o arm_gic_common.o
 +obj-y += realview_gic.o arm_sysctl.o arm11mpcore.o a9mpcore.o
 +obj-y += exynos4210_gic.o exynos4210_combiner.o exynos4210.o
 +obj-y += exynos4_boards.o exynos4210_uart.o exynos4210_pwm.o
 +obj-y += exynos4210_pmu.o exynos4210_mct.o exynos4210_fimd.o
 +obj-y += exynos4210_rtc.o exynos4210_i2c.o
 +obj-y += exynos4210_cmu.o exynos4210_g3d.o
 +obj-y += exynos4210_i2s.o exynos4210_audio.o
 +obj-y += arm_mptimer.o a15mpcore.o
 +obj-y += armv7m.o armv7m_nvic.o stellaris_enet.o
 +obj-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
 +obj-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
 +obj-y += zaurus.o ide/microdrive.o tc6393xb.o
 +obj-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o \
 +                omap_gpio.o omap_intc.o omap_uart.o
 +obj-y += omap2.o omap_dss.o soc_dma.o omap_gptimer.o omap_synctimer.o \
 +                omap_gpmc.o omap_sdrc.o omap_spi.o omap_tap.o omap_l4.o
 +obj-y += tsc210x.o
 +obj-y += blizzard.o onenand.o cbus.o tusb6010.o usb/hcd-musb.o
 +obj-y += mst_fpga.o
 +obj-y += bitbang_i2c.o marvell_88w8618_audio.o
 +obj-y += framebuffer.o
 +obj-y += strongarm.o
 +obj-y += imx_serial.o imx_ccm.o imx_timer.o imx_avic.o
 +obj-$(CONFIG_FDT) += ../device_tree.o
  obj-y += boot.o collie.o exynos4_boards.o gumstix.o highbank.o
+ obj-$(CONFIG_DIGIC) += digic_boards.o
  obj-y += integratorcp.o kzm.o mainstone.o musicpal.o nseries.o
  obj-y += omap_sx1.o palm.o realview.o spitz.o stellaris.o
- obj-y += tosa.o versatilepb.o vexpress.o xilinx_zynq.o z2.o
+ obj-y += tosa.o versatilepb.o vexpress.o virt.o xilinx_zynq.o z2.o
  
  obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o
+ obj-$(CONFIG_DIGIC) += digic.o
  obj-y += omap1.o omap2.o strongarm.o
+ obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o
@@@ -197,13 -190,8 +197,12 @@@ static void vga_class_init(ObjectClass 
      DeviceClass *dc = DEVICE_CLASS(klass);
      PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
  
-     k->no_hotplug = 1;
      k->init = pci_std_vga_initfn;
 +#ifdef CONFIG_MARU
 +    k->romfile = "vgabios-maruvga.bin";
 +#else
      k->romfile = "vgabios-stdvga.bin";
 +#endif
      k->vendor_id = PCI_VENDOR_ID_QEMU;
      k->device_id = PCI_DEVICE_ID_QEMU_VGA;
      k->class_id = PCI_CLASS_DISPLAY_VGA;
diff --cc hw/i386/pc.c
Simple merge
@@@ -135,10 -143,11 +150,15 @@@ static void pc_init1(QEMUMachineInitArg
      guest_info->has_pci_info = has_pci_info;
      guest_info->isapc_ram_fw = !pci_enabled;
  
+     if (smbios_type1_defaults) {
+         /* These values are guest ABI, do not change */
+         smbios_set_type1_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)",
+                                   args->machine->name);
+     }
 +#ifdef CONFIG_MARU
 +    // for ramdump...
 +    global_ram_memory = ram_memory;
 +#endif
  
      /* allocate ram and load rom/bios */
      if (!xen_enabled()) {
Simple merge
Simple merge
Simple merge
diff --cc hw/pci/pci.c
Simple merge
Simple merge
Simple merge
@@@ -646,9 -666,9 +666,9 @@@ static void virtio_pci_vq_vector_mask(V
  
      /* If guest supports masking, keep irqfd but mask it.
       * Otherwise, clean it up now.
 -     */ 
 +     */
      if (k->guest_notifier_mask) {
-         k->guest_notifier_mask(proxy->vdev, queue_no, true);
+         k->guest_notifier_mask(vdev, queue_no, true);
      } else {
          kvm_virtio_pci_irqfd_release(proxy, queue_no, vector);
      }
Simple merge
Simple merge
@@@ -478,11 -472,6 +472,13 @@@ size_t buffer_find_nonzero_offset(cons
   */
  int parse_debug_env(const char *name, int max, int initial);
  
+ const char *qemu_ether_ntoa(const MACAddr *mac);
 +#if defined(CONFIG_MARU) && defined(CONFIG_WIN32)
 +#include "../tizen/src/maru_common.h"
 +
 +int is_wow64(void);
 +bool get_java_path(char **java_path);
 +#endif
 +
  #endif
Simple merge
@@@ -107,9 -104,7 +107,10 @@@ extern int autostart
  
  typedef enum {
      VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
 -    VGA_TCX, VGA_CG3, VGA_DEVICE
++    VGA_TCX, VGA_CG3, VGA_DEVICE,
 +#ifdef CONFIG_MARU
 +    VGA_MARU,
 +#endif
  } VGAInterfaceType;
  
  extern int vga_interface_type;
@@@ -49,30 -46,8 +50,19 @@@ void qemu_activate_mouse_event_handler(
  QEMUPutLEDEntry *qemu_add_led_event_handler(QEMUPutLEDEvent *func, void *opaque);
  void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry);
  
- void kbd_put_keycode(int keycode);
  void kbd_put_ledstate(int ledstate);
- void kbd_mouse_event(int dx, int dy, int dz, int buttons_state);
  
- /* Does the current mouse generate absolute events */
- int kbd_mouse_is_absolute(void);
- void qemu_add_mouse_mode_change_notifier(Notifier *notify);
- void qemu_remove_mouse_mode_change_notifier(Notifier *notify);
- /* Of all the mice, is there one that generates absolute events */
- int kbd_mouse_has_absolute(void);
 +#ifdef CONFIG_MARU
 +QEMUPutKbdEntry *qemu_add_ps2kbd_event_handler(QEMUPutKBDEvent *func,
 +                                               void *opaque);
 +void qemu_remove_ps2kbd_event_handler(QEMUPutKbdEntry *entry);
 +void ps2kbd_put_keycode(int keycode);
 +void hwkey_put_keycode(int type, int keycode);
 +void rotation_put_type(int type);
 +void hostkbd_put_type(int type);
 +void tizen_close_put_type(int type);
 +#endif
 +
  struct MouseTransformInfo {
      /* Touchscreen resolution */
      int x;
diff --cc main-loop.c
Simple merge
diff --cc net/tap-win32.c
Simple merge
diff --cc os-win32.c
@@@ -88,29 -82,11 +88,12 @@@ void os_setup_early_signal_handling(voi
      timeBeginPeriod(mm_tc.wPeriodMin);
      atexit(os_undo_timer_resolution);
  }
 +#endif  /* CONFIG_MARU */
  
  /* Look for support files in the same directory as the executable.  */
- char *os_find_datadir(const char *argv0)
+ char *os_find_datadir(void)
  {
-     char *p;
-     char buf[MAX_PATH];
-     DWORD len;
-     len = GetModuleFileName(NULL, buf, sizeof(buf) - 1);
-     if (len == 0) {
-         return NULL;
-     }
-     buf[len] = 0;
-     p = buf + len - 1;
-     while (p != buf && *p != '\\')
-         p--;
-     *p = 0;
-     if (access(buf, R_OK) == 0) {
-         return g_strdup(buf);
-     }
-     return NULL;
+     return qemu_get_exec_dir();
  }
  
  void os_set_line_buffering(void)
Simple merge
diff --cc qemu-char.c
Simple merge
diff --cc qemu-options.hx
Simple merge
diff --cc qom/object.c
Simple merge
Simple merge
diff --cc tcg/tcg.c
Simple merge
diff --cc ui/console.c
  #include "qemu/timer.h"
  #include "qmp-commands.h"
  #include "sysemu/char.h"
+ #include "trace.h"
  
- //#define DEBUG_CONSOLE
 +#ifdef SDL_THREAD
 +#include <pthread.h>
 +extern pthread_mutex_t sdl_mutex;
 +#endif
 +
  #define DEFAULT_BACKSCROLL 512
  #define MAX_CONSOLES 12
  #define CONSOLE_CURSOR_PERIOD 500
diff --cc ui/input.c
@@@ -1,82 -1,19 +1,34 @@@
- /*
-  * QEMU System Emulator
-  *
-  * Copyright (c) 2003-2008 Fabrice Bellard
-  *
-  * Permission is hereby granted, free of charge, to any person obtaining a copy
-  * of this software and associated documentation files (the "Software"), to deal
-  * in the Software without restriction, including without limitation the rights
-  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-  * copies of the Software, and to permit persons to whom the Software is
-  * furnished to do so, subject to the following conditions:
-  *
-  * The above copyright notice and this permission notice shall be included in
-  * all copies or substantial portions of the Software.
-  *
-  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-  * THE SOFTWARE.
-  */
- #if defined CONFIG_MARU && defined CONFIG_LINUX
- #include <pthread.h>
- #endif
  #include "sysemu/sysemu.h"
- #include "monitor/monitor.h"
- #include "ui/console.h"
- #include "qapi/error.h"
- #include "qmp-commands.h"
  #include "qapi-types.h"
- #include "ui/keymaps.h"
+ #include "qmp-commands.h"
+ #include "trace.h"
+ #include "ui/input.h"
+ #include "ui/console.h"
  
- struct QEMUPutMouseEntry {
-     QEMUPutMouseEvent *qemu_put_mouse_event;
-     void *qemu_put_mouse_event_opaque;
-     int qemu_put_mouse_event_absolute;
-     char *qemu_put_mouse_event_name;
-     int index;
-     /* used internally by qemu for handling mice */
-     QTAILQ_ENTRY(QEMUPutMouseEntry) node;
 +#if defined CONFIG_MARU && defined CONFIG_LINUX
++#include <pthread.h>
++
 +extern void maru_hwkey_event(int event_type, int keycode);
 +extern void do_rotation_event(int rotation_type);
 +extern void do_host_kbd_enable(bool on);
 +extern void shutdown_qemu_gracefully(void);
 +extern void request_close(void);
 +void* tizen_close_thread(void* data);
 +#endif
 +
 +//#include "tizen/src/debug_ch.h"
 +
 +//MULTI_DEBUG_CHANNEL(tizen, input);
 +
+ struct QemuInputHandlerState {
+     DeviceState       *dev;
+     QemuInputHandler  *handler;
+     int               id;
+     int               events;
+     QTAILQ_ENTRY(QemuInputHandlerState) node;
  };
- struct QEMUPutKbdEntry {
-     QEMUPutKBDEvent *put_kbd;
-     void *opaque;
-     QTAILQ_ENTRY(QEMUPutKbdEntry) next;
- };
- struct QEMUPutLEDEntry {
-     QEMUPutLEDEvent *put_led;
-     void *opaque;
-     QTAILQ_ENTRY(QEMUPutLEDEntry) next;
- };
- static QTAILQ_HEAD(, QEMUPutLEDEntry) led_handlers =
-     QTAILQ_HEAD_INITIALIZER(led_handlers);
- static QTAILQ_HEAD(, QEMUPutKbdEntry) kbd_handlers =
-     QTAILQ_HEAD_INITIALIZER(kbd_handlers);
- static QTAILQ_HEAD(, QEMUPutMouseEntry) mouse_handlers =
-     QTAILQ_HEAD_INITIALIZER(mouse_handlers);
+ static QTAILQ_HEAD(, QemuInputHandlerState) handlers =
+     QTAILQ_HEAD_INITIALIZER(handlers);
  static NotifierList mouse_mode_notifiers =
      NOTIFIER_LIST_INITIALIZER(mouse_mode_notifiers);
  
@@@ -436,162 -239,77 +254,153 @@@ void qemu_input_update_buttons(QemuCons
      }
  }
  
void kbd_put_ledstate(int ledstate)
bool qemu_input_is_absolute(void)
  {
-     QEMUPutLEDEntry *cursor;
+     QemuInputHandlerState *s;
  
-     QTAILQ_FOREACH(cursor, &led_handlers, next) {
-         cursor->put_led(cursor->opaque, ledstate);
-     }
+     s = qemu_input_find_handler(INPUT_EVENT_MASK_REL | INPUT_EVENT_MASK_ABS);
+     return (s != NULL) && (s->handler->mask & INPUT_EVENT_MASK_ABS);
  }
  
void kbd_mouse_event(int dx, int dy, int dz, int buttons_state)
int qemu_input_scale_axis(int value, int size_in, int size_out)
  {
-     QEMUPutMouseEntry *entry;
-     QEMUPutMouseEvent *mouse_event;
-     void *mouse_event_opaque;
-     int width, height;
-     if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
-         return;
-     }
-     if (QTAILQ_EMPTY(&mouse_handlers)) {
-         return;
+     if (size_in < 2) {
+         return size_out / 2;
      }
- #if defined (CONFIG_MARU)
++#if 0 //defined (CONFIG_MARU)
 +    QTAILQ_FOREACH(entry, &mouse_handlers, node) {
 +        /* if mouse event is wheelup ,wheeldown or move
 +              then go to ps2 mouse event(index == 0) */
 +        if (buttons_state > 3  && entry->index == 0) {
 +            //INFO("input device: %s, event: %d\n", entry->qemu_put_mouse_event_name, buttons_state);
 +            buttons_state = 0;
 +            mouse_event = entry->qemu_put_mouse_event;
 +            mouse_event_opaque = entry->qemu_put_mouse_event_opaque;
 +            break;
 +        }
 +    }
 +    /* other events(mouse up, down and drag), go to touch screen */
 +    if (!entry) {
 +        entry = QTAILQ_FIRST(&mouse_handlers);
 +        mouse_event = entry->qemu_put_mouse_event;
 +        mouse_event_opaque = entry->qemu_put_mouse_event_opaque;
 +        //INFO("input device: %s, event: %d\n", entry->qemu_put_mouse_event_name, buttons_state);
 +    }
- #else
-     entry = QTAILQ_FIRST(&mouse_handlers);
-     mouse_event = entry->qemu_put_mouse_event;
-     mouse_event_opaque = entry->qemu_put_mouse_event_opaque;
 +#endif
 +
-     if (mouse_event) {
-         if (entry->qemu_put_mouse_event_absolute) {
-             width = 0x7fff;
-             height = 0x7fff;
-         } else {
-             width = graphic_width - 1;
-             height = graphic_height - 1;
-         }
+     return (int64_t)value * (size_out - 1) / (size_in - 1);
+ }
  
-         switch (graphic_rotate) {
-         case 0:
-             mouse_event(mouse_event_opaque,
-                         dx, dy, dz, buttons_state);
-             break;
-         case 90:
-             mouse_event(mouse_event_opaque,
-                         width - dy, dx, dz, buttons_state);
-             break;
-         case 180:
-             mouse_event(mouse_event_opaque,
-                         width - dx, height - dy, dz, buttons_state);
-             break;
-         case 270:
-             mouse_event(mouse_event_opaque,
-                         dy, height - dx, dz, buttons_state);
-             break;
-         }
-     }
+ InputEvent *qemu_input_event_new_move(InputEventKind kind,
+                                       InputAxis axis, int value)
+ {
+     InputEvent *evt = g_new0(InputEvent, 1);
+     InputMoveEvent *move = g_new0(InputMoveEvent, 1);
+     evt->kind = kind;
+     evt->data = move;
+     move->axis = axis;
+     move->value = value;
+     return evt;
  }
  
int kbd_mouse_is_absolute(void)
void qemu_input_queue_rel(QemuConsole *src, InputAxis axis, int value)
  {
-     if (QTAILQ_EMPTY(&mouse_handlers)) {
-         return 0;
-     }
+     InputEvent *evt;
+     evt = qemu_input_event_new_move(INPUT_EVENT_KIND_REL, axis, value);
+     qemu_input_event_send(src, evt);
+     qapi_free_InputEvent(evt);
+ }
  
-     return QTAILQ_FIRST(&mouse_handlers)->qemu_put_mouse_event_absolute;
+ void qemu_input_queue_abs(QemuConsole *src, InputAxis axis, int value, int size)
+ {
+     InputEvent *evt;
+     int scaled = qemu_input_scale_axis(value, size, INPUT_EVENT_ABS_SIZE);
+     evt = qemu_input_event_new_move(INPUT_EVENT_KIND_ABS, axis, scaled);
+     qemu_input_event_send(src, evt);
+     qapi_free_InputEvent(evt);
  }
  
int kbd_mouse_has_absolute(void)
void qemu_input_check_mode_change(void)
  {
-     QEMUPutMouseEntry *entry;
+     static int current_is_absolute;
+     int is_absolute;
  
-     QTAILQ_FOREACH(entry, &mouse_handlers, node) {
-         if (entry->qemu_put_mouse_event_absolute) {
-             return 1;
-         }
+     is_absolute = qemu_input_is_absolute();
+     if (is_absolute != current_is_absolute) {
+         trace_input_mouse_mode(is_absolute);
+         notifier_list_notify(&mouse_mode_notifiers, NULL);
      }
  
-     return 0;
+     current_is_absolute = is_absolute;
+ }
+ void qemu_add_mouse_mode_change_notifier(Notifier *notify)
+ {
+     notifier_list_add(&mouse_mode_notifiers, notify);
+ }
+ void qemu_remove_mouse_mode_change_notifier(Notifier *notify)
+ {
+     notifier_remove(notify);
  }
  
 +#if defined CONFIG_MARU && defined CONFIG_LINUX
 +void hwkey_put_keycode(int type, int keycode)
 +{
 +    if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
 +        return;
 +    }
 +    maru_hwkey_event(type, keycode);
 +}
 +
 +void rotation_put_type(int type)
 +{
 +    if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
 +        return;
 +    }
 +    do_rotation_event(type);
 +}
 +
 +void hostkbd_put_type(int type)
 +{
 +    if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
 +        return;
 +    }
 +    do_host_kbd_enable(type);
 +}
 +
 +void* tizen_close_thread(void* type)
 +{
 +    int data = *(int*)type;
 +
 +    if (data == 1) {
 +        /* force close */
 +        shutdown_qemu_gracefully();
 +    } else {
 +        request_close();
 +    }
 +
 +    pthread_exit((void*)0);
 +}
 +
 +void tizen_close_put_type(int type)
 +{
 +    pthread_t thread_id;
 +
 +    if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) {
 +        return;
 +    }
 +
 +    if (0 != pthread_create(&thread_id, NULL, tizen_close_thread, (void*)&type)) {
 +        error_report("fail to create tizen_close pthread.\n");
 +    } else {
 +        printf("created tizen_close thread\n");
 +    }
 +}
 +#endif
 +
  MouseInfoList *qmp_query_mice(Error **errp)
  {
      MouseInfoList *mice_list = NULL;
diff --cc ui/sdl.c
Simple merge
  #include "qemu-common.h"
  #include "ui/qemu-spice.h"
  #include "ui/console.h"
+ #include "ui/keymaps.h"
+ #include "ui/input.h"
  
 +#ifdef CONFIG_MARU
 +extern int get_emul_vm_base_port(void);
 +#endif
 +
  /* keyboard bits */
  
  typedef struct QemuSpiceKbd {
@@@ -59,10 -63,10 +63,14 @@@ extern int daemon(int, int)
  #include <sys/syscall.h>
  #endif
  
+ #ifdef __FreeBSD__
+ #include <sys/sysctl.h>
+ #endif
 +#ifdef CONFIG_MARU
 +#include "../../tizen/src/maru_common.h"
 +#endif
 +
  int qemu_get_thread_id(void)
  {
  #if defined(__linux__)
Simple merge
Simple merge
@@@ -422,7 -437,12 +445,11 @@@ void qemu_thread_create(QemuThread *thr
      if (err)
          error_exit(err, __func__);
  
+     if (name_threads) {
+         qemu_thread_set_name(thread, name);
+     }
      pthread_sigmask(SIG_SETMASK, &oldset, NULL);
 -
      pthread_attr_destroy(&attr);
  }
  
diff --cc vl.c
--- 1/vl.c
--- 2/vl.c
+++ b/vl.c
@@@ -113,16 -56,9 +58,17 @@@ int main(int argc, char **argv
  #define main qemu_main
  #endif /* CONFIG_COCOA */
  
 +#ifdef CONFIG_MARU
 +#ifdef main
 +#undef main
 +#endif
 +int qemu_main(int argc, char **argv, char **envp);
 +#define main qemu_main
 +#endif
 +
  #include <glib.h>
  
+ #include "qemu/sockets.h"
  #include "hw/hw.h"
  #include "hw/boards.h"
  #include "hw/usb.h"
  
  #include "ui/qemu-spice.h"
  #include "qapi/string-input-visitor.h"
+ #include "qom/object_interfaces.h"
  
- //#define DEBUG_NET
- //#define DEBUG_SLIRP
 +#ifdef CONFIG_MARU
 +#include "tizen/src/maru_common.h"
 +#include "tizen/src/emulator.h"
 +#include "tizen/src/maru_err_table.h"
 +#include "tizen/src/emul_state.h"
 +#include "tizen/src/maru_display.h"
 +#include "tizen/src/skin/maruskin_operation.h"
 +#include "tizen/src/ecs/ecs.h"
 +#endif
 +
  #define DEFAULT_RAM_SIZE 128
  
  #define MAX_VIRTIO_CONSOLES 1
@@@ -2130,12 -2117,15 +2166,21 @@@ static bool qxl_vga_available(void
      return object_class_by_name("qxl-vga");
  }
  
 +#ifdef CONFIG_MARU
 +static bool maru_vga_available(void)
 +{
 +    return object_class_by_name("MARU_VGA");
 +}
 +#endif
+ static bool tcx_vga_available(void)
+ {
+     return object_class_by_name("SUNW,tcx");
+ }
+ static bool cg3_vga_available(void)
+ {
+     return object_class_by_name("cgthree");
+ }
  
  static void select_vgahw (const char *p)
  {
              fprintf(stderr, "Error: QXL VGA not available\n");
              exit(0);
          }
+     } else if (strstart(p, "tcx", &opts)) {
+         if (tcx_vga_available()) {
+             vga_interface_type = VGA_TCX;
+         } else {
+             fprintf(stderr, "Error: TCX framebuffer not available\n");
+             exit(0);
+         }
+     } else if (strstart(p, "cg3", &opts)) {
+         if (cg3_vga_available()) {
+             vga_interface_type = VGA_CG3;
+         } else {
+             fprintf(stderr, "Error: CG3 framebuffer not available\n");
+             exit(0);
+         }
 +#ifdef CONFIG_MARU
 +    } else if (strstart(p, "maru", &opts)) {
 +        if (maru_vga_available()) {
 +            vga_interface_type = VGA_MARU;
 +        } else {
 +            fprintf(stderr, "Error: MARU VGA not available\n");
 +            exit(0);
 +        }
 +#endif
      } else if (!strstart(p, "none", &opts)) {
      invalid_vga:
          fprintf(stderr, "Unknown vga type: %s\n", p);
@@@ -2678,12 -2697,10 +2767,12 @@@ static MachineClass *machine_parse(cons
      exit(!name || !is_help_option(name));
  }
  
- static int tcg_init(void)
+ static int tcg_init(QEMUMachine *machine)
  {
 +    int ret = 0;
      tcg_exec_init(tcg_tb_size * 1024 * 1024);
 -    return 0;
 +    ret = hax_accel_init();
 +    return ret;
  }
  
  static struct {
@@@ -4444,31 -4371,23 +4576,32 @@@ int main(int argc, char **argv, char **
  
      qdev_machine_init();
  
-     QEMUMachineInitArgs args = { .ram_size = ram_size,
 +#ifdef CONFIG_MARU
 +    // Returned variable points different address from input variable.
 +    kernel_cmdline = prepare_maru_devices(kernel_cmdline);
 +#endif
+     QEMUMachineInitArgs args = { .machine = machine,
+                                  .ram_size = ram_size,
                                   .boot_order = boot_order,
                                   .kernel_filename = kernel_filename,
                                   .kernel_cmdline = kernel_cmdline,
                                   .initrd_filename = initrd_filename,
                                   .cpu_model = cpu_model };
-     machine->init(&args);
+     current_machine->init_args = args;
+     machine->init(&current_machine->init_args);
  
 +    // TODO: Check about it...
      audio_init();
  
      cpu_synchronize_all_post_init();
  
      set_numa_modes();
  
-     current_machine = machine;
 +    if (hax_enabled()) {
 +        hax_sync_vcpus();
 +    }
 +
      /* init USB devices */
      if (usb_enabled(false)) {
          if (foreach_device_config(DEV_USB, usb_parse) < 0)
          vm_start();
      }
  
 +#ifdef CONFIG_MARU
 +    prepare_maru();
 +#endif
 +
      os_setup_post();
  
+     if (is_daemonized()) {
+         if (!trace_backend_init(trace_events, trace_file)) {
+             exit(1);
+         }
+     }
      main_loop();
      bdrv_close_all();
      pause_all_vcpus();
diff --cc xen-all.c
Simple merge