From e24fed4ed4cb006c76924dacb1274f71477b9e3c Mon Sep 17 00:00:00 2001 From: Christophe Lyon Date: Tue, 2 Apr 2013 14:03:38 +0200 Subject: [PATCH 1/6] fix /proc/self/maps output Add a space at end of line when there is no filename to print, to conform to linux kernel format (see show_map_vma() in fs/proc/task_mmu.c). Signed-off-by: Christophe Lyon Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 30e93bc0d0..1b3c0ed5f7 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5050,10 +5050,10 @@ static int open_self_maps(void *cpu_env, int fd) } if (h2g_valid(min) && h2g_valid(max)) { dprintf(fd, TARGET_ABI_FMT_lx "-" TARGET_ABI_FMT_lx - " %c%c%c%c %08" PRIx64 " %02x:%02x %d%s%s\n", + " %c%c%c%c %08" PRIx64 " %02x:%02x %d %s%s\n", h2g(min), h2g(max), flag_r, flag_w, flag_x, flag_p, offset, dev_maj, dev_min, inode, - path[0] ? " " : "", path); + path[0] ? " " : "", path); } } From ce3a4718fe8edbe56b485778a76e9393e4f27c0e Mon Sep 17 00:00:00 2001 From: Qiao Nuohan Date: Wed, 8 May 2013 12:39:01 +0800 Subject: [PATCH 2/6] Remove twice include of qemu-common.h This patch is used to remove twice include of "qemu-common.h" in block/win32-aio.c Signed-off-by: Qiao Nuohan Reviewed-by: Stefan Weil Signed-off-by: Michael Tokarev --- block/win32-aio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/win32-aio.c b/block/win32-aio.c index 5d0fbbfb7d..fcb7c754da 100644 --- a/block/win32-aio.c +++ b/block/win32-aio.c @@ -25,7 +25,6 @@ #include "qemu/timer.h" #include "block/block_int.h" #include "qemu/module.h" -#include "qemu-common.h" #include "block/aio.h" #include "raw-aio.h" #include "qemu/event_notifier.h" From 7bc9315d3a6a3c7d437e1c3d0e826121a035444a Mon Sep 17 00:00:00 2001 From: liguang Date: Tue, 30 Apr 2013 10:59:50 +0800 Subject: [PATCH 3/6] translate: remove redundantly included qemu/timer.h Signed-off-by: liguang Reviewed-By: Peter Maydell Signed-off-by: Michael Tokarev --- translate-all.c | 1 - 1 file changed, 1 deletion(-) diff --git a/translate-all.c b/translate-all.c index da93608f03..d04a1162cd 100644 --- a/translate-all.c +++ b/translate-all.c @@ -55,7 +55,6 @@ #else #include "exec/address-spaces.h" #endif -#include "qemu/timer.h" #include "exec/cputlb.h" #include "translate-all.h" From 997aba8e257d183e978e9b08a26aceb4e905378d Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Tue, 14 May 2013 14:55:17 +0400 Subject: [PATCH 4/6] remove some double-includes Some source files #include the same header more than once for no good reason. Remove second #includes in such cases. Signed-off-by: Michael Tokarev --- audio/audio_win_int.c | 1 - hw/arm/highbank.c | 1 - hw/audio/marvell_88w8618.c | 1 - hw/mips/mips_malta.c | 1 - hw/misc/lm32_sys.c | 1 - hw/ppc/spapr.c | 2 -- hw/ppc/spapr_hcall.c | 1 - hw/timer/exynos4210_rtc.c | 1 - include/hw/i386/pc.h | 1 - include/qapi/qmp/qlist.h | 1 - include/qemu/config-file.h | 1 - monitor.c | 1 - page_cache.c | 1 - slirp/misc.c | 2 -- target-ppc/kvm.c | 2 -- tests/tcg/linux-test.c | 1 - 16 files changed, 19 deletions(-) diff --git a/audio/audio_win_int.c b/audio/audio_win_int.c index 58690524c4..e1324056a4 100644 --- a/audio/audio_win_int.c +++ b/audio/audio_win_int.c @@ -1,7 +1,6 @@ /* public domain */ #include "qemu-common.h" -#include "audio.h" #define AUDIO_CAP "win-int" #include diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index 0fd9465cfa..4405dbd3bd 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -24,7 +24,6 @@ #include "net/net.h" #include "sysemu/sysemu.h" #include "hw/boards.h" -#include "hw/sysbus.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c index de06dfd7d2..c5d88a7841 100644 --- a/hw/audio/marvell_88w8618.c +++ b/hw/audio/marvell_88w8618.c @@ -12,7 +12,6 @@ #include "hw/sysbus.h" #include "hw/hw.h" #include "hw/i2c/i2c.h" -#include "hw/sysbus.h" #include "audio/audio.h" #define MP_AUDIO_SIZE 0x00001000 diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 9d521ccb19..5033d51224 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -37,7 +37,6 @@ #include "sysemu/char.h" #include "sysemu/sysemu.h" #include "sysemu/arch_init.h" -#include "hw/boards.h" #include "qemu/log.h" #include "hw/mips/bios.h" #include "hw/ide.h" diff --git a/hw/misc/lm32_sys.c b/hw/misc/lm32_sys.c index 33a3b80ce7..aeaf2b7b7b 100644 --- a/hw/misc/lm32_sys.c +++ b/hw/misc/lm32_sys.c @@ -34,7 +34,6 @@ #include "qemu/log.h" #include "qemu/error-report.h" #include "sysemu/sysemu.h" -#include "qemu/log.h" enum { R_CTRL = 0, diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c96ac8131f..218ea23da8 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -43,8 +43,6 @@ #include "hw/ppc/xics.h" #include "hw/pci/msi.h" -#include "sysemu/kvm.h" -#include "kvm_ppc.h" #include "hw/pci/pci.h" #include "exec/address-spaces.h" diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index f518aee216..8f0b7e8076 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1,6 +1,5 @@ #include "sysemu/sysemu.h" #include "cpu.h" -#include "sysemu/sysemu.h" #include "helper_regs.h" #include "hw/ppc/spapr.h" #include "mmu-hash64.h" diff --git a/hw/timer/exynos4210_rtc.c b/hw/timer/exynos4210_rtc.c index bceee44cb2..3ac77f9262 100644 --- a/hw/timer/exynos4210_rtc.c +++ b/hw/timer/exynos4210_rtc.c @@ -31,7 +31,6 @@ #include "hw/ptimer.h" #include "hw/hw.h" -#include "qemu/timer.h" #include "sysemu/sysemu.h" #include "hw/arm/exynos4210.h" diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 2bd7090248..740cf49763 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -7,7 +7,6 @@ #include "hw/isa/isa.h" #include "hw/block/fdc.h" #include "net/net.h" -#include "exec/memory.h" #include "hw/i386/ioapic.h" /* PC-style peripherals (also used by other machines). */ diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h index 382f04c3c4..6cc4831df3 100644 --- a/include/qapi/qmp/qlist.h +++ b/include/qapi/qmp/qlist.h @@ -15,7 +15,6 @@ #include "qapi/qmp/qobject.h" #include "qemu/queue.h" -#include "qemu/queue.h" typedef struct QListEntry { QObject *value; diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h index ccfccae2b4..ad4a9e5c3a 100644 --- a/include/qemu/config-file.h +++ b/include/qemu/config-file.h @@ -4,7 +4,6 @@ #include #include "qemu/option.h" #include "qapi/error.h" -#include "qemu/option.h" QemuOptsList *qemu_find_opts(const char *group); QemuOptsList *qemu_find_opts_err(const char *group, Error **errp); diff --git a/monitor.c b/monitor.c index 62aaebe660..6ce2a4e61b 100644 --- a/monitor.c +++ b/monitor.c @@ -63,7 +63,6 @@ #ifdef CONFIG_TRACE_SIMPLE #include "trace/simple.h" #endif -#include "ui/qemu-spice.h" #include "exec/memory.h" #include "qmp-commands.h" #include "hmp.h" diff --git a/page_cache.c b/page_cache.c index 938a79c9ea..a05db643cc 100644 --- a/page_cache.c +++ b/page_cache.c @@ -21,7 +21,6 @@ #include #include #include -#include #include "qemu-common.h" #include "migration/page_cache.h" diff --git a/slirp/misc.c b/slirp/misc.c index 8ecced547f..0bcc481939 100644 --- a/slirp/misc.c +++ b/slirp/misc.c @@ -242,8 +242,6 @@ strdup(str) } #endif -#include "monitor/monitor.h" - void lprint(const char *format, ...) { va_list args; diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 725071e6a7..3ab2946cfb 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -30,8 +30,6 @@ #include "cpu.h" #include "sysemu/cpus.h" #include "sysemu/device_tree.h" -#include "hw/sysbus.h" -#include "hw/ppc/spapr.h" #include "mmu-hash64.h" #include "hw/sysbus.h" diff --git a/tests/tcg/linux-test.c b/tests/tcg/linux-test.c index 83cb32ddb9..1c6c01318e 100644 --- a/tests/tcg/linux-test.c +++ b/tests/tcg/linux-test.c @@ -39,7 +39,6 @@ #include #include #include -#include #define TESTPATH "/tmp/linux-test.tmp" #define TESTPORT 7654 From 3a8ae21bd07e8a02e6e2eb4896790a62f979acda Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Thu, 16 May 2013 11:32:28 -0400 Subject: [PATCH 5/6] Rename hexdump to avoid FreeBSD libutil conflict On FreeBSD libutil is used for openpty(), but it also provides a hexdump() which conflicts with QEMU's. Signed-off-by: Ed Maste Reviewed-by: Paolo Bonzini Signed-off-by: Michael Tokarev --- hw/dma/pl330.c | 4 ++-- include/qemu-common.h | 2 +- util/hexdump.c | 2 +- util/iov.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/dma/pl330.c b/hw/dma/pl330.c index 8b33138f30..60f5299e10 100644 --- a/hw/dma/pl330.c +++ b/hw/dma/pl330.c @@ -1157,7 +1157,7 @@ static int pl330_exec_cycle(PL330Chan *channel) if (PL330_ERR_DEBUG > 1) { DB_PRINT("PL330 read from memory @%08x (size = %08x):\n", q->addr, len); - hexdump((char *)buf, stderr, "", len); + qemu_hexdump((char *)buf, stderr, "", len); } fifo_res = pl330_fifo_push(&s->fifo, buf, len, q->tag); if (fifo_res == PL330_FIFO_OK) { @@ -1189,7 +1189,7 @@ static int pl330_exec_cycle(PL330Chan *channel) if (PL330_ERR_DEBUG > 1) { DB_PRINT("PL330 read from memory @%08x (size = %08x):\n", q->addr, len); - hexdump((char *)buf, stderr, "", len); + qemu_hexdump((char *)buf, stderr, "", len); } if (q->inc) { q->addr += len; diff --git a/include/qemu-common.h b/include/qemu-common.h index 7f18b8e1f9..b9057d18cf 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -443,7 +443,7 @@ int mod_utf8_codepoint(const char *s, size_t n, char **end); * Hexdump a buffer to a file. An optional string prefix is added to every line */ -void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size); +void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size); /* vector definitions */ #ifdef __ALTIVEC__ diff --git a/util/hexdump.c b/util/hexdump.c index 0d0efc86de..969b3406c0 100644 --- a/util/hexdump.c +++ b/util/hexdump.c @@ -15,7 +15,7 @@ #include "qemu-common.h" -void hexdump(const char *buf, FILE *fp, const char *prefix, size_t size) +void qemu_hexdump(const char *buf, FILE *fp, const char *prefix, size_t size) { unsigned int b; diff --git a/util/iov.c b/util/iov.c index 78bbbe12d0..cc6e837c83 100644 --- a/util/iov.c +++ b/util/iov.c @@ -225,7 +225,7 @@ void iov_hexdump(const struct iovec *iov, const unsigned int iov_cnt, size = size > limit ? limit : size; buf = g_malloc(size); iov_to_buf(iov, iov_cnt, 0, buf, size); - hexdump(buf, fp, prefix, size); + qemu_hexdump(buf, fp, prefix, size); g_free(buf); } From d2ad50210b35c2685640f7df931a0fccb49334f7 Mon Sep 17 00:00:00 2001 From: Hu Tao Date: Wed, 15 May 2013 14:04:29 +0800 Subject: [PATCH 6/6] target-moxie: replace target_phys_addr_t with hwaddr target_phys_addr_t has been already replaced by hwaddr, but this one is introduced after. Signed-off-by: Hu Tao Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- target-moxie/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-moxie/helper.c b/target-moxie/helper.c index 6e0ac2aa2a..5cfe889ad4 100644 --- a/target-moxie/helper.c +++ b/target-moxie/helper.c @@ -116,7 +116,7 @@ int cpu_moxie_handle_mmu_fault(CPUMoxieState *env, target_ulong address, return 1; } -target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr) +hwaddr cpu_get_phys_page_debug(CPUState *env, target_ulong addr) { return addr; }