From c551cd52cc4424b98548132d6a49baddeae6ee80 Mon Sep 17 00:00:00 2001 From: Changlong Xie Date: Tue, 11 Oct 2016 13:28:32 +0800 Subject: [PATCH 01/23] filter-dump: add missing "[" Signed-off-by: Changlong Xie Signed-off-by: Michael Tokarev --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index b1fbdb08cd..c209b53cbd 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -3902,7 +3902,7 @@ colo secondary: -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 -object filter-rewriter,id=rew0,netdev=hn0,queue=all -@item -object filter-dump,id=@var{id},netdev=@var{dev},file=@var{filename}][,maxlen=@var{len}] +@item -object filter-dump,id=@var{id},netdev=@var{dev}[,file=@var{filename}][,maxlen=@var{len}] Dump the network traffic on netdev @var{dev} to the file specified by @var{filename}. At most @var{len} bytes (64k by default) per packet are stored. From 5f333d79a4337b390fa4103e270d2bdaf243aad6 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 12 Oct 2016 17:33:44 +0200 Subject: [PATCH 02/23] hw/tpm/tpm_passthrough: Simplify if-statements a little bit The condition '!A || (A && B)' is equivalent to '!A || B' Buglink: https://bugs.launchpad.net/qemu/+bug/1464611 Signed-off-by: Thomas Huth Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- hw/tpm/tpm_passthrough.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/tpm/tpm_passthrough.c b/hw/tpm/tpm_passthrough.c index e88c0d20bc..9234eb3459 100644 --- a/hw/tpm/tpm_passthrough.c +++ b/hw/tpm/tpm_passthrough.c @@ -165,8 +165,7 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt, ret = tpm_passthrough_unix_write(tpm_pt->tpm_fd, in, in_len); if (ret != in_len) { - if (!tpm_pt->tpm_op_canceled || - (tpm_pt->tpm_op_canceled && errno != ECANCELED)) { + if (!tpm_pt->tpm_op_canceled || errno != ECANCELED) { error_report("tpm_passthrough: error while transmitting data " "to TPM: %s (%i)", strerror(errno), errno); @@ -178,8 +177,7 @@ static int tpm_passthrough_unix_tx_bufs(TPMPassthruState *tpm_pt, ret = tpm_passthrough_unix_read(tpm_pt->tpm_fd, out, out_len); if (ret < 0) { - if (!tpm_pt->tpm_op_canceled || - (tpm_pt->tpm_op_canceled && errno != ECANCELED)) { + if (!tpm_pt->tpm_op_canceled || errno != ECANCELED) { error_report("tpm_passthrough: error while reading data from " "TPM: %s (%i)", strerror(errno), errno); From 5db35b616b8d3a27783ecddfe12353b88b0cb9f1 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Wed, 12 Oct 2016 18:23:16 +0200 Subject: [PATCH 03/23] target-lm32: fix style issue Both branches of the ternary operator have the same expressions. Drop the operator. This fixes: https://bugs.launchpad.net/qemu/+bug/1414293 Signed-off-by: Michael Walle Reviewed-by: Thomas Huth Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- target-lm32/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-lm32/translate.c b/target-lm32/translate.c index 2d8caebbfc..534c17cfcc 100644 --- a/target-lm32/translate.c +++ b/target-lm32/translate.c @@ -343,7 +343,7 @@ static void dec_calli(DisasContext *dc) static inline void gen_compare(DisasContext *dc, int cond) { int rX = (dc->format == OP_FMT_RR) ? dc->r2 : dc->r1; - int rY = (dc->format == OP_FMT_RR) ? dc->r0 : dc->r0; + int rY = dc->r0; int rZ = (dc->format == OP_FMT_RR) ? dc->r1 : -1; int i; From 95f7983bac0803633dfc670fb825a03348334aef Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Wed, 12 Oct 2016 19:15:05 +0200 Subject: [PATCH 04/23] target-lm32: fix LOG_DIS operand order The order of most opcodes with immediates was wrong (according to the reference manual) in the (debug) logging. Additionally, one operand for the andhi instruction was completly wrong. Fix these. Signed-off-by: Michael Walle Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- target-lm32/translate.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/target-lm32/translate.c b/target-lm32/translate.c index 534c17cfcc..dc64cc6726 100644 --- a/target-lm32/translate.c +++ b/target-lm32/translate.c @@ -211,7 +211,7 @@ static void dec_and(DisasContext *dc) static void dec_andhi(DisasContext *dc) { - LOG_DIS("andhi r%d, r%d, %d\n", dc->r2, dc->r0, dc->imm16); + LOG_DIS("andhi r%d, r%d, %d\n", dc->r1, dc->r0, dc->imm16); tcg_gen_andi_tl(cpu_R[dc->r1], cpu_R[dc->r0], (dc->imm16 << 16)); } @@ -274,7 +274,7 @@ static inline void gen_cond_branch(DisasContext *dc, int cond) static void dec_be(DisasContext *dc) { - LOG_DIS("be r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("be r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16) * 4); gen_cond_branch(dc, TCG_COND_EQ); @@ -282,7 +282,7 @@ static void dec_be(DisasContext *dc) static void dec_bg(DisasContext *dc) { - LOG_DIS("bg r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("bg r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16 * 4)); gen_cond_branch(dc, TCG_COND_GT); @@ -290,7 +290,7 @@ static void dec_bg(DisasContext *dc) static void dec_bge(DisasContext *dc) { - LOG_DIS("bge r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("bge r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16) * 4); gen_cond_branch(dc, TCG_COND_GE); @@ -298,7 +298,7 @@ static void dec_bge(DisasContext *dc) static void dec_bgeu(DisasContext *dc) { - LOG_DIS("bgeu r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("bgeu r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16) * 4); gen_cond_branch(dc, TCG_COND_GEU); @@ -306,7 +306,7 @@ static void dec_bgeu(DisasContext *dc) static void dec_bgu(DisasContext *dc) { - LOG_DIS("bgu r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("bgu r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16) * 4); gen_cond_branch(dc, TCG_COND_GTU); @@ -314,7 +314,7 @@ static void dec_bgu(DisasContext *dc) static void dec_bne(DisasContext *dc) { - LOG_DIS("bne r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("bne r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16) * 4); gen_cond_branch(dc, TCG_COND_NE); @@ -367,7 +367,7 @@ static inline void gen_compare(DisasContext *dc, int cond) static void dec_cmpe(DisasContext *dc) { if (dc->format == OP_FMT_RI) { - LOG_DIS("cmpei r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("cmpei r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16)); } else { LOG_DIS("cmpe r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); @@ -379,7 +379,7 @@ static void dec_cmpe(DisasContext *dc) static void dec_cmpg(DisasContext *dc) { if (dc->format == OP_FMT_RI) { - LOG_DIS("cmpgi r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("cmpgi r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16)); } else { LOG_DIS("cmpg r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); @@ -391,7 +391,7 @@ static void dec_cmpg(DisasContext *dc) static void dec_cmpge(DisasContext *dc) { if (dc->format == OP_FMT_RI) { - LOG_DIS("cmpgei r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("cmpgei r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16)); } else { LOG_DIS("cmpge r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); @@ -403,7 +403,7 @@ static void dec_cmpge(DisasContext *dc) static void dec_cmpgeu(DisasContext *dc) { if (dc->format == OP_FMT_RI) { - LOG_DIS("cmpgeui r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("cmpgeui r%d, r%d, %d\n", dc->r1, dc->r0, zero_extend(dc->imm16, 16)); } else { LOG_DIS("cmpgeu r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); @@ -415,7 +415,7 @@ static void dec_cmpgeu(DisasContext *dc) static void dec_cmpgu(DisasContext *dc) { if (dc->format == OP_FMT_RI) { - LOG_DIS("cmpgui r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("cmpgui r%d, r%d, %d\n", dc->r1, dc->r0, zero_extend(dc->imm16, 16)); } else { LOG_DIS("cmpgu r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); @@ -427,7 +427,7 @@ static void dec_cmpgu(DisasContext *dc) static void dec_cmpne(DisasContext *dc) { if (dc->format == OP_FMT_RI) { - LOG_DIS("cmpnei r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("cmpnei r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16)); } else { LOG_DIS("cmpne r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); @@ -539,7 +539,7 @@ static void dec_modu(DisasContext *dc) static void dec_mul(DisasContext *dc) { if (dc->format == OP_FMT_RI) { - LOG_DIS("muli r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("muli r%d, r%d, %d\n", dc->r1, dc->r0, sign_extend(dc->imm16, 16)); } else { LOG_DIS("mul r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); @@ -563,7 +563,7 @@ static void dec_mul(DisasContext *dc) static void dec_nor(DisasContext *dc) { if (dc->format == OP_FMT_RI) { - LOG_DIS("nori r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("nori r%d, r%d, %d\n", dc->r1, dc->r0, zero_extend(dc->imm16, 16)); } else { LOG_DIS("nor r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); @@ -959,7 +959,7 @@ static void dec_wcsr(DisasContext *dc) static void dec_xnor(DisasContext *dc) { if (dc->format == OP_FMT_RI) { - LOG_DIS("xnori r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("xnori r%d, r%d, %d\n", dc->r1, dc->r0, zero_extend(dc->imm16, 16)); } else { if (dc->r1 == R_R0) { @@ -981,7 +981,7 @@ static void dec_xnor(DisasContext *dc) static void dec_xor(DisasContext *dc) { if (dc->format == OP_FMT_RI) { - LOG_DIS("xori r%d, r%d, %d\n", dc->r0, dc->r1, + LOG_DIS("xori r%d, r%d, %d\n", dc->r1, dc->r0, zero_extend(dc->imm16, 16)); } else { LOG_DIS("xor r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); From 49285e11d8ce90d2fd76d8bf16b330731e220495 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Thu, 13 Oct 2016 00:35:05 +0200 Subject: [PATCH 05/23] target-lm32: swap operand of wcsr in LOG_DIS() Be consistent with the reference manual. Signed-off-by: Michael Walle Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- target-lm32/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-lm32/translate.c b/target-lm32/translate.c index dc64cc6726..fa8416a81b 100644 --- a/target-lm32/translate.c +++ b/target-lm32/translate.c @@ -865,7 +865,7 @@ static void dec_wcsr(DisasContext *dc) { int no; - LOG_DIS("wcsr r%d, %d\n", dc->r1, dc->csr); + LOG_DIS("wcsr %d, r%d\n", dc->csr, dc->r1); switch (dc->csr) { case CSR_IE: From 19f846b19f4bb5ef187da057d40f0507e3842625 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Thu, 13 Oct 2016 00:35:06 +0200 Subject: [PATCH 06/23] target-lm32: disable asm logging via LOG_DIS() The lm32 target already has a disassembler which logs the assembly instructions with "-d in_asm". Therefore, turn of the LOG_DIS() macro to prevent logging the assembly instructions twice. Also turn the macro in a one which is always compiled to catch any errors while the macro is turned off. Signed-off-by: Michael Walle Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- target-lm32/translate.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target-lm32/translate.c b/target-lm32/translate.c index fa8416a81b..792637f523 100644 --- a/target-lm32/translate.c +++ b/target-lm32/translate.c @@ -33,12 +33,14 @@ #include "exec/log.h" -#define DISAS_LM32 1 -#if DISAS_LM32 -# define LOG_DIS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__) -#else -# define LOG_DIS(...) do { } while (0) -#endif +#define DISAS_LM32 0 + +#define LOG_DIS(...) \ + do { \ + if (DISAS_LM32) { \ + qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__); \ + } \ + } while (0) #define EXTRACT_FIELD(src, start, end) \ (((src) >> start) & ((1 << (end - start + 1)) - 1)) From 237a8650d640adfb00b65358891fed0e84edfd09 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Thu, 13 Oct 2016 00:35:07 +0200 Subject: [PATCH 07/23] lm32: milkymist-tmu2: fix integer overflow Don't truncate the multiplication and do a 64 bit one instead because because the result is stored in a 64 bit variable. Spotted by coverity, CID 1167561. Signed-off-by: Michael Walle Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- hw/display/milkymist-tmu2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/milkymist-tmu2.c b/hw/display/milkymist-tmu2.c index 9c0018448a..5c666f9b24 100644 --- a/hw/display/milkymist-tmu2.c +++ b/hw/display/milkymist-tmu2.c @@ -213,7 +213,7 @@ static void tmu2_start(MilkymistTMU2State *s) /* Read the QEMU source framebuffer into an OpenGL texture */ glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); - fb_len = 2*s->regs[R_TEXHRES]*s->regs[R_TEXVRES]; + fb_len = 2ULL * s->regs[R_TEXHRES] * s->regs[R_TEXVRES]; fb = cpu_physical_memory_map(s->regs[R_TEXFBUF], &fb_len, 0); if (fb == NULL) { glDeleteTextures(1, &texture); From 0a04e11f32cb51d3210007d902e170cc164bb813 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Thu, 13 Oct 2016 00:35:08 +0200 Subject: [PATCH 08/23] target-lm32: rewrite gen_compare() Drop the rX, rY and rZ stuff and use dc->r{0,1,2} directly. This should also fix the false positive in coverity CID 1005720. Signed-off-by: Michael Walle Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- target-lm32/translate.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target-lm32/translate.c b/target-lm32/translate.c index 792637f523..842af63a98 100644 --- a/target-lm32/translate.c +++ b/target-lm32/translate.c @@ -344,9 +344,6 @@ static void dec_calli(DisasContext *dc) static inline void gen_compare(DisasContext *dc, int cond) { - int rX = (dc->format == OP_FMT_RR) ? dc->r2 : dc->r1; - int rY = dc->r0; - int rZ = (dc->format == OP_FMT_RR) ? dc->r1 : -1; int i; if (dc->format == OP_FMT_RI) { @@ -360,9 +357,9 @@ static inline void gen_compare(DisasContext *dc, int cond) break; } - tcg_gen_setcondi_tl(cond, cpu_R[rX], cpu_R[rY], i); + tcg_gen_setcondi_tl(cond, cpu_R[dc->r1], cpu_R[dc->r0], i); } else { - tcg_gen_setcond_tl(cond, cpu_R[rX], cpu_R[rY], cpu_R[rZ]); + tcg_gen_setcond_tl(cond, cpu_R[dc->r2], cpu_R[dc->r0], cpu_R[dc->r1]); } } From f96fe6b5c27b9a66dba71044af0716f3d3e5601f Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 12 Oct 2016 17:18:40 +0200 Subject: [PATCH 09/23] hw/block/nvme: Simplify if-statements a little bit The condition '!A || (A && B)' is equivalent to '!A || B'. Buglink: https://bugs.launchpad.net/qemu/+bug/1464611 Signed-off-by: Thomas Huth Reviewed-by: Peter Maydell Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael Tokarev --- hw/block/nvme.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index b380142028..d479fd22f5 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -375,7 +375,7 @@ static uint16_t nvme_create_sq(NvmeCtrl *n, NvmeCmd *cmd) if (!cqid || nvme_check_cqid(n, cqid)) { return NVME_INVALID_CQID | NVME_DNR; } - if (!sqid || (sqid && !nvme_check_sqid(n, sqid))) { + if (!sqid || !nvme_check_sqid(n, sqid)) { return NVME_INVALID_QID | NVME_DNR; } if (!qsize || qsize > NVME_CAP_MQES(n->bar.cap)) { @@ -449,7 +449,7 @@ static uint16_t nvme_create_cq(NvmeCtrl *n, NvmeCmd *cmd) uint16_t qflags = le16_to_cpu(c->cq_flags); uint64_t prp1 = le64_to_cpu(c->prp1); - if (!cqid || (cqid && !nvme_check_cqid(n, cqid))) { + if (!cqid || !nvme_check_cqid(n, cqid)) { return NVME_INVALID_CQID | NVME_DNR; } if (!qsize || qsize > NVME_CAP_MQES(n->bar.cap)) { From c1a900cf4a3925c2e4b313b82da5df955f17b70a Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Fri, 14 Oct 2016 11:51:50 +0200 Subject: [PATCH 10/23] milkymist-pfpu: fix potential integer overflow Since the lm32 is a 32 bit architecture, just return a 32 bit value which is then converted to a 64 bit value. Spotted by coverity, CID 1005506. Signed-off-by: Michael Walle Signed-off-by: Michael Tokarev --- hw/misc/milkymist-pfpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/milkymist-pfpu.c b/hw/misc/milkymist-pfpu.c index 1da21a643e..3ca25894f1 100644 --- a/hw/misc/milkymist-pfpu.c +++ b/hw/misc/milkymist-pfpu.c @@ -137,7 +137,7 @@ struct MilkymistPFPUState { }; typedef struct MilkymistPFPUState MilkymistPFPUState; -static inline hwaddr +static inline uint32_t get_dma_address(uint32_t base, uint32_t x, uint32_t y) { return base + 8 * (128 * y + x); From 7344ffaa2d1fed640e5ac0f45e339289ef45ca7b Mon Sep 17 00:00:00 2001 From: zhanghailiang Date: Thu, 13 Oct 2016 14:57:28 +0800 Subject: [PATCH 11/23] colo-compare: remove unused struct CompareChardevProps and 'props' variable After commit 0a73336d, 'props' variable in find_and_check_chardev() is unused. Remove it, togther with struct CompareChardevProps. Signed-off-by: zhanghailiang Reviewed-by: Zhang Chen Signed-off-by: Michael Tokarev --- net/colo-compare.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index f791383dbc..2089bea798 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -92,10 +92,6 @@ typedef struct CompareClass { ObjectClass parent_class; } CompareClass; -typedef struct CompareChardevProps { - bool is_socket; -} CompareChardevProps; - enum { PRIMARY_IN = 0, SECONDARY_IN, @@ -571,8 +567,6 @@ static int find_and_check_chardev(CharDriverState **chr, char *chr_name, Error **errp) { - CompareChardevProps props; - *chr = qemu_chr_find(chr_name); if (*chr == NULL) { error_setg(errp, "Device '%s' not found", @@ -580,8 +574,6 @@ static int find_and_check_chardev(CharDriverState **chr, return 1; } - memset(&props, 0, sizeof(props)); - if (!qemu_chr_has_feature(*chr, QEMU_CHAR_FEATURE_RECONNECTABLE)) { error_setg(errp, "chardev \"%s\" is not reconnectable", chr_name); From 936c223051cf2a59ad7be9cc353b8426d5a02173 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Sat, 8 Oct 2016 12:00:07 +0200 Subject: [PATCH 12/23] MAINTAINERS: qemu-trivial information Information about "qemu-trivial" ML can be found in the wiki: http://wiki.qemu.org/Contribute/TrivialPatches But the first place where a developer looks is the file MAINTAINERS. This also allows the get_maintainer.pl script to display the qemu-trivial ML address when the mail subject contains "trivial". Signed-off-by: Laurent Vivier Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- MAINTAINERS | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b01fec0a7b..a87965f6f4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -63,6 +63,17 @@ W: http://wiki.qemu.org/SecurityProcess M: Michael S. Tsirkin L: secalert@redhat.com +Trivial patches +--------------- +Trivial patches +M: Michael Tokarev +M: Laurent Vivier +S: Maintained +L: qemu-trivial@nongnu.org +K: ^Subject:.*(?i)trivial +T: git git://git.corpit.ru/qemu.git trivial-patches +T: git git://github.com/vivier/qemu.git trivial-patches + Guest CPU cores (TCG): ---------------------- Overall From 73f7fd8861ef4abeec0fea775f607d232a56962a Mon Sep 17 00:00:00 2001 From: Akanksha Srivastava Date: Fri, 14 Oct 2016 01:51:31 +0530 Subject: [PATCH 13/23] usb: Change *_exitfn return type from int to void The *_exitfn functions cannot fail and should not be returning int. This also removes the passthru_exitfn since this callback does nothing as of now. This was suggested as a Bite-sized task for code cleanup. Signed-off-by: Akanksha Srivastava Reviewed-by: Stefan Hajnoczi Signed-off-by: Michael Tokarev --- hw/usb/ccid-card-emulated.c | 3 +-- hw/usb/ccid-card-passthru.c | 6 ------ hw/usb/ccid.h | 2 +- hw/usb/dev-smartcard-reader.c | 11 +++++------ 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c index 3213f9f8af..eceb5f3ee2 100644 --- a/hw/usb/ccid-card-emulated.c +++ b/hw/usb/ccid-card-emulated.c @@ -547,7 +547,7 @@ static int emulated_initfn(CCIDCardState *base) return 0; } -static int emulated_exitfn(CCIDCardState *base) +static void emulated_exitfn(CCIDCardState *base) { EmulatedState *card = EMULATED_CCID_CARD(base); VEvent *vevent = vevent_new(VEVENT_LAST, NULL, NULL); @@ -564,7 +564,6 @@ static int emulated_exitfn(CCIDCardState *base) qemu_mutex_destroy(&card->handle_apdu_mutex); qemu_mutex_destroy(&card->vreader_mutex); qemu_mutex_destroy(&card->event_list_mutex); - return 0; } static Property emulated_card_properties[] = { diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 325129a2f6..88cb6d8978 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -365,11 +365,6 @@ static int passthru_initfn(CCIDCardState *base) return 0; } -static int passthru_exitfn(CCIDCardState *base) -{ - return 0; -} - static VMStateDescription passthru_vmstate = { .name = "ccid-card-passthru", .version_id = 1, @@ -396,7 +391,6 @@ static void passthru_class_initfn(ObjectClass *klass, void *data) CCIDCardClass *cc = CCID_CARD_CLASS(klass); cc->initfn = passthru_initfn; - cc->exitfn = passthru_exitfn; cc->get_atr = passthru_get_atr; cc->apdu_from_guest = passthru_apdu_from_guest; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); diff --git a/hw/usb/ccid.h b/hw/usb/ccid.h index 9334da8acd..1f070116d6 100644 --- a/hw/usb/ccid.h +++ b/hw/usb/ccid.h @@ -33,7 +33,7 @@ typedef struct CCIDCardClass { void (*apdu_from_guest)(CCIDCardState *card, const uint8_t *apdu, uint32_t len); - int (*exitfn)(CCIDCardState *card); + void (*exitfn)(CCIDCardState *card); int (*initfn)(CCIDCardState *card); } CCIDCardClass; diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c index af4b851356..89e11b68c4 100644 --- a/hw/usb/dev-smartcard-reader.c +++ b/hw/usb/dev-smartcard-reader.c @@ -508,14 +508,14 @@ static void ccid_card_apdu_from_guest(CCIDCardState *card, } } -static int ccid_card_exitfn(CCIDCardState *card) +static void ccid_card_exitfn(CCIDCardState *card) { CCIDCardClass *cc = CCID_CARD_GET_CLASS(card); if (cc->exitfn) { - return cc->exitfn(card); + cc->exitfn(card); } - return 0; + } static int ccid_card_initfn(CCIDCardState *card) @@ -1279,7 +1279,6 @@ void ccid_card_card_inserted(CCIDCardState *card) static int ccid_card_exit(DeviceState *qdev) { - int ret = 0; CCIDCardState *card = CCID_CARD(qdev); USBDevice *dev = USB_DEVICE(qdev->parent_bus->parent); USBCCIDState *s = USB_CCID_DEV(dev); @@ -1287,9 +1286,9 @@ static int ccid_card_exit(DeviceState *qdev) if (ccid_card_inserted(s)) { ccid_card_card_removed(card); } - ret = ccid_card_exitfn(card); + ccid_card_exitfn(card); s->card = NULL; - return ret; + return 0; } static int ccid_card_init(DeviceState *qdev) From e1f3b974f46a15da038f3612bf1858ec81db793d Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Sun, 16 Oct 2016 17:21:37 +0300 Subject: [PATCH 14/23] qemu-options.hx: set: fix copy-paste error Reported-By: Daniel Shahaf Signed-off-by: Michael Tokarev --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index c209b53cbd..f29640620a 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -172,7 +172,7 @@ DEF("set", HAS_ARG, QEMU_OPTION_set, STEXI @item -set @var{group}.@var{id}.@var{arg}=@var{value} @findex -set -Set parameter @var{arg} for item @var{id} of type @var{group}\n" +Set parameter @var{arg} for item @var{id} of type @var{group} ETEXI DEF("global", HAS_ARG, QEMU_OPTION_global, From 5a1de0b325c9c3df41cb41bcea8dca5fafc67b9a Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 16 Oct 2016 17:28:18 +0300 Subject: [PATCH 15/23] scripts/hxtool: fix undefined behavour of echo Avoid undefined behaviour of echo(1) with backslashes in arguments The behaviour is implementation-defined, different /bin/sh's behave differently. Signed-off-by: Daniel Shahaf Signed-off-by: Michael Tokarev --- scripts/hxtool | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/hxtool b/scripts/hxtool index 995bb7f08c..04f7d7b0ed 100644 --- a/scripts/hxtool +++ b/scripts/hxtool @@ -26,32 +26,32 @@ hxtotexi() ;; STEXI*) if test $flag -eq 1 ; then - echo "line $line: syntax error: expected ETEXI, found $str" >&2 + printf "line %d: syntax error: expected ETEXI, found '%s'\n" "$line" "$str" >&2 exit 1 fi flag=1 ;; ETEXI*) if test $flag -ne 1 ; then - echo "line $line: syntax error: expected STEXI, found $str" >&2 + printf "line %d: syntax error: expected STEXI, found '%s'\n" "$line" "$str" >&2 exit 1 fi flag=0 ;; SQMP*|EQMP*) if test $flag -eq 1 ; then - echo "line $line: syntax error: expected ETEXI, found $str" >&2 + printf "line %d: syntax error: expected ETEXI, found '%s'\n" "$line" "$str" >&2 exit 1 fi ;; DEFHEADING*) - echo "$(expr "$str" : "DEFHEADING(\(.*\))")" + printf '%s\n' "$(expr "$str" : "DEFHEADING(\(.*\))")" ;; ARCHHEADING*) - echo "$(expr "$str" : "ARCHHEADING(\(.*\),.*)")" + printf '%s\n' "$(expr "$str" : "ARCHHEADING(\(.*\),.*)")" ;; *) - test $flag -eq 1 && echo "$str" + test $flag -eq 1 && printf '%s\n' "$str" ;; esac line=$((line+1)) @@ -69,26 +69,26 @@ hxtoqmp() ;; SQMP*) if test $flag -eq 1 ; then - echo "line $line: syntax error: expected EQMP, found $str" >&2 + printf "line %d: syntax error: expected EQMP, found '%s'\n" "$line" "$str" >&2 exit 1 fi flag=1 ;; EQMP*) if test $flag -ne 1 ; then - echo "line $line: syntax error: expected SQMP, found $str" >&2 + printf "line %d: syntax error: expected SQMP, found '%s'\n" "$line" "$str" >&2 exit 1 fi flag=0 ;; STEXI*|ETEXI*) if test $flag -eq 1 ; then - echo "line $line: syntax error: expected EQMP, found $str" >&2 + printf "line %d: syntax error: expected EQMP, found '%s'\n" "$line" "$str" >&2 exit 1 fi ;; *) - test $flag -eq 1 && echo "$str" + test $flag -eq 1 && printf '%s\n' "$str" ;; esac line=$((line+1)) From 25174055f428254427e7541139037eb9a34fc109 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 21 Oct 2016 18:41:45 +0100 Subject: [PATCH 16/23] migration: Remove unneeded NULL check from migrate_fd_error() All the callers of migrate_fd_error() pass a non-NULL error parameter, and if any did pass NULL then we would segfault in error_copy(), so remove the unnecessary NULL check earlier in the function. (Spotted by Coverity.) Signed-off-by: Peter Maydell Signed-off-by: Michael Tokarev --- migration/migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 4d417b76cf..d216b93bfd 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -922,7 +922,7 @@ static void migrate_fd_cleanup(void *opaque) void migrate_fd_error(MigrationState *s, const Error *error) { - trace_migrate_fd_error(error ? error_get_pretty(error) : ""); + trace_migrate_fd_error(error_get_pretty(error)); assert(s->to_dst_file == NULL); migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, MIGRATION_STATUS_FAILED); From 35b6e94ba50cd92600a85eef444bc31df8999de1 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 20 Oct 2016 13:57:06 +0100 Subject: [PATCH 17/23] s390: avoid always-true comparison in s390_pci_generate_fid() Coverity points out that the comparison "fid <= ZPCI_MAX_FID" in s390_pci_generate_fid() is always true (because fid is 32 bits and ZPCI_MAX_FID is 0xffffffff). This isn't a bug because the real loop termination condition is expressed later via an "if (...) break;" inside the loop, but it is a bit odd. Rephrase the loop to avoid the unnecessary duplicate-but-never-true conditional. Signed-off-by: Peter Maydell Acked-by: Cornelia Huck Signed-off-by: Michael Tokarev --- hw/s390x/s390-pci-bus.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index b7f8bca1fd..bbbe0b1245 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -809,17 +809,11 @@ static uint32_t s390_pci_generate_fid(Error **errp) { uint32_t fid = 0; - while (fid <= ZPCI_MAX_FID) { + do { if (!s390_pci_find_dev_by_fid(fid)) { return fid; } - - if (fid == ZPCI_MAX_FID) { - break; - } - - fid++; - } + } while (fid++ != ZPCI_MAX_FID); error_setg(errp, "no free fid could be found"); return 0; From 6bd67f8968e3e4ef4190e02ff6c38c4db5557984 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 20 Oct 2016 21:36:32 +0200 Subject: [PATCH 18/23] Makefile: Fix help text for target 'installer' The NSIS based installer currently does not install qemu-ga. It installs the executables and other files for the QEMU system emulation. Signed-off-by: Stefan Weil Reviewed-by: Michael Roth Signed-off-by: Michael Tokarev --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3bcb0565b6..69595ad8b8 100644 --- a/Makefile +++ b/Makefile @@ -695,7 +695,7 @@ help: @echo '' ifdef CONFIG_WIN32 @echo 'Windows targets:' - @echo ' installer - Build NSIS-based installer for qemu-ga' + @echo ' installer - Build NSIS-based installer for QEMU' ifdef QEMU_GA_MSI_ENABLED @echo ' msi - Build MSI-based installer for qemu-ga' endif From e7709b499c55de12b73949921e0fc6d3d9d835cd Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 20 Oct 2016 21:24:38 +0200 Subject: [PATCH 19/23] qemu-ga: Remove stray 'q' in documentation Signed-off-by: Stefan Weil Reviewed-by: Michael Roth Signed-off-by: Michael Tokarev --- qemu-ga.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-ga.texi b/qemu-ga.texi index 0e53bf6b2c..4c7a8fd163 100644 --- a/qemu-ga.texi +++ b/qemu-ga.texi @@ -30,7 +30,7 @@ set user's password @end itemize qemu-ga will read a system configuration file on startup (located at -q@file{/etc/qemu/qemu-ga.conf} by default), then parse remaining +@file{/etc/qemu/qemu-ga.conf} by default), then parse remaining configuration options on the command line. For the same key, the last option wins, but the lists accumulate (see below for configuration file format). From bdbcb547cf96fc1794b31003cbae1c7a37c4d205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 11 Oct 2016 21:41:21 +0400 Subject: [PATCH 20/23] monitor: deprecate 'default' option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option does nothing since commit 06ac27f. Deprecate it. Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster Signed-off-by: Michael Tokarev --- include/monitor/monitor.h | 2 +- monitor.c | 2 +- qemu-options.hx | 8 ++++---- vl.c | 11 +++-------- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index a714d8ef80..8cc532ec0e 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -9,7 +9,7 @@ extern Monitor *cur_mon; /* flags for monitor_init */ -#define MONITOR_IS_DEFAULT 0x01 +/* 0x01 unused */ #define MONITOR_USE_READLINE 0x02 #define MONITOR_USE_CONTROL 0x04 #define MONITOR_USE_PRETTY 0x08 diff --git a/monitor.c b/monitor.c index 21dcfb28c1..c4b6e26b61 100644 --- a/monitor.c +++ b/monitor.c @@ -4094,7 +4094,7 @@ QemuOptsList qemu_mon_opts = { .name = "chardev", .type = QEMU_OPT_STRING, },{ - .name = "default", + .name = "default", /* deprecated */ .type = QEMU_OPT_BOOL, },{ .name = "pretty", diff --git a/qemu-options.hx b/qemu-options.hx index f29640620a..95332cc05b 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2239,7 +2239,7 @@ two serial ports and the QEMU monitor: @example -chardev stdio,mux=on,id=char0 \ --mon chardev=char0,mode=readline,default \ +-mon chardev=char0,mode=readline \ -serial chardev:char0 \ -serial chardev:char0 @end example @@ -2250,7 +2250,7 @@ multiplexed between the QEMU monitor and a parallel port: @example -chardev stdio,mux=on,id=char0 \ --mon chardev=char0,mode=readline,default \ +-mon chardev=char0,mode=readline \ -parallel chardev:char0 \ -chardev tcp,...,mux=on,id=char1 \ -serial chardev:char1 \ @@ -3112,9 +3112,9 @@ Like -qmp but uses pretty JSON formatting. ETEXI DEF("mon", HAS_ARG, QEMU_OPTION_mon, \ - "-mon [chardev=]name[,mode=readline|control][,default]\n", QEMU_ARCH_ALL) + "-mon [chardev=]name[,mode=readline|control]\n", QEMU_ARCH_ALL) STEXI -@item -mon [chardev=]name[,mode=readline|control][,default] +@item -mon [chardev=]name[,mode=readline|control] @findex -mon Setup monitor on chardev @var{name}. ETEXI diff --git a/vl.c b/vl.c index 74dfe4eef9..496e65525b 100644 --- a/vl.c +++ b/vl.c @@ -2408,8 +2408,9 @@ static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp) if (qemu_opt_get_bool(opts, "pretty", 0)) flags |= MONITOR_USE_PRETTY; - if (qemu_opt_get_bool(opts, "default", 0)) - flags |= MONITOR_IS_DEFAULT; + if (qemu_opt_get_bool(opts, "default", 0)) { + error_report("option 'default' does nothing and is deprecated"); + } chardev = qemu_opt_get(opts, "chardev"); chr = qemu_chr_find(chardev); @@ -2428,16 +2429,12 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty) QemuOpts *opts; const char *p; char label[32]; - int def = 0; if (strstart(optarg, "chardev:", &p)) { snprintf(label, sizeof(label), "%s", p); } else { snprintf(label, sizeof(label), "compat_monitor%d", monitor_device_index); - if (monitor_device_index == 0) { - def = 1; - } opts = qemu_chr_parse_compat(label, optarg); if (!opts) { error_report("parse error: %s", optarg); @@ -2449,8 +2446,6 @@ static void monitor_parse(const char *optarg, const char *mode, bool pretty) qemu_opt_set(opts, "mode", mode, &error_abort); qemu_opt_set(opts, "chardev", label, &error_abort); qemu_opt_set_bool(opts, "pretty", pretty, &error_abort); - if (def) - qemu_opt_set(opts, "default", "on", &error_abort); monitor_device_index++; } From d66253e46ae2b9c36a9dd90b2b74c0dfa5804b22 Mon Sep 17 00:00:00 2001 From: Anand J Date: Fri, 21 Oct 2016 12:27:06 +0530 Subject: [PATCH 21/23] scripts/clean-includes: added duplicate #include check Enhance the clean-includes script to optionally check for duplicate #include entries. Script might output false positive entries as well. Such entries should not be removed. So if it finds any duplicate entries script will terminate with an exit status 1. Then each and every file should be checked manually and corrected if necessary. In order to enable the check use --check-dup-head option with scripts/clean-includes. Reviewed-by: Thomas Huth Signed-off-by: Anand J Signed-off-by: Michael Tokarev --- scripts/clean-includes | 56 +++++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/scripts/clean-includes b/scripts/clean-includes index 4412a5590a..dd938daa3e 100755 --- a/scripts/clean-includes +++ b/scripts/clean-includes @@ -14,15 +14,18 @@ # the top-level directory. # Usage: -# clean-includes [--git subjectprefix] file ... +# clean-includes [--git subjectprefix] [--check-dup-head] file ... # or -# clean-includes [--git subjectprefix] --all +# clean-includes [--git subjectprefix] [--check-dup-head] --all # # If the --git subjectprefix option is given, then after making # the changes to the files this script will create a git commit # with the subject line "subjectprefix: Clean up includes" # and a boilerplate commit message. # +# If --check-dup-head is specified, additionally check for duplicate +# header includes. +# # Using --all will cause clean-includes to run on the whole source # tree (excluding certain directories which are known not to need # handling). @@ -45,23 +48,40 @@ GIT=no +DUPHEAD=no # Extended regular expression defining files to ignore when using --all XDIRREGEX='^(tests/tcg|tests/multiboot|pc-bios|disas/libvixl)' -if [ $# -ne 0 ] && [ "$1" = "--git" ]; then - if [ $# -eq 1 ]; then - echo "--git option requires an argument" - exit 1 - fi - GITSUBJ="$2" - GIT=yes - shift - shift -fi +while true +do + case $1 in + "--git") + if [ $# -eq 1 ]; then + echo "--git option requires an argument" + exit 1 + fi + GITSUBJ="$2" + GIT=yes + shift + shift + ;; + "--check-dup-head") + DUPHEAD=yes + shift + ;; + "--") + shift + break + ;; + *) + break + ;; + esac +done if [ $# -eq 0 ]; then - echo "Usage: clean-includes [--git subjectprefix] [--all | foo.c ...]" + echo "Usage: clean-includes [--git subjectprefix] [--check-dup-head] [--all | foo.c ...]" echo "(modifies the files in place)" exit 1 fi @@ -91,7 +111,6 @@ cat >"$COCCIFILE" < 1) print $0}' + if [ $? -eq 0 ]; then + echo "Found duplicate header file includes. Please check the above files manually." + exit 1 + fi +fi + if [ "$GIT" = "yes" ]; then git add -- "$@" git commit --signoff -F - < Date: Fri, 21 Oct 2016 12:27:07 +0530 Subject: [PATCH 22/23] clean-up: removed duplicate #includes Some files contain multiple #includes of the same header file. Removed most of those unnecessary duplicate entries using scripts/clean-includes. Reviewed-by: Thomas Huth Signed-off-by: Anand J Signed-off-by: Michael Tokarev --- accel.c | 1 - cputlb.c | 1 - gdbstub.c | 1 - hw/i386/acpi-build.c | 1 - hw/microblaze/boot.c | 1 - hw/mips/mips_malta.c | 1 - hw/nvram/fw_cfg.c | 1 - hw/pci-bridge/pci_expander_bridge.c | 1 - hw/ppc/ppc405_boards.c | 1 - hw/ppc/spapr.c | 1 - hw/timer/grlib_gptimer.c | 1 - hw/tpm/tpm_tis.c | 1 - hw/unicore32/puv3.c | 1 - hw/usb/dev-mtp.c | 1 - include/hw/i386/pc.h | 1 - monitor.c | 2 -- qemu-io-cmds.c | 1 - qmp.c | 1 - target-i386/machine.c | 3 --- target-mips/machine.c | 1 - target-ppc/machine.c | 1 - target-ppc/mem_helper.c | 1 - target-sparc/machine.c | 3 --- target-xtensa/translate.c | 1 - tests/crypto-tls-x509-helpers.h | 3 --- tests/vhost-user-test.c | 2 -- util/oslib-posix.c | 1 - vl.c | 1 - 28 files changed, 36 deletions(-) diff --git a/accel.c b/accel.c index 403eb5e94d..664bb88422 100644 --- a/accel.c +++ b/accel.c @@ -33,7 +33,6 @@ #include "sysemu/qtest.h" #include "hw/xen/xen.h" #include "qom/object.h" -#include "hw/boards.h" int tcg_tb_size; static bool tcg_allowed = true; diff --git a/cputlb.c b/cputlb.c index cc4da4d7eb..813279f3bc 100644 --- a/cputlb.c +++ b/cputlb.c @@ -26,7 +26,6 @@ #include "exec/cputlb.h" #include "exec/memory-internal.h" #include "exec/ram_addr.h" -#include "exec/exec-all.h" #include "tcg/tcg.h" #include "qemu/error-report.h" #include "exec/log.h" diff --git a/gdbstub.c b/gdbstub.c index b2e1b79ca3..de62d26096 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -31,7 +31,6 @@ #define MAX_PACKET_LENGTH 4096 -#include "cpu.h" #include "qemu/sockets.h" #include "sysemu/kvm.h" #include "exec/semihost.h" diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 93be96f89c..5cd1da9a87 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -53,7 +53,6 @@ #include "hw/pci/pci_bus.h" #include "hw/pci-host/q35.h" #include "hw/i386/x86-iommu.h" -#include "hw/timer/hpet.h" #include "hw/acpi/aml-build.h" diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index 9eebb1a521..1834d22a61 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -30,7 +30,6 @@ #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/error-report.h" -#include "qemu-common.h" #include "sysemu/device_tree.h" #include "sysemu/sysemu.h" #include "hw/loader.h" diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index cf9bd3eb45..cf48f420cc 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -47,7 +47,6 @@ #include "elf.h" #include "hw/timer/mc146818rtc.h" #include "hw/timer/i8254.h" -#include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" #include "hw/sysbus.h" /* SysBusDevice */ diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 92aa563929..1f0c3e9910 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -29,7 +29,6 @@ #include "hw/isa/isa.h" #include "hw/nvram/fw_cfg.h" #include "hw/sysbus.h" -#include "hw/boards.h" #include "trace.h" #include "qemu/error-report.h" #include "qemu/config-file.h" diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c index 1cc598f7e9..6ac187fa32 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -15,7 +15,6 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_host.h" -#include "hw/pci/pci_bus.h" #include "hw/pci/pci_bridge.h" #include "hw/i386/pc.h" #include "qemu/range.h" diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c index 4b2f07aecb..d01798f245 100644 --- a/hw/ppc/ppc405_boards.c +++ b/hw/ppc/ppc405_boards.c @@ -37,7 +37,6 @@ #include "qemu/log.h" #include "qemu/error-report.h" #include "hw/loader.h" -#include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "exec/address-spaces.h" diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 486f57d6f6..17d5d6d7e6 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -37,7 +37,6 @@ #include "sysemu/block-backend.h" #include "sysemu/cpus.h" #include "sysemu/kvm.h" -#include "sysemu/device_tree.h" #include "kvm_ppc.h" #include "migration/migration.h" #include "mmu-hash64.h" diff --git a/hw/timer/grlib_gptimer.c b/hw/timer/grlib_gptimer.c index 712d1aece5..4ed96e970a 100644 --- a/hw/timer/grlib_gptimer.c +++ b/hw/timer/grlib_gptimer.c @@ -26,7 +26,6 @@ #include "hw/sysbus.h" #include "qemu/timer.h" #include "hw/ptimer.h" -#include "qemu/timer.h" #include "qemu/main-loop.h" #include "trace.h" diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 381e7266ea..a6440fef91 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -34,7 +34,6 @@ #include "qapi/error.h" #include "qemu-common.h" #include "qemu/main-loop.h" -#include "sysemu/tpm_backend.h" #define DEBUG_TIS 0 diff --git a/hw/unicore32/puv3.c b/hw/unicore32/puv3.c index 31cd171016..032078fd3e 100644 --- a/hw/unicore32/puv3.c +++ b/hw/unicore32/puv3.c @@ -13,7 +13,6 @@ #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" -#include "qemu-common.h" #include "ui/console.h" #include "elf.h" #include "exec/address-spaces.h" diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 58d95fffb2..9cb0f50750 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -17,7 +17,6 @@ #include #ifdef CONFIG_INOTIFY1 #include -#include "qapi/error.h" #include "qemu/main-loop.h" #endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 17fff80c8a..98dc7722c3 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -13,7 +13,6 @@ #include "qemu/bitmap.h" #include "sysemu/sysemu.h" #include "hw/pci/pci.h" -#include "hw/boards.h" #include "hw/compat.h" #include "hw/mem/pc-dimm.h" #include "hw/mem/nvdimm.h" diff --git a/monitor.c b/monitor.c index c4b6e26b61..7b963ad1ad 100644 --- a/monitor.c +++ b/monitor.c @@ -59,7 +59,6 @@ #include "qapi/qmp/json-streamer.h" #include "qapi/qmp/json-parser.h" #include "qom/object_interfaces.h" -#include "cpu.h" #include "trace.h" #include "trace/control.h" #include "monitor/hmp-target.h" @@ -76,7 +75,6 @@ #include "qapi/qmp-event.h" #include "qapi-event.h" #include "qmp-introspect.h" -#include "sysemu/block-backend.h" #include "sysemu/qtest.h" #include "qemu/cutils.h" #include "qapi/qmp/dispatch.h" diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 3a3838a079..e0249e282e 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -18,7 +18,6 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/timer.h" -#include "sysemu/block-backend.h" #include "qemu/cutils.h" #define CMD_NOFILE_OK 0x01 diff --git a/qmp.c b/qmp.c index a06cb7ba62..0028f0b30e 100644 --- a/qmp.c +++ b/qmp.c @@ -36,7 +36,6 @@ #include "qom/object_interfaces.h" #include "hw/mem/pc-dimm.h" #include "hw/acpi/acpi_dev_interface.h" -#include "qemu/uuid.h" NameInfo *qmp_query_name(Error **errp) { diff --git a/target-i386/machine.c b/target-i386/machine.c index 71c0e4dc47..48037f1575 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -7,10 +7,7 @@ #include "hw/i386/pc.h" #include "hw/isa/isa.h" #include "migration/cpu.h" -#include "exec/exec-all.h" -#include "cpu.h" -#include "exec/exec-all.h" #include "sysemu/kvm.h" #include "qemu/error-report.h" diff --git a/target-mips/machine.c b/target-mips/machine.c index a27f2f156d..d20d948457 100644 --- a/target-mips/machine.c +++ b/target-mips/machine.c @@ -2,7 +2,6 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" -#include "cpu.h" #include "migration/cpu.h" static int cpu_post_load(void *opaque, int version_id) diff --git a/target-ppc/machine.c b/target-ppc/machine.c index 4820f22377..e43cb6c39d 100644 --- a/target-ppc/machine.c +++ b/target-ppc/machine.c @@ -8,7 +8,6 @@ #include "helper_regs.h" #include "mmu-hash64.h" #include "migration/cpu.h" -#include "exec/exec-all.h" static int cpu_load_old(QEMUFile *f, void *opaque, int version_id) { diff --git a/target-ppc/mem_helper.c b/target-ppc/mem_helper.c index 6548715831..1ab8a6eab4 100644 --- a/target-ppc/mem_helper.c +++ b/target-ppc/mem_helper.c @@ -23,7 +23,6 @@ #include "exec/helper-proto.h" #include "helper_regs.h" -#include "exec/exec-all.h" #include "exec/cpu_ldst.h" //#define DEBUG_OP diff --git a/target-sparc/machine.c b/target-sparc/machine.c index 59c92f7582..aea6397861 100644 --- a/target-sparc/machine.c +++ b/target-sparc/machine.c @@ -6,10 +6,7 @@ #include "hw/boards.h" #include "qemu/timer.h" -#include "cpu.h" -#include "exec/exec-all.h" #include "migration/cpu.h" -#include "exec/exec-all.h" #ifdef TARGET_SPARC64 static const VMStateDescription vmstate_cpu_timer = { diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 4c1e48748b..fb0fa56f1e 100644 --- a/target-xtensa/translate.c +++ b/target-xtensa/translate.c @@ -36,7 +36,6 @@ #include "tcg-op.h" #include "qemu/log.h" #include "sysemu/sysemu.h" -#include "exec/exec-all.h" #include "exec/cpu_ldst.h" #include "exec/semihost.h" diff --git a/tests/crypto-tls-x509-helpers.h b/tests/crypto-tls-x509-helpers.h index a8faa92bc0..921341c649 100644 --- a/tests/crypto-tls-x509-helpers.h +++ b/tests/crypto-tls-x509-helpers.h @@ -21,9 +21,6 @@ #include #include -#include -#include - #if !(defined WIN32) && \ defined(CONFIG_TASN1) && \ (LIBGNUTLS_VERSION_NUMBER >= 0x020600) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index a7f06291cb..8b10afbf10 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -22,8 +22,6 @@ #include "libqos/virtio-pci.h" #include "qapi/error.h" -#include "libqos/pci-pc.h" -#include "libqos/virtio-pci.h" #include "libqos/malloc-pc.h" #include "hw/virtio/virtio-net.h" diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 8ec99ccb4f..67c65893a4 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -28,7 +28,6 @@ #include "qemu/osdep.h" #include -#include #include diff --git a/vl.c b/vl.c index 496e65525b..55763f7084 100644 --- a/vl.c +++ b/vl.c @@ -110,7 +110,6 @@ int main(int argc, char **argv) #include "trace.h" #include "trace/control.h" #include "qemu/queue.h" -#include "sysemu/cpus.h" #include "sysemu/arch_init.h" #include "ui/qemu-spice.h" From 630b210b9abbf362905a2096c22c5eb1d6224e77 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 13 Oct 2016 20:29:30 +0200 Subject: [PATCH 23/23] Fix build for less common build directories names scripts/tracetool generates a C preprocessor macro from the name of the build directory. Any characters which are possible in a directory name but not allowed in a macro name must be substituted, otherwise builds will fail. Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- scripts/tracetool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tracetool.py b/scripts/tracetool.py index 629b2593c8..fe9c9e904b 100755 --- a/scripts/tracetool.py +++ b/scripts/tracetool.py @@ -70,7 +70,7 @@ def make_group_name(filename): if dirname == "": return "common" - return re.sub(r"/|-", "_", dirname) + return re.sub(r"[^A-Za-z0-9]", "_", dirname) def main(args): global _SCRIPT