From dc9a353cf7de78b9fae3e46410803d487fd2fc8f Mon Sep 17 00:00:00 2001 From: Martin Husemann Date: Sat, 18 Jan 2014 14:47:23 +0100 Subject: [PATCH 1/7] qemu 1.7.0 does not build on NetBSD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not rely on int8_t (and friends) not being preprocessor symbols (or symbols expanding to themselves). On NetBSD (for example) the glue(u, SDATA_TYPE) results in u__int8_t, which is undefined. There is no way to stop cpp expanding inner macros, so just add the few lines explicitly and get rid of the magic. Signed-off-by: Martin Husemann Reviewed-by: Peter Maydell Reviewed-by: Andreas Färber Signed-off-by: Michael Tokarev --- include/exec/softmmu_template.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/exec/softmmu_template.h b/include/exec/softmmu_template.h index c6a544069c..8712dcd091 100644 --- a/include/exec/softmmu_template.h +++ b/include/exec/softmmu_template.h @@ -30,23 +30,26 @@ #define SUFFIX q #define LSUFFIX q #define SDATA_TYPE int64_t +#define DATA_TYPE uint64_t #elif DATA_SIZE == 4 #define SUFFIX l #define LSUFFIX l #define SDATA_TYPE int32_t +#define DATA_TYPE uint32_t #elif DATA_SIZE == 2 #define SUFFIX w #define LSUFFIX uw #define SDATA_TYPE int16_t +#define DATA_TYPE uint16_t #elif DATA_SIZE == 1 #define SUFFIX b #define LSUFFIX ub #define SDATA_TYPE int8_t +#define DATA_TYPE uint8_t #else #error unsupported data size #endif -#define DATA_TYPE glue(u, SDATA_TYPE) /* For the benefit of TCG generated code, we want to avoid the complication of ABI-specific return type promotion and always return a value extended From 1165ae613d3482e79c56d5a05c3354b2baae6ee7 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Thu, 23 Jan 2014 14:27:59 -0600 Subject: [PATCH 2/7] osdep: drop unused #include "trace.h" osdep.c does not use trace_*() so we can just drop the include. Signed-off-by: Stefan Hajnoczi Reviewed-by: Benoit Canet Signed-off-by: Michael Tokarev --- util/osdep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/util/osdep.c b/util/osdep.c index 62072b4be3..bd4f530ad1 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -46,7 +46,6 @@ extern int madvise(caddr_t, size_t, int); #endif #include "qemu-common.h" -#include "trace.h" #include "qemu/sockets.h" #include "monitor/monitor.h" From c428c5a21ce9a9861839ee544afd10638016e3f5 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 31 Jan 2014 23:05:24 +0100 Subject: [PATCH 3/7] i386: Add missing include file for QEMU_PACKED Instead of packing BiosLinkerLoaderEntry, an unused global variable called QEMU_PACKED was created (detected by smatch static code analysis). Including qemu-common.h gets the right definition and also includes some standard include files which now can be removed here. Cc: qemu-stable@nongnu.org Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- hw/i386/bios-linker-loader.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/i386/bios-linker-loader.c b/hw/i386/bios-linker-loader.c index fd23611008..aa56184e9a 100644 --- a/hw/i386/bios-linker-loader.c +++ b/hw/i386/bios-linker-loader.c @@ -18,11 +18,10 @@ * with this program; if not, see . */ +#include "qemu-common.h" #include "bios-linker-loader.h" #include "hw/nvram/fw_cfg.h" -#include -#include #include "qemu/bswap.h" #define BIOS_LINKER_LOADER_FILESZ FW_CFG_MAX_FILE_PATH From c6830cdb2c1053bca1e61eb242b1900489c160af Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 29 Jan 2014 13:08:30 -0800 Subject: [PATCH 4/7] tcg/s390: Remove sigill_handler Commit c9baa30f42a87f61627391698f63fa4d1566d9d8 failed to delete all of the relevant code, leading to Werrors about unused symbols. Signed-off-by: Richard Henderson Signed-off-by: Michael Tokarev --- tcg/s390/tcg-target.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c index 248726e82f..907d9d1744 100644 --- a/tcg/s390/tcg-target.c +++ b/tcg/s390/tcg-target.c @@ -2214,25 +2214,6 @@ static const TCGTargetOpDef s390_op_defs[] = { { -1 }, }; -/* ??? Linux kernels provide an AUXV entry AT_HWCAP that provides most of - this information. However, getting at that entry is not easy this far - away from main. Our options are: start searching from environ, but - that fails as soon as someone does a setenv in between. Read the data - from /proc/self/auxv. Or do the probing ourselves. The only thing - extra that AT_HWCAP gives us is HWCAP_S390_HIGH_GPRS, which indicates - that the kernel saves all 64-bits of the registers around traps while - in 31-bit mode. But this is true of all "recent" kernels (ought to dig - back and see from when this might not be true). */ - -#include - -static volatile sig_atomic_t got_sigill; - -static void sigill_handler(int sig) -{ - got_sigill = 1; -} - static void query_facilities(void) { unsigned long hwcap = qemu_getauxval(AT_HWCAP); From d5d1507b347b7cd6c3b82459b96f1889b29939ef Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 25 Jan 2014 18:18:23 +0100 Subject: [PATCH 5/7] readline: Add missing GCC_FMT_ATTR This fixes a compiler warning with -Werror=missing-format-attribute and allows improved compiler checks for variable argument lists. Signed-off-by: Stefan Weil Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael Tokarev --- include/qemu/readline.h | 3 ++- monitor.c | 3 ++- qemu-io.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/qemu/readline.h b/include/qemu/readline.h index a89fe4a9a9..49efe4e39b 100644 --- a/include/qemu/readline.h +++ b/include/qemu/readline.h @@ -5,7 +5,8 @@ #define READLINE_MAX_CMDS 64 #define READLINE_MAX_COMPLETIONS 256 -typedef void ReadLinePrintfFunc(void *opaque, const char *fmt, ...); +typedef void GCC_FMT_ATTR(2, 3) ReadLinePrintfFunc(void *opaque, + const char *fmt, ...); typedef void ReadLineFlushFunc(void *opaque); typedef void ReadLineFunc(void *opaque, const char *str, void *readline_opaque); diff --git a/monitor.c b/monitor.c index 80456fbe5b..5ba541dc6f 100644 --- a/monitor.c +++ b/monitor.c @@ -4888,7 +4888,8 @@ static void sortcmdlist(void) /* These functions just adapt the readline interface in a typesafe way. We * could cast function pointers but that discards compiler checks. */ -static void monitor_readline_printf(void *opaque, const char *fmt, ...) +static void GCC_FMT_ATTR(2, 3) monitor_readline_printf(void *opaque, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); diff --git a/qemu-io.c b/qemu-io.c index d6690289b8..7f459d8ffe 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -219,7 +219,8 @@ static char *get_prompt(void) return prompt; } -static void readline_printf_func(void *opaque, const char *fmt, ...) +static void GCC_FMT_ATTR(2, 3) readline_printf_func(void *opaque, + const char *fmt, ...) { va_list ap; va_start(ap, fmt); From 5eaac2f8282a066f08b5c91f43a4e2ede0e55b8c Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 26 Jan 2014 15:02:29 +0100 Subject: [PATCH 6/7] hw/ppc: Remove unused defines Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- hw/ppc/ppc4xx_devs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c index 239aada193..9160ee7769 100644 --- a/hw/ppc/ppc4xx_devs.c +++ b/hw/ppc/ppc4xx_devs.c @@ -27,8 +27,6 @@ #include "qemu/log.h" #include "exec/address-spaces.h" -//#define DEBUG_MMIO -//#define DEBUG_UNASSIGNED #define DEBUG_UIC From b76afd1072e02fe77e09790fbe1e831700976c5f Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Mon, 27 Jan 2014 16:26:21 +0800 Subject: [PATCH 7/7] tests/.gitignore: Ignore tests/check-qom-interface Signed-off-by: Fam Zheng Signed-off-by: Michael Tokarev --- tests/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/.gitignore b/tests/.gitignore index 1aed2249ff..9ba9d96b6b 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -4,6 +4,7 @@ check-qint check-qjson check-qlist check-qstring +check-qom-interface test-aio test-bitops test-throttle