* 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>
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);
}
#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",
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
#endif
#include "sysemu/replay.h"
++#include "sysemu/hax.h"
++
/* -icount align implementation. */
typedef struct SyncClocks {
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 {
#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"
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__
--- /dev/null
+ #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
--- /dev/null
- 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,
+ };
--- /dev/null
+ /*
+ * 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,
+ };
--- /dev/null
+ /*
+ * 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,
+ };
--- /dev/null
+ /*
+ * 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
++<<<<<<< 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
#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)
{
#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
#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
}
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
#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
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)) {
#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
#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>
#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>
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;
"'%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();