From patchwork Sun May 20 06:14:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pWrC3244z9s4n for ; Sun, 20 May 2018 16:16:10 +1000 (AEST) Received: from localhost ([::1]:45270 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHdW-0001Xu-6J for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:16:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHck-0001XQ-4J for qemu-devel@nongnu.org; Sun, 20 May 2018 02:15:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHcg-0005Jp-PD for qemu-devel@nongnu.org; Sun, 20 May 2018 02:15:18 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:33915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHcg-0005Il-Hj; Sun, 20 May 2018 02:15:14 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id C93F9410E4; Sun, 20 May 2018 09:15:11 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id A65281074; Sun, 20 May 2018 09:15:11 +0300 (MSK) Received: (nullmailer pid 7343 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:47 +0300 Message-Id: <1d349821551c2da4dfefe36c6ac17319f33ebbd5.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 01/22] tcg: fix s/compliment/complement/ typos X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, "Emilio G. Cota" , Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Signed-off-by: Michael Tokarev --- target/i386/translate.c | 2 +- target/m68k/translate.c | 2 +- tcg/README | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index b0f69838f2..7c21814676 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -113,7 +113,7 @@ typedef struct DisasContext { int rex_x, rex_b; #endif int vex_l; /* vex vector length */ - int vex_v; /* vex vvvv register, without 1's compliment. */ + int vex_v; /* vex vvvv register, without 1's complement. */ int ss32; /* 32 bit stack segment */ CCOp cc_op; /* current CC operation */ bool cc_op_dirty; diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 44a0ac4e2e..8959e4d0f0 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -4002,7 +4002,7 @@ DISAS_INSN(bfext_reg) TCGv shift; /* In general, we're going to rotate the field so that it's at the - top of the word and then right-shift by the compliment of the + top of the word and then right-shift by the complement of the width to extend the field. */ if (ext & 0x20) { /* Variable width. */ diff --git a/tcg/README b/tcg/README index a5237a9edb..d22ee084b8 100644 --- a/tcg/README +++ b/tcg/README @@ -561,7 +561,7 @@ E.g. VECL=1 -> 64 << 1 -> v128, and VECE=2 -> 1 << 2 -> i32. * orc_vec v0, v1, v2 * not_vec v0, v1 - Similarly, logical operations with and without compliment. + Similarly, logical operations with and without complement. Note that VECE is unused. * shli_vec v0, v1, i2 From patchwork Sun May 20 06:14:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pWrC2y2Gz9s4V for ; Sun, 20 May 2018 16:16:09 +1000 (AEST) Received: from localhost ([::1]:45272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHdX-0001YV-DL for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:16:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHck-0001XS-4K for qemu-devel@nongnu.org; Sun, 20 May 2018 02:15:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHch-0005KG-77 for qemu-devel@nongnu.org; Sun, 20 May 2018 02:15:18 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:38963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHcg-0005If-Ht; Sun, 20 May 2018 02:15:14 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 0F1104111D; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id C6F431076; Sun, 20 May 2018 09:15:11 +0300 (MSK) Received: (nullmailer pid 7348 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:48 +0300 Message-Id: <787bbc306e2770c73f9fd9d3a209d26af191e352.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 02/22] misc, ide: remove use of HWADDR_PRIx in trace events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Daniel P. Berrangé The trace events all use a uint64_t data type, so should be using the corresponding PRIx64 format, not HWADDR_PRIx which is intended for use with the 'hwaddr' type. Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- hw/ide/trace-events | 4 ++-- hw/misc/trace-events | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/ide/trace-events b/hw/ide/trace-events index 0c39cabe72..5c0e59ec42 100644 --- a/hw/ide/trace-events +++ b/hw/ide/trace-events @@ -108,8 +108,8 @@ ahci_dma_prepare_buf_fail(void *s, int port) "ahci(%p)[%d]: sglist population fa ahci_dma_rw_buf(void *s, int port, int l) "ahci(%p)[%d] len=0x%x" ahci_cmd_done(void *s, int port) "ahci(%p)[%d]: cmd done" ahci_reset(void *s) "ahci(%p): HBA reset" -allwinner_ahci_mem_read(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): read a=%p addr=0x%"HWADDR_PRIx" val=0x%"PRIx64", size=%d" -allwinner_ahci_mem_write(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): write a=%p addr=0x%"HWADDR_PRIx" val=0x%"PRIx64", size=%d" +allwinner_ahci_mem_read(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): read a=%p addr=0x%"PRIx64" val=0x%"PRIx64", size=%d" +allwinner_ahci_mem_write(void *s, void *a, uint64_t addr, uint64_t val, unsigned size) "ahci(%p): write a=%p addr=0x%"PRIx64" val=0x%"PRIx64", size=%d" # Warning: Verbose handle_reg_h2d_fis_dump(void *s, int port, const char *fis) "ahci(%p)[%d]: %s" diff --git a/hw/misc/trace-events b/hw/misc/trace-events index 562d9ed005..ec5a9f0da1 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -69,13 +69,13 @@ mps2_fpgaio_reset(void) "MPS2 FPGAIO: reset" mps2_fpgaio_leds(char led1, char led0) "MPS2 FPGAIO LEDs: %c%c" # hw/misc/msf2-sysreg.c -msf2_sysreg_write(uint64_t offset, uint32_t val, uint32_t prev) "msf2-sysreg write: addr 0x%08" HWADDR_PRIx " data 0x%" PRIx32 " prev 0x%" PRIx32 -msf2_sysreg_read(uint64_t offset, uint32_t val) "msf2-sysreg read: addr 0x%08" HWADDR_PRIx " data 0x%08" PRIx32 +msf2_sysreg_write(uint64_t offset, uint32_t val, uint32_t prev) "msf2-sysreg write: addr 0x%08" PRIx64 " data 0x%" PRIx32 " prev 0x%" PRIx32 +msf2_sysreg_read(uint64_t offset, uint32_t val) "msf2-sysreg read: addr 0x%08" PRIx64 " data 0x%08" PRIx32 msf2_sysreg_write_pll_status(void) "Invalid write to read only PLL status register" #hw/misc/imx7_gpr.c -imx7_gpr_read(uint64_t offset) "addr 0x%08" HWADDR_PRIx -imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" HWADDR_PRIx "value 0x%08" HWADDR_PRIx +imx7_gpr_read(uint64_t offset) "addr 0x%08" PRIx64 +imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" PRIx64 "value 0x%08" PRIx64 # hw/misc/mos6522.c mos6522_set_counter(int index, unsigned int val) "T%d.counter=%d" From patchwork Sun May 20 06:14:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pWx20g07z9s4V for ; Sun, 20 May 2018 16:20:22 +1000 (AEST) Received: from localhost ([::1]:45289 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHhb-0006SM-QR for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:20:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHck-0001XT-4u for qemu-devel@nongnu.org; Sun, 20 May 2018 02:15:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHch-0005KU-KI for qemu-devel@nongnu.org; Sun, 20 May 2018 02:15:18 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:36461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHch-0005K2-9L; Sun, 20 May 2018 02:15:15 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7EC224111F; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 2E98AF4A; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: (nullmailer pid 7350 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:49 +0300 Message-Id: <3ad9319f5cf560567ae75c2d94614e979409d580.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 03/22] slirp/debug: Print IP addresses in human readable form X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , qemu-trivial@nongnu.org, Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Alexey Kardashevskiy Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Tokarev --- slirp/arp_table.c | 4 ++-- slirp/socket.c | 8 ++++---- slirp/udp.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/slirp/arp_table.c b/slirp/arp_table.c index 3547043555..bac608f97f 100644 --- a/slirp/arp_table.c +++ b/slirp/arp_table.c @@ -33,7 +33,7 @@ void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN]) int i; DEBUG_CALL("arp_table_add"); - DEBUG_ARG("ip = 0x%x", ip_addr); + DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr)); DEBUG_ARGS((dfd, " hw addr = %02x:%02x:%02x:%02x:%02x:%02x\n", ethaddr[0], ethaddr[1], ethaddr[2], ethaddr[3], ethaddr[4], ethaddr[5])); @@ -67,7 +67,7 @@ bool arp_table_search(Slirp *slirp, uint32_t ip_addr, int i; DEBUG_CALL("arp_table_search"); - DEBUG_ARG("ip = 0x%x", ip_addr); + DEBUG_ARG("ip = %s", inet_ntoa(*(struct in_addr *)&ip_addr)); /* If broadcast address */ if (ip_addr == 0xffffffff || ip_addr == broadcast_addr) { diff --git a/slirp/socket.c b/slirp/socket.c index cb7b5b608d..61347d1a0c 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -701,10 +701,10 @@ tcp_listen(Slirp *slirp, uint32_t haddr, u_int hport, uint32_t laddr, memset(&addr, 0, addrlen); DEBUG_CALL("tcp_listen"); - DEBUG_ARG("haddr = %x", haddr); - DEBUG_ARG("hport = %d", hport); - DEBUG_ARG("laddr = %x", laddr); - DEBUG_ARG("lport = %d", lport); + DEBUG_ARG("haddr = %s", inet_ntoa(*(struct in_addr *)&haddr)); + DEBUG_ARG("hport = %d", ntohs(hport)); + DEBUG_ARG("laddr = %s", inet_ntoa(*(struct in_addr *)&laddr)); + DEBUG_ARG("lport = %d", ntohs(lport)); DEBUG_ARG("flags = %x", flags); so = socreate(slirp); diff --git a/slirp/udp.c b/slirp/udp.c index 227d779022..e5bf065bf2 100644 --- a/slirp/udp.c +++ b/slirp/udp.c @@ -241,8 +241,8 @@ int udp_output(struct socket *so, struct mbuf *m, DEBUG_CALL("udp_output"); DEBUG_ARG("so = %p", so); DEBUG_ARG("m = %p", m); - DEBUG_ARG("saddr = %lx", (long)saddr->sin_addr.s_addr); - DEBUG_ARG("daddr = %lx", (long)daddr->sin_addr.s_addr); + DEBUG_ARG("saddr = %s", inet_ntoa(saddr->sin_addr)); + DEBUG_ARG("daddr = %s", inet_ntoa(daddr->sin_addr)); /* * Adjust for header From patchwork Sun May 20 06:14:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pWrC305xz9s4b for ; Sun, 20 May 2018 16:16:09 +1000 (AEST) Received: from localhost ([::1]:45271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHdW-0001Y1-3P for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:16:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHck-0001XR-4M for qemu-devel@nongnu.org; Sun, 20 May 2018 02:15:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHcg-0005Js-PG for qemu-devel@nongnu.org; Sun, 20 May 2018 02:15:18 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:36767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHcg-0005Im-Hw; Sun, 20 May 2018 02:15:14 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 51E954111E; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 0405710B4; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: (nullmailer pid 7356 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:50 +0300 Message-Id: <0b816e986dd5b39ff5dfacd6c74e012b3b4c09e1.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 04/22] qemu-option-trace: -trace enable= is a pattern, not a file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Michael Tokarev --- qemu-option-trace.texi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/qemu-option-trace.texi b/qemu-option-trace.texi index 4166d5cdc2..7d1b7f05c5 100644 --- a/qemu-option-trace.texi +++ b/qemu-option-trace.texi @@ -2,9 +2,8 @@ Specify tracing options. @table @option @item [enable=]@var{pattern} -Immediately enable events matching @var{pattern}. -The file must contain one event name (as listed in the @file{trace-events-all} -file) per line; globbing patterns are accepted too. This option is only +Immediately enable events matching @var{pattern} +(either event name or a globbing pattern). This option is only available if QEMU has been compiled with the @var{simple}, @var{log} or @var{ftrace} tracing backend. To specify multiple events or patterns, specify the @option{-trace} option multiple times. From patchwork Sun May 20 06:14:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917037 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXGG1q6zz9s4n for ; Sun, 20 May 2018 16:35:16 +1000 (AEST) Received: from localhost ([::1]:45343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHw1-00063c-8N for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:35:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHvD-000609-9e for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHvA-0002td-43 for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:23 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:32885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHv9-0002t8-Sj; Sun, 20 May 2018 02:34:20 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 0B0364111F; Sun, 20 May 2018 09:34:19 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 715D710C5; Sun, 20 May 2018 09:15:13 +0300 (MSK) Received: (nullmailer pid 7360 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:51 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 05/22] HACKING: document preference for g_new instead of g_malloc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , David Hildenbrand , qemu-trivial@nongnu.org, Michael Tokarev , Markus Armbruster , Murilo Opsfelder Araujo , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Murilo Opsfelder Araujo This patch documents the preference for g_new instead of g_malloc. The reasons were adapted from commit b45c03f585ea9bb1af76c73e82195418c294919d. Discussion in QEMU's mailing list: http://lists.nongnu.org/archive/html/qemu-devel/2018-05/msg03238.html Cc: qemu-devel@nongnu.org Cc: David Hildenbrand Cc: Eduardo Habkost Cc: Markus Armbruster Cc: Paolo Bonzini Signed-off-by: Murilo Opsfelder Araujo Reviewed-by: Eric Blake Reviewed-by: Alex Bennée Reviewed-by: David Hildenbrand Signed-off-by: Michael Tokarev --- HACKING | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/HACKING b/HACKING index 4125c97d8d..0fc3e0fc04 100644 --- a/HACKING +++ b/HACKING @@ -118,6 +118,15 @@ Please note that g_malloc will exit on allocation failure, so there is no need to test for failure (as you would have to with malloc). Calling g_malloc with a zero size is valid and will return NULL. +Prefer g_new(T, n) instead of g_malloc(sizeof(T) * n) for the following +reasons: + + a. It catches multiplication overflowing size_t; + b. It returns T * instead of void *, letting compiler catch more type + errors. + +Declarations like T *v = g_malloc(sizeof(*v)) are acceptable, though. + Memory allocated by qemu_memalign or qemu_blockalign must be freed with qemu_vfree, since breaking this will cause problems on Win32. From patchwork Sun May 20 06:14:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pX2Z40lcz9s4b for ; Sun, 20 May 2018 16:25:10 +1000 (AEST) Received: from localhost ([::1]:45306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHmF-0007xD-QK for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:25:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlW-0007n6-RS for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHlT-0008JV-MH for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:58087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlT-0008JC-EP; Sun, 20 May 2018 02:24:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B4142410E4; Sun, 20 May 2018 09:24:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id D235EF4A; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: (nullmailer pid 7367 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:52 +0300 Message-Id: <65f389c0e7f6660e1acbd93e2ad23ce7172324bf.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 06/22] qemu-img-commands.hx: argument ordering fixups X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , John Snow Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: John Snow The TEXI and string versions are actually identical, except for markup. We can probably automate this... but make the ordering the same until then. Signed-off-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Michael Tokarev --- qemu-img-cmds.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 2fe31893cf..8bcefcafe9 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -23,13 +23,13 @@ STEXI ETEXI DEF("check", img_check, - "check [-q] [--object objectdef] [--image-opts] [-f fmt] [--output=ofmt] [-r [leaks | all]] [-T src_cache] [-U] filename") + "check [--object objectdef] [--image-opts] [-q] [-f fmt] [--output=ofmt] [-r [leaks | all]] [-T src_cache] [-U] filename") STEXI @item check [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] [-U] @var{filename} ETEXI DEF("commit", img_commit, - "commit [-q] [--object objectdef] [--image-opts] [-f fmt] [-t cache] [-b base] [-d] [-p] filename") + "commit [--object objectdef] [--image-opts] [-q] [-f fmt] [-t cache] [-b base] [-d] [-p] filename") STEXI @item commit [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename} ETEXI @@ -47,7 +47,7 @@ STEXI ETEXI DEF("create", img_create, - "create [-q] [--object objectdef] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]") + "create [--object objectdef] [-q] [-f fmt] [-b backing_file] [-F backing_fmt] [-u] [-o options] filename [size]") STEXI @item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] ETEXI From patchwork Sun May 20 06:14:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917028 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pX5G3FmVz9s4n for ; Sun, 20 May 2018 16:27:30 +1000 (AEST) Received: from localhost ([::1]:45322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHoW-0002Ef-39 for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:27:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlW-0007n2-RH for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHlT-0008Ji-SP for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:49135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlT-0008JG-GH; Sun, 20 May 2018 02:24:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D23B74111E; Sun, 20 May 2018 09:24:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 530AB10CF; Sun, 20 May 2018 09:15:14 +0300 (MSK) Received: (nullmailer pid 7373 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:53 +0300 Message-Id: <83e6da02b6bd3401fd6e5ea57915b84144465740.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 07/22] qemu-img.texi: fix command ordering X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , John Snow Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: John Snow This should match the summary ordering, which is alphabetical. Signed-off-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Michael Tokarev --- qemu-img.texi | 58 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/qemu-img.texi b/qemu-img.texi index 8a26400adb..adf5176902 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -193,6 +193,12 @@ sets the number of input blocks to skip Command description: @table @option + +@item amend [-p] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename} + +Amends the image format specific @var{options} for the image file +@var{filename}. Not all file formats support this operation. + @item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-interval=@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern=@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var{cache}] [-w] @var{filename} Run a simple sequential I/O benchmark on the specified image. If @code{-w} is @@ -253,30 +259,6 @@ If @code{-r} is specified, exit codes representing the image state refer to the state after (the attempt at) repairing it. That is, a successful @code{-r all} will yield the exit code 0, independently of the image state before. -@item create [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] - -Create the new disk image @var{filename} of size @var{size} and format -@var{fmt}. Depending on the file format, you can add one or more @var{options} -that enable additional features of this format. - -If the option @var{backing_file} is specified, then the image will record -only the differences from @var{backing_file}. No size needs to be specified in -this case. @var{backing_file} will never be modified unless you use the -@code{commit} monitor command (or qemu-img commit). - -If a relative path name is given, the backing file is looked up relative to -the directory containing @var{filename}. - -Note that a given backing file will be opened to check that it is valid. Use -the @code{-u} option to enable unsafe backing file mode, which means that the -image will be created even if the associated backing file cannot be opened. A -matching backing file must be created or additional options be used to make the -backing file specification valid when you want to use an image created this -way. - -The size can also be specified using the @var{size} option with @code{-o}, -it doesn't need to be specified separately in this case. - @item commit [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename} Commit the changes recorded in @var{filename} in its base image or backing file. @@ -381,6 +363,30 @@ creating compressed images. @var{num_coroutines} specifies how many coroutines work in parallel during the convert process (defaults to 8). +@item create [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] + +Create the new disk image @var{filename} of size @var{size} and format +@var{fmt}. Depending on the file format, you can add one or more @var{options} +that enable additional features of this format. + +If the option @var{backing_file} is specified, then the image will record +only the differences from @var{backing_file}. No size needs to be specified in +this case. @var{backing_file} will never be modified unless you use the +@code{commit} monitor command (or qemu-img commit). + +If a relative path name is given, the backing file is looked up relative to +the directory containing @var{filename}. + +Note that a given backing file will be opened to check that it is valid. Use +the @code{-u} option to enable unsafe backing file mode, which means that the +image will be created even if the associated backing file cannot be opened. A +matching backing file must be created or additional options be used to make the +backing file specification valid when you want to use an image created this +way. + +The size can also be specified using the @var{size} option with @code{-o}, +it doesn't need to be specified separately in this case. + @item dd [-f @var{fmt}] [-O @var{output_fmt}] [bs=@var{block_size}] [count=@var{blocks}] [skip=@var{blocks}] if=@var{input} of=@var{output} Dd copies from @var{input} file to @var{output} file converting it from @@ -585,10 +591,6 @@ how the additional image area should be allocated on the host. See the format description in the @code{NOTES} section which values are allowed. Using this option may result in slightly more data being allocated than necessary. -@item amend [-p] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename} - -Amends the image format specific @var{options} for the image file -@var{filename}. Not all file formats support this operation. @end table @c man end From patchwork Sun May 20 06:14:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pX2Z40mYz9s4n for ; Sun, 20 May 2018 16:25:09 +1000 (AEST) Received: from localhost ([::1]:45304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHmE-0007v7-0m for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:25:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlW-0007n1-R1 for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHlT-0008Jc-Nk for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:52091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlT-0008JF-GD; Sun, 20 May 2018 02:24:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D51C44111F; Sun, 20 May 2018 09:24:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 58C6910C4; Sun, 20 May 2018 09:15:13 +0300 (MSK) Received: (nullmailer pid 7376 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:54 +0300 Message-Id: <183861456d5e01649df9591a535486c10d72e060.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 08/22] qemu-img: remove references to GEN_DOCS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , John Snow Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: John Snow Nothing seemingly uses this. (jcody: commit 77bd1119ba even mentions that it appears unused) Signed-off-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Michael Tokarev --- qemu-img.c | 2 -- qemu-options-wrapper.h | 1 - 2 files changed, 3 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 60e45ec103..2b5a5706b6 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -123,7 +123,6 @@ static void QEMU_NORETURN help(void) " " arg_string "\n" #include "qemu-img-cmds.h" #undef DEF -#undef GEN_DOCS "\n" "Command parameters:\n" " 'filename' is a disk image filename\n" @@ -4716,7 +4715,6 @@ static const img_cmd_t img_cmds[] = { { option, callback }, #include "qemu-img-cmds.h" #undef DEF -#undef GEN_DOCS { NULL, NULL, }, }; diff --git a/qemu-options-wrapper.h b/qemu-options-wrapper.h index 13bfea0294..6f548e3922 100644 --- a/qemu-options-wrapper.h +++ b/qemu-options-wrapper.h @@ -34,7 +34,6 @@ #undef DEF #undef DEFHEADING #undef ARCHHEADING -#undef GEN_DOCS #undef QEMU_OPTIONS_GENERATE_ENUM #undef QEMU_OPTIONS_GENERATE_HELP From patchwork Sun May 20 06:14:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXGG1q5vz9s4b for ; Sun, 20 May 2018 16:35:16 +1000 (AEST) Received: from localhost ([::1]:45342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHw0-00063Z-IN for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:35:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHvD-00060A-9g for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHvA-0002tu-7N for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:23 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:36683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHv9-0002t4-SK; Sun, 20 May 2018 02:34:20 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 1647541129; Sun, 20 May 2018 09:34:19 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 7E72E1074; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: (nullmailer pid 7381 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:55 +0300 Message-Id: <9775fcdb11ab425cc3537ebe95dcf818bedfc954.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 09/22] qemu-img: Make documentation between .texi and .hx consistent X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , John Snow Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: John Snow These are also different and out of order for whatever reason. I'd like to automate this in the future, but for now let's put on the band-aid. In the case of resize, there were options missing from all three docstrings; the new string is based on the code. Signed-off-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Michael Tokarev --- qemu-img-cmds.hx | 4 ++-- qemu-img.texi | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 8bcefcafe9..84deb858af 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -89,9 +89,9 @@ STEXI ETEXI DEF("resize", img_resize, - "resize [--object objectdef] [--image-opts] [-q] [--shrink] filename [+ | -]size") + "resize [--object objectdef] [--image-opts] [-f fmt] [--preallocation=prealloc] [-q] [--shrink] filename [+ | -]size") STEXI -@item resize [--object @var{objectdef}] [--image-opts] [-q] [--shrink] @var{filename} [+ | -]@var{size} +@item resize [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [--preallocation=@var{prealloc}] [-q] [--shrink] @var{filename} [+ | -]@var{size} ETEXI STEXI diff --git a/qemu-img.texi b/qemu-img.texi index adf5176902..2be8206a05 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -194,12 +194,12 @@ Command description: @table @option -@item amend [-p] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename} +@item amend [--object @var{objectdef}] [--image-opts] [-p] [-p] [-f @var{fmt}] [-t @var{cache}] -o @var{options} @var{filename} Amends the image format specific @var{options} for the image file @var{filename}. Not all file formats support this operation. -@item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-interval=@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern=@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var{cache}] [-w] @var{filename} +@item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-interval=@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern=@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var{cache}] [-w] [-U] @var{filename} Run a simple sequential I/O benchmark on the specified image. If @code{-w} is specified, a write test is performed, otherwise a read test is performed. @@ -223,7 +223,7 @@ specified as well. For write tests, by default a buffer filled with zeros is written. This can be overridden with a pattern byte specified by @var{pattern}. -@item check [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] @var{filename} +@item check [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [--output=@var{ofmt}] [-r [leaks | all]] [-T @var{src_cache}] [-U] @var{filename} Perform a consistency check on the disk image @var{filename}. The command can output in the format @var{ofmt} which is either @code{human} or @code{json}. @@ -259,7 +259,7 @@ If @code{-r} is specified, exit codes representing the image state refer to the state after (the attempt at) repairing it. That is, a successful @code{-r all} will yield the exit code 0, independently of the image state before. -@item commit [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename} +@item commit [--object @var{objectdef}] [--image-opts] [-q] [-f @var{fmt}] [-t @var{cache}] [-b @var{base}] [-d] [-p] @var{filename} Commit the changes recorded in @var{filename} in its base image or backing file. If the backing file is smaller than the snapshot, then the backing file will be @@ -281,7 +281,7 @@ all images between @var{base} and the top image will be invalid and may return garbage data when read. For this reason, @code{-b} implies @code{-d} (so that the top image stays valid). -@item compare [-f @var{fmt}] [-F @var{fmt}] [-T @var{src_cache}] [-p] [-s] [-q] @var{filename1} @var{filename2} +@item compare [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [-F @var{fmt}] [-T @var{src_cache}] [-p] [-q] [-s] [-U] @var{filename1} @var{filename2} Check if two images have the same content. You can compare images with different format or settings. @@ -322,7 +322,7 @@ Error on reading data @end table -@item convert [-c] [-p] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-s @var{snapshot_id_or_name}] [-l @var{snapshot_param}] [-m @var{num_coroutines}] [-W] [-S @var{sparse_size}] @var{filename} [@var{filename2} [...]] @var{output_filename} +@item convert [--object @var{objectdef}] [--image-opts] [--target-image-opts] [-U] [-c] [-p] [-q] [-n] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-O @var{output_fmt}] [-B @var{backing_file}] [-o @var{options}] [-s @var{snapshot_id_or_name}] [-l @var{snapshot_param}] [-S @var{sparse_size}] [-m @var{num_coroutines}] [-W] @var{filename} [@var{filename2} [...]] @var{output_filename} Convert the disk image @var{filename} or a snapshot @var{snapshot_param}(@var{snapshot_id_or_name} is deprecated) to disk image @var{output_filename} using format @var{output_fmt}. It can be optionally compressed (@code{-c} @@ -363,7 +363,7 @@ creating compressed images. @var{num_coroutines} specifies how many coroutines work in parallel during the convert process (defaults to 8). -@item create [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] +@item create [--object @var{objectdef}] [-q] [-f @var{fmt}] [-b @var{backing_file}] [-F @var{backing_fmt}] [-u] [-o @var{options}] @var{filename} [@var{size}] Create the new disk image @var{filename} of size @var{size} and format @var{fmt}. Depending on the file format, you can add one or more @var{options} @@ -387,7 +387,7 @@ way. The size can also be specified using the @var{size} option with @code{-o}, it doesn't need to be specified separately in this case. -@item dd [-f @var{fmt}] [-O @var{output_fmt}] [bs=@var{block_size}] [count=@var{blocks}] [skip=@var{blocks}] if=@var{input} of=@var{output} +@item dd [--image-opts] [-U] [-f @var{fmt}] [-O @var{output_fmt}] [bs=@var{block_size}] [count=@var{blocks}] [skip=@var{blocks}] if=@var{input} of=@var{output} Dd copies from @var{input} file to @var{output} file converting it from @var{fmt} format to @var{output_fmt} format. @@ -398,7 +398,7 @@ dd will stop reading input after reading @var{blocks} input blocks. The size syntax is similar to dd(1)'s size syntax. -@item info [-f @var{fmt}] [--output=@var{ofmt}] [--backing-chain] @var{filename} +@item info [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [--output=@var{ofmt}] [--backing-chain] [-U] @var{filename} Give information about the disk image @var{filename}. Use it in particular to know the size reserved on disk which can be different @@ -506,11 +506,11 @@ been written to all sectors. This is the maximum size that the image file can occupy with the exception of internal snapshots, dirty bitmaps, vmstate data, and other advanced image format features. -@item snapshot [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot} ] @var{filename} +@item snapshot [--object @var{objectdef}] [--image-opts] [-U] [-q] [-l | -a @var{snapshot} | -c @var{snapshot} | -d @var{snapshot}] @var{filename} List, apply, create or delete snapshots in image @var{filename}. -@item rebase [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-p] [-u] -b @var{backing_file} [-F @var{backing_fmt}] @var{filename} +@item rebase [--object @var{objectdef}] [--image-opts] [-U] [-q] [-f @var{fmt}] [-t @var{cache}] [-T @var{src_cache}] [-p] [-u] -b @var{backing_file} [-F @var{backing_fmt}] @var{filename} Changes the backing file of an image. Only the formats @code{qcow2} and @code{qed} support changing the backing file. @@ -570,7 +570,7 @@ qemu-img rebase -b base.img diff.qcow2 At this point, @code{modified.img} can be discarded, since @code{base.img + diff.qcow2} contains the same information. -@item resize [--shrink] [--preallocation=@var{prealloc}] @var{filename} [+ | -]@var{size} +@item resize [--object @var{objectdef}] [--image-opts] [-f @var{fmt}] [--preallocation=@var{prealloc}] [-q] [--shrink] @var{filename} [+ | -]@var{size} Change the disk image as if it had been created with @var{size}. From patchwork Sun May 20 06:14:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXGq4npsz9s4V for ; Sun, 20 May 2018 16:35:47 +1000 (AEST) Received: from localhost ([::1]:45346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHwX-0006S2-AX for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:35:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHvG-000634-8v for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHvA-0002tU-3Q for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:23 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:56971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHv9-0002t5-SH; Sun, 20 May 2018 02:34:20 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E01494111D; Sun, 20 May 2018 09:34:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 3C26110CE; Sun, 20 May 2018 09:15:14 +0300 (MSK) Received: (nullmailer pid 7384 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:56 +0300 Message-Id: <4885b0caf607579a0f99c221fa39ca97d9a6ddf4.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 10/22] qemu-img-cmds.hx: add passive-aggressive note X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , John Snow Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: John Snow I'm kidding. It's very easy to forget there are per-command sections in the texi, and insane that we don't autogenerate those, too. Until then, leave a little post-it note in this .hx file until I find a way to delete it. Signed-off-by: John Snow Reviewed-by: Jeff Cody Signed-off-by: Michael Tokarev --- qemu-img-cmds.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 84deb858af..3d2f7b26eb 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -6,6 +6,9 @@ HXCOMM DEF(command, callback, arg_string) is used to construct HXCOMM command structures and help message. HXCOMM HXCOMM can be used for comments, discarded from both texi and C +HXCOMM When amending the TEXI sections, please remember to copy the usage +HXCOMM over to the per-command sections in qemu-img.texi. + STEXI @table @option ETEXI From patchwork Sun May 20 06:14:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917067 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXjN1QBxz9s3M for ; Sun, 20 May 2018 16:55:20 +1000 (AEST) Received: from localhost ([::1]:45403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIFR-0008Cu-Mz for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:55:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIEY-0007pE-KF for qemu-devel@nongnu.org; Sun, 20 May 2018 02:54:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKIEV-0002K4-IZ for qemu-devel@nongnu.org; Sun, 20 May 2018 02:54:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:37303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIEV-0002Jf-B9; Sun, 20 May 2018 02:54:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2C3344111D; Sun, 20 May 2018 09:54:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 2D99110C1; Sun, 20 May 2018 09:15:13 +0300 (MSK) Received: (nullmailer pid 7388 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:57 +0300 Message-Id: <6b1875476313ce320a6a1d1827e85511365a469c.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 11/22] hw/ide/ahci: Keep ALLWINNER_AHCI() macro internal X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The ALLWINNER_AHCI() macro is only used in ahci-allwinner.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: John Snow Signed-off-by: Michael Tokarev --- hw/ide/ahci-allwinner.c | 3 +++ hw/ide/ahci_internal.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ide/ahci-allwinner.c b/hw/ide/ahci-allwinner.c index 5397483fd8..2fd95078ba 100644 --- a/hw/ide/ahci-allwinner.c +++ b/hw/ide/ahci-allwinner.c @@ -24,6 +24,9 @@ #include "trace.h" +#define ALLWINNER_AHCI(obj) \ + OBJECT_CHECK(AllwinnerAHCIState, (obj), TYPE_ALLWINNER_AHCI) + #define ALLWINNER_AHCI_BISTAFR ((0xa0 - ALLWINNER_AHCI_MMIO_OFF) / 4) #define ALLWINNER_AHCI_BISTCR ((0xa4 - ALLWINNER_AHCI_MMIO_OFF) / 4) #define ALLWINNER_AHCI_BISTFCTR ((0xa8 - ALLWINNER_AHCI_MMIO_OFF) / 4) diff --git a/hw/ide/ahci_internal.h b/hw/ide/ahci_internal.h index 8c755d4ca1..1a25d6c039 100644 --- a/hw/ide/ahci_internal.h +++ b/hw/ide/ahci_internal.h @@ -375,7 +375,4 @@ void ahci_reset(AHCIState *s); #define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI) -#define ALLWINNER_AHCI(obj) OBJECT_CHECK(AllwinnerAHCIState, (obj), \ - TYPE_ALLWINNER_AHCI) - #endif /* HW_IDE_AHCI_H */ From patchwork Sun May 20 06:14:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917065 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXjG2wHmz9s3M for ; Sun, 20 May 2018 16:55:12 +1000 (AEST) Received: from localhost ([::1]:45400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIFJ-0007xe-ML for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:55:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIEY-0007pI-KG for qemu-devel@nongnu.org; Sun, 20 May 2018 02:54:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKIEV-0002Jx-HY for qemu-devel@nongnu.org; Sun, 20 May 2018 02:54:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:52015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIEV-0002Jc-Ae; Sun, 20 May 2018 02:54:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 45E9F4112C; Sun, 20 May 2018 09:54:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 15CCD10C0; Sun, 20 May 2018 09:15:13 +0300 (MSK) Received: (nullmailer pid 7391 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:58 +0300 Message-Id: <7647d5c6b5e3b3f36a6e0441c81ae3fe797eb233.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 12/22] tests: fix tpm-crb tpm-tis tests race X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Tokarev , Stefan Berger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau No need to close the TPM data socket on the emulator end, qemu will close it after a SHUTDOWN. This avoids a race between close() and read() in the TPM data thread. Reported-by: Peter Maydell Signed-off-by: Marc-André Lureau Signed-off-by: Stefan Berger Reviewed-by: Daniel P. Berrangé Signed-off-by: Michael Tokarev --- tests/tpm-emu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tpm-emu.c b/tests/tpm-emu.c index 4dada76834..8c2bd53cad 100644 --- a/tests/tpm-emu.c +++ b/tests/tpm-emu.c @@ -125,7 +125,7 @@ void *tpm_emu_ctrl_thread(void *data) case CMD_SHUTDOWN: { ptm_res res = 0; qio_channel_write(ioc, (char *)&res, sizeof(res), &error_abort); - qio_channel_close(s->tpm_ioc, &error_abort); + /* the tpm data thread is expected to finish now */ g_thread_join(s->emu_tpm_thread); break; } From patchwork Sun May 20 06:14:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pWts1fF9z9s4V for ; Sun, 20 May 2018 16:18:29 +1000 (AEST) Received: from localhost ([::1]:45281 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHfm-0003xv-Tg for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:18:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHck-0001XP-4J for qemu-devel@nongnu.org; Sun, 20 May 2018 02:15:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHcg-0005Jt-PD for qemu-devel@nongnu.org; Sun, 20 May 2018 02:15:18 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:36607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHcg-0005In-I0; Sun, 20 May 2018 02:15:14 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7F42741129; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 542A410C0; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: (nullmailer pid 7393 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:14:59 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 13/22] trivial: Do not include pci.h if it is not necessary X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Thomas Huth , Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth There is no need to include pci.h in these files. Signed-off-by: Thomas Huth Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- include/hw/ppc/ppc4xx.h | 2 -- include/hw/virtio/virtio-balloon.h | 1 - include/hw/virtio/virtio-gpu.h | 1 - 3 files changed, 4 deletions(-) diff --git a/include/hw/ppc/ppc4xx.h b/include/hw/ppc/ppc4xx.h index cb0bb55cec..3a2a04c8ce 100644 --- a/include/hw/ppc/ppc4xx.h +++ b/include/hw/ppc/ppc4xx.h @@ -25,8 +25,6 @@ #ifndef PPC4XX_H #define PPC4XX_H -#include "hw/pci/pci.h" - /* PowerPC 4xx core initialization */ PowerPCCPU *ppc4xx_init(const char *cpu_model, clk_setup_t *cpu_clk, clk_setup_t *tb_clk, diff --git a/include/hw/virtio/virtio-balloon.h b/include/hw/virtio/virtio-balloon.h index 1ea13bd6a4..e0df3528c8 100644 --- a/include/hw/virtio/virtio-balloon.h +++ b/include/hw/virtio/virtio-balloon.h @@ -17,7 +17,6 @@ #include "standard-headers/linux/virtio_balloon.h" #include "hw/virtio/virtio.h" -#include "hw/pci/pci.h" #define TYPE_VIRTIO_BALLOON "virtio-balloon-device" #define VIRTIO_BALLOON(obj) \ diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 22ac3c2d0e..79bb3fb3dd 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -18,7 +18,6 @@ #include "ui/qemu-pixman.h" #include "ui/console.h" #include "hw/virtio/virtio.h" -#include "hw/pci/pci.h" #include "qemu/log.h" #include "standard-headers/linux/virtio_gpu.h" From patchwork Sun May 20 06:15:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917066 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXjH6Myxz9s3M for ; Sun, 20 May 2018 16:55:15 +1000 (AEST) Received: from localhost ([::1]:45402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIFN-00085H-DP for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:55:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIEY-0007pz-Qg for qemu-devel@nongnu.org; Sun, 20 May 2018 02:54:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKIEW-0002KM-1K for qemu-devel@nongnu.org; Sun, 20 May 2018 02:54:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:58111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIEV-0002Jd-Ad; Sun, 20 May 2018 02:54:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2F3864111F; Sun, 20 May 2018 09:54:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 8CB7510C6; Sun, 20 May 2018 09:15:13 +0300 (MSK) Received: (nullmailer pid 7395 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:15:00 +0300 Message-Id: <4a4ff4c58fd750cde01c8b15d30d038cefc90a42.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 14/22] Remove unnecessary variables for function return value X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , qemu-trivial@nongnu.org, Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier Re-run Coccinelle script scripts/coccinelle/return_directly.cocci Signed-off-by: Laurent Vivier ppc part Acked-by: David Gibson Signed-off-by: Michael Tokarev --- accel/tcg/translate-all.c | 5 +- block/quorum.c | 6 +-- hw/arm/exynos4210.c | 6 +-- hw/block/vhost-user-blk.c | 5 +- hw/hppa/dino.c | 5 +- hw/misc/mos6522.c | 8 +--- hw/net/ftgmac100.c | 5 +- hw/ppc/pnv_lpc.c | 16 ++----- io/net-listener.c | 6 +-- target/i386/hax-darwin.c | 10 ++-- target/mips/dsp_helper.c | 15 ++---- target/xtensa/core-dc232b/xtensa-modules.inc.c | 56 ++++++---------------- target/xtensa/core-dc233c/xtensa-modules.inc.c | 56 ++++++---------------- target/xtensa/core-de212/xtensa-modules.inc.c | 48 +++++-------------- target/xtensa/core-fsf/xtensa-modules.inc.c | 32 ++++--------- .../core-sample_controller/xtensa-modules.inc.c | 24 +++------- target/xtensa/translate.c | 7 +-- tests/m48t59-test.c | 6 +-- tests/test-thread-pool.c | 6 +-- util/uri.c | 5 +- 20 files changed, 79 insertions(+), 248 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index f409d42d54..732c919629 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -644,11 +644,8 @@ static inline void *alloc_code_gen_buffer(void) static inline void *alloc_code_gen_buffer(void) { size_t size = tcg_ctx->code_gen_buffer_size; - void *buf; - - buf = VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT, + return VirtualAlloc(NULL, size, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE); - return buf; } #else static inline void *alloc_code_gen_buffer(void) diff --git a/block/quorum.c b/block/quorum.c index e448d7e384..b6476c405a 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -613,7 +613,7 @@ static void read_quorum_children_entry(void *opaque) static int read_quorum_children(QuorumAIOCB *acb) { BDRVQuorumState *s = acb->bs->opaque; - int i, ret; + int i; acb->children_read = s->num_children; for (i = 0; i < s->num_children; i++) { @@ -648,9 +648,7 @@ static int read_quorum_children(QuorumAIOCB *acb) qemu_coroutine_yield(); } - ret = acb->vote_ret; - - return ret; + return acb->vote_ret; } static int read_fifo_child(QuorumAIOCB *acb) diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 06f9d1ffa4..b7463a71ec 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -156,12 +156,8 @@ void exynos4210_write_secondary(ARMCPU *cpu, static uint64_t exynos4210_calc_affinity(int cpu) { - uint64_t mp_affinity; - /* Exynos4210 has 0x9 as cluster ID */ - mp_affinity = (0x9 << ARM_AFF1_SHIFT) | cpu; - - return mp_affinity; + return (0x9 << ARM_AFF1_SHIFT) | cpu; } Exynos4210State *exynos4210_init(MemoryRegion *system_mem) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 262baca432..975eae6211 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -196,7 +196,6 @@ static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev, Error **errp) { VHostUserBlk *s = VHOST_USER_BLK(vdev); - uint64_t get_features; /* Turn on pre-defined features */ virtio_add_feature(&features, VIRTIO_BLK_F_SEG_MAX); @@ -215,9 +214,7 @@ static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev, virtio_add_feature(&features, VIRTIO_BLK_F_MQ); } - get_features = vhost_get_features(&s->dev, user_feature_bits, features); - - return get_features; + return vhost_get_features(&s->dev, user_feature_bits, features); } static void vhost_user_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 15aefde09c..c5dcf3104d 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -403,13 +403,10 @@ static void dino_set_irq(void *opaque, int irq, int level) static int dino_pci_map_irq(PCIDevice *d, int irq_num) { int slot = d->devfn >> 3; - int local_irq; assert(irq_num >= 0 && irq_num <= 3); - local_irq = slot & 0x03; - - return local_irq; + return slot & 0x03; } static void dino_set_timer_irq(void *opaque, int irq, int level) diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 8ad9fc831e..6163cea6ab 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -176,12 +176,8 @@ static void mos6522_set_sr_int(MOS6522State *s) static uint64_t mos6522_get_counter_value(MOS6522State *s, MOS6522Timer *ti) { - uint64_t d; - - d = muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - ti->load_time, - ti->frequency, NANOSECONDS_PER_SECOND); - - return d; + return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - ti->load_time, + ti->frequency, NANOSECONDS_PER_SECOND); } static uint64_t mos6522_get_load_time(MOS6522State *s, MOS6522Timer *ti) diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 704f452067..3300e8ef4a 100644 --- a/hw/net/ftgmac100.c +++ b/hw/net/ftgmac100.c @@ -511,7 +511,6 @@ static uint32_t ftgmac100_rxpoll(FTGMAC100State *s) uint32_t cnt = 1024 * FTGMAC100_APTC_RXPOLL_CNT(s->aptcr); uint32_t speed = (s->maccr & FTGMAC100_MACCR_FAST_MODE) ? 1 : 0; - uint32_t period; if (s->aptcr & FTGMAC100_APTC_RXPOLL_TIME_SEL) { cnt <<= 4; @@ -521,9 +520,7 @@ static uint32_t ftgmac100_rxpoll(FTGMAC100State *s) speed = 2; } - period = cnt / div[speed]; - - return period; + return cnt / div[speed]; } static void ftgmac100_reset(DeviceState *d) diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index c42b4a8f6c..2317d1e62c 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -125,25 +125,17 @@ static int pnv_lpc_dt_xscom(PnvXScomInterface *dev, void *fdt, int xscom_offset) static bool opb_read(PnvLpcController *lpc, uint32_t addr, uint8_t *data, int sz) { - bool success; - /* XXX Handle access size limits and FW read caching here */ - success = !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED, - data, sz, false); - - return success; + return !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED, + data, sz, false); } static bool opb_write(PnvLpcController *lpc, uint32_t addr, uint8_t *data, int sz) { - bool success; - /* XXX Handle access size limits here */ - success = !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED, - data, sz, true); - - return success; + return !address_space_rw(&lpc->opb_as, addr, MEMTXATTRS_UNSPECIFIED, + data, sz, true); } #define ECCB_CTL_READ PPC_BIT(15) diff --git a/io/net-listener.c b/io/net-listener.c index 555e8acaa4..3317aa6e5f 100644 --- a/io/net-listener.c +++ b/io/net-listener.c @@ -25,11 +25,7 @@ QIONetListener *qio_net_listener_new(void) { - QIONetListener *ret; - - ret = QIO_NET_LISTENER(object_new(TYPE_QIO_NET_LISTENER)); - - return ret; + return QIO_NET_LISTENER(object_new(TYPE_QIO_NET_LISTENER)); } void qio_net_listener_set_name(QIONetListener *listener, diff --git a/target/i386/hax-darwin.c b/target/i386/hax-darwin.c index acdde476a0..a5426a6dac 100644 --- a/target/i386/hax-darwin.c +++ b/target/i386/hax-darwin.c @@ -257,10 +257,7 @@ int hax_host_setup_vcpu_channel(struct hax_vcpu_state *vcpu) int hax_vcpu_run(struct hax_vcpu_state *vcpu) { - int ret; - - ret = ioctl(vcpu->fd, HAX_VCPU_IOCTL_RUN, NULL); - return ret; + return ioctl(vcpu->fd, HAX_VCPU_IOCTL_RUN, NULL); } int hax_sync_fpu(CPUArchState *env, struct fx_layout *fl, int set) @@ -315,13 +312,12 @@ int hax_sync_vcpu_state(CPUArchState *env, struct vcpu_state_t *state, int set) int hax_inject_interrupt(CPUArchState *env, int vector) { - int ret, fd; + int fd; fd = hax_vcpu_get_fd(env); if (fd <= 0) { return -1; } - ret = ioctl(fd, HAX_VCPU_IOCTL_INTERRUPT, &vector); - return ret; + return ioctl(fd, HAX_VCPU_IOCTL_INTERRUPT, &vector); } diff --git a/target/mips/dsp_helper.c b/target/mips/dsp_helper.c index f152fea34a..739b69dd45 100644 --- a/target/mips/dsp_helper.c +++ b/target/mips/dsp_helper.c @@ -3274,14 +3274,11 @@ target_ulong helper_dextr_l(target_ulong ac, target_ulong shift, CPUMIPSState *env) { uint64_t temp[3]; - target_ulong result; shift = shift & 0x3F; mipsdsp_rndrashift_acc(temp, ac, shift, env); - result = (temp[1] << 63) | (temp[0] >> 1); - - return result; + return (temp[1] << 63) | (temp[0] >> 1); } target_ulong helper_dextr_r_l(target_ulong ac, target_ulong shift, @@ -3289,7 +3286,6 @@ target_ulong helper_dextr_r_l(target_ulong ac, target_ulong shift, { uint64_t temp[3]; uint32_t temp128; - target_ulong result; shift = shift & 0x3F; mipsdsp_rndrashift_acc(temp, ac, shift, env); @@ -3309,9 +3305,7 @@ target_ulong helper_dextr_r_l(target_ulong ac, target_ulong shift, set_DSPControl_overflow_flag(1, 23, env); } - result = (temp[1] << 63) | (temp[0] >> 1); - - return result; + return (temp[1] << 63) | (temp[0] >> 1); } target_ulong helper_dextr_rs_l(target_ulong ac, target_ulong shift, @@ -3319,7 +3313,6 @@ target_ulong helper_dextr_rs_l(target_ulong ac, target_ulong shift, { uint64_t temp[3]; uint32_t temp128; - target_ulong result; shift = shift & 0x3F; mipsdsp_rndrashift_acc(temp, ac, shift, env); @@ -3345,9 +3338,7 @@ target_ulong helper_dextr_rs_l(target_ulong ac, target_ulong shift, } set_DSPControl_overflow_flag(1, 23, env); } - result = (temp[1] << 63) | (temp[0] >> 1); - - return result; + return (temp[1] << 63) | (temp[0] >> 1); } #endif diff --git a/target/xtensa/core-dc232b/xtensa-modules.inc.c b/target/xtensa/core-dc232b/xtensa-modules.inc.c index d322c3f52a..164df3b1a4 100644 --- a/target/xtensa/core-dc232b/xtensa-modules.inc.c +++ b/target/xtensa/core-dc232b/xtensa-modules.inc.c @@ -1736,9 +1736,7 @@ Operand_arr_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_arr_encode (uint32 *valp) { - int error; - error = (*valp & ~0xf) != 0; - return error; + return (*valp & ~0xf) != 0; } static int @@ -1750,9 +1748,7 @@ Operand_ars_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ars_encode (uint32 *valp) { - int error; - error = (*valp & ~0xf) != 0; - return error; + return (*valp & ~0xf) != 0; } static int @@ -1764,9 +1760,7 @@ Operand_art_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_art_encode (uint32 *valp) { - int error; - error = (*valp & ~0xf) != 0; - return error; + return (*valp & ~0xf) != 0; } static int @@ -1778,9 +1772,7 @@ Operand_ar0_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar0_encode (uint32 *valp) { - int error; - error = (*valp & ~0x1f) != 0; - return error; + return (*valp & ~0x1f) != 0; } static int @@ -1792,9 +1784,7 @@ Operand_ar4_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar4_encode (uint32 *valp) { - int error; - error = (*valp & ~0x1f) != 0; - return error; + return (*valp & ~0x1f) != 0; } static int @@ -1806,9 +1796,7 @@ Operand_ar8_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar8_encode (uint32 *valp) { - int error; - error = (*valp & ~0x1f) != 0; - return error; + return (*valp & ~0x1f) != 0; } static int @@ -1820,9 +1808,7 @@ Operand_ar12_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar12_encode (uint32 *valp) { - int error; - error = (*valp & ~0x1f) != 0; - return error; + return (*valp & ~0x1f) != 0; } static int @@ -1834,9 +1820,7 @@ Operand_ars_entry_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ars_entry_encode (uint32 *valp) { - int error; - error = (*valp & ~0x1f) != 0; - return error; + return (*valp & ~0x1f) != 0; } static int @@ -2406,9 +2390,7 @@ Operand_mx_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mx_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int @@ -2436,9 +2418,7 @@ Operand_mw_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mw_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int @@ -2450,9 +2430,7 @@ Operand_mr0_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mr0_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int @@ -2464,9 +2442,7 @@ Operand_mr1_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mr1_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int @@ -2478,9 +2454,7 @@ Operand_mr2_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mr2_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int @@ -2492,9 +2466,7 @@ Operand_mr3_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mr3_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int diff --git a/target/xtensa/core-dc233c/xtensa-modules.inc.c b/target/xtensa/core-dc233c/xtensa-modules.inc.c index 7c20f82349..0f32f0804a 100644 --- a/target/xtensa/core-dc233c/xtensa-modules.inc.c +++ b/target/xtensa/core-dc233c/xtensa-modules.inc.c @@ -1817,9 +1817,7 @@ Operand_arr_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_arr_encode (uint32 *valp) { - int error; - error = (*valp & ~0xf) != 0; - return error; + return (*valp & ~0xf) != 0; } static int @@ -1831,9 +1829,7 @@ Operand_ars_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ars_encode (uint32 *valp) { - int error; - error = (*valp & ~0xf) != 0; - return error; + return (*valp & ~0xf) != 0; } static int @@ -1845,9 +1841,7 @@ Operand_art_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_art_encode (uint32 *valp) { - int error; - error = (*valp & ~0xf) != 0; - return error; + return (*valp & ~0xf) != 0; } static int @@ -1859,9 +1853,7 @@ Operand_ar0_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar0_encode (uint32 *valp) { - int error; - error = (*valp & ~0x1f) != 0; - return error; + return (*valp & ~0x1f) != 0; } static int @@ -1873,9 +1865,7 @@ Operand_ar4_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar4_encode (uint32 *valp) { - int error; - error = (*valp & ~0x1f) != 0; - return error; + return (*valp & ~0x1f) != 0; } static int @@ -1887,9 +1877,7 @@ Operand_ar8_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar8_encode (uint32 *valp) { - int error; - error = (*valp & ~0x1f) != 0; - return error; + return (*valp & ~0x1f) != 0; } static int @@ -1901,9 +1889,7 @@ Operand_ar12_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar12_encode (uint32 *valp) { - int error; - error = (*valp & ~0x1f) != 0; - return error; + return (*valp & ~0x1f) != 0; } static int @@ -1915,9 +1901,7 @@ Operand_ars_entry_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ars_entry_encode (uint32 *valp) { - int error; - error = (*valp & ~0x1f) != 0; - return error; + return (*valp & ~0x1f) != 0; } static int @@ -2487,9 +2471,7 @@ Operand_mx_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mx_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int @@ -2517,9 +2499,7 @@ Operand_mw_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mw_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int @@ -2531,9 +2511,7 @@ Operand_mr0_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mr0_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int @@ -2545,9 +2523,7 @@ Operand_mr1_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mr1_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int @@ -2559,9 +2535,7 @@ Operand_mr2_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mr2_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int @@ -2573,9 +2547,7 @@ Operand_mr3_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_mr3_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3) != 0; - return error; + return (*valp & ~0x3) != 0; } static int diff --git a/target/xtensa/core-de212/xtensa-modules.inc.c b/target/xtensa/core-de212/xtensa-modules.inc.c index ef7674de3a..480c68d3c6 100644 --- a/target/xtensa/core-de212/xtensa-modules.inc.c +++ b/target/xtensa/core-de212/xtensa-modules.inc.c @@ -1798,9 +1798,7 @@ OperandSem_opnd_sem_AR_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -1812,9 +1810,7 @@ OperandSem_opnd_sem_AR_0_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_0_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -1826,9 +1822,7 @@ OperandSem_opnd_sem_AR_1_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_1_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -1840,9 +1834,7 @@ OperandSem_opnd_sem_AR_2_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_2_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -1854,9 +1846,7 @@ OperandSem_opnd_sem_AR_3_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_3_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -1868,9 +1858,7 @@ OperandSem_opnd_sem_AR_4_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_4_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -2464,9 +2452,7 @@ OperandSem_opnd_sem_MR_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_MR_encode (uint32 *valp) { - int error; - error = (*valp >= 4); - return error; + return (*valp >= 4); } static int @@ -2478,9 +2464,7 @@ OperandSem_opnd_sem_MR_1_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_MR_1_encode (uint32 *valp) { - int error; - error = (*valp >= 4); - return error; + return (*valp >= 4); } static int @@ -2492,9 +2476,7 @@ OperandSem_opnd_sem_MR_2_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_MR_2_encode (uint32 *valp) { - int error; - error = (*valp >= 4); - return error; + return (*valp >= 4); } static int @@ -2506,9 +2488,7 @@ OperandSem_opnd_sem_MR_3_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_MR_3_encode (uint32 *valp) { - int error; - error = (*valp >= 4); - return error; + return (*valp >= 4); } static int @@ -2520,9 +2500,7 @@ OperandSem_opnd_sem_MR_4_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_MR_4_encode (uint32 *valp) { - int error; - error = (*valp >= 4); - return error; + return (*valp >= 4); } static int @@ -2534,9 +2512,7 @@ OperandSem_opnd_sem_MR_5_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_MR_5_encode (uint32 *valp) { - int error; - error = (*valp >= 4); - return error; + return (*valp >= 4); } static int diff --git a/target/xtensa/core-fsf/xtensa-modules.inc.c b/target/xtensa/core-fsf/xtensa-modules.inc.c index f7de2dec15..c32683ff77 100644 --- a/target/xtensa/core-fsf/xtensa-modules.inc.c +++ b/target/xtensa/core-fsf/xtensa-modules.inc.c @@ -1379,9 +1379,7 @@ Operand_arr_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_arr_encode (uint32 *valp) { - int error; - error = (*valp & ~0xf) != 0; - return error; + return (*valp & ~0xf) != 0; } static int @@ -1393,9 +1391,7 @@ Operand_ars_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ars_encode (uint32 *valp) { - int error; - error = (*valp & ~0xf) != 0; - return error; + return (*valp & ~0xf) != 0; } static int @@ -1407,9 +1403,7 @@ Operand_art_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_art_encode (uint32 *valp) { - int error; - error = (*valp & ~0xf) != 0; - return error; + return (*valp & ~0xf) != 0; } static int @@ -1421,9 +1415,7 @@ Operand_ar0_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar0_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3f) != 0; - return error; + return (*valp & ~0x3f) != 0; } static int @@ -1435,9 +1427,7 @@ Operand_ar4_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar4_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3f) != 0; - return error; + return (*valp & ~0x3f) != 0; } static int @@ -1449,9 +1439,7 @@ Operand_ar8_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar8_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3f) != 0; - return error; + return (*valp & ~0x3f) != 0; } static int @@ -1463,9 +1451,7 @@ Operand_ar12_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ar12_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3f) != 0; - return error; + return (*valp & ~0x3f) != 0; } static int @@ -1477,9 +1463,7 @@ Operand_ars_entry_decode (uint32 *valp ATTRIBUTE_UNUSED) static int Operand_ars_entry_encode (uint32 *valp) { - int error; - error = (*valp & ~0x3f) != 0; - return error; + return (*valp & ~0x3f) != 0; } static int diff --git a/target/xtensa/core-sample_controller/xtensa-modules.inc.c b/target/xtensa/core-sample_controller/xtensa-modules.inc.c index fba41b99ae..7e87d216bd 100644 --- a/target/xtensa/core-sample_controller/xtensa-modules.inc.c +++ b/target/xtensa/core-sample_controller/xtensa-modules.inc.c @@ -1570,9 +1570,7 @@ OperandSem_opnd_sem_AR_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -1584,9 +1582,7 @@ OperandSem_opnd_sem_AR_0_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_0_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -1598,9 +1594,7 @@ OperandSem_opnd_sem_AR_1_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_1_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -1612,9 +1606,7 @@ OperandSem_opnd_sem_AR_2_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_2_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -1626,9 +1618,7 @@ OperandSem_opnd_sem_AR_3_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_3_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int @@ -1640,9 +1630,7 @@ OperandSem_opnd_sem_AR_4_decode (uint32 *valp ATTRIBUTE_UNUSED) static int OperandSem_opnd_sem_AR_4_encode (uint32 *valp) { - int error; - error = (*valp >= 32); - return error; + return (*valp >= 32); } static int diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index ae0feb0254..df0e7ba63d 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1271,11 +1271,8 @@ XtensaOpcodeOps * xtensa_find_opcode_ops(const XtensaOpcodeTranslators *t, const char *name) { - XtensaOpcodeOps *ops; - - ops = bsearch(name, t->opcode, t->num_opcodes, - sizeof(XtensaOpcodeOps), compare_opcode_ops); - return ops; + return bsearch(name, t->opcode, t->num_opcodes, + sizeof(XtensaOpcodeOps), compare_opcode_ops); } static void translate_abs(DisasContext *dc, const uint32_t arg[], diff --git a/tests/m48t59-test.c b/tests/m48t59-test.c index 26af7d6e8e..5b695971c7 100644 --- a/tests/m48t59-test.c +++ b/tests/m48t59-test.c @@ -256,8 +256,6 @@ static void base_setup(void) int main(int argc, char **argv) { - int ret; - base_setup(); g_test_init(&argc, &argv, NULL); @@ -267,7 +265,5 @@ int main(int argc, char **argv) qtest_add_func("/rtc/bcd-check-time", bcd_check_time); } qtest_add_func("/rtc/fuzz-registers", fuzz_registers); - ret = g_test_run(); - - return ret; + return g_test_run(); } diff --git a/tests/test-thread-pool.c b/tests/test-thread-pool.c index 91b4ec5524..9cdccb3a47 100644 --- a/tests/test-thread-pool.c +++ b/tests/test-thread-pool.c @@ -224,8 +224,6 @@ static void test_cancel_async(void) int main(int argc, char **argv) { - int ret; - qemu_init_main_loop(&error_abort); ctx = qemu_get_current_aio_context(); pool = aio_get_thread_pool(ctx); @@ -238,7 +236,5 @@ int main(int argc, char **argv) g_test_add_func("/thread-pool/cancel", test_cancel); g_test_add_func("/thread-pool/cancel-async", test_cancel_async); - ret = g_test_run(); - - return ret; + return g_test_run(); } diff --git a/util/uri.c b/util/uri.c index 93ecefdaaf..8624a7ac23 100644 --- a/util/uri.c +++ b/util/uri.c @@ -1065,10 +1065,7 @@ URI *uri_parse_raw(const char *str, int raw) */ URI *uri_new(void) { - URI *ret; - - ret = g_new0(URI, 1); - return ret; + return g_new0(URI, 1); } /** From patchwork Sun May 20 06:15:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917026 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pX2Z40lCz9s4V for ; Sun, 20 May 2018 16:25:09 +1000 (AEST) Received: from localhost ([::1]:45305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHmF-0007wv-DC for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:25:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlW-0007my-Qz for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHlT-0008Jq-UQ for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:45661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlT-0008JL-JL; Sun, 20 May 2018 02:24:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E9D8841129; Sun, 20 May 2018 09:24:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id ACFF210C7; Sun, 20 May 2018 09:15:13 +0300 (MSK) Received: (nullmailer pid 7399 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:15:01 +0300 Message-Id: <54be4c42b2796ca6054cd1539d3ad4486447c789.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 15/22] hw/timer/mt48t59: Fix bit-rotten NVRAM_PRINTF format strings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Thomas Huth , Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth When compiling with NVRAM_PRINTF enabled, gcc currently bails out with: CC hw/timer/m48t59.o CC hw/timer/m48t59-isa.o hw/timer/m48t59.c: In function ‘NVRAM_writeb’: hw/timer/m48t59.c:460:5: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘hwaddr’ [-Werror=format=] NVRAM_PRINTF("%s: 0x%08x => 0x%08x\n", __func__, addr, val); ^ hw/timer/m48t59.c:460:5: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘uint64_t’ [-Werror=format=] hw/timer/m48t59.c: In function ‘NVRAM_readb’: hw/timer/m48t59.c:492:5: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘hwaddr’ [-Werror=format=] NVRAM_PRINTF("%s: 0x%08x <= 0x%08x\n", __func__, addr, retval); Fix it by using the correct format strings and while we're at it, also change the definition of NVRAM_PRINTF so that this can not bit-rot so easily again. Signed-off-by: Thomas Huth Reviewed-by: Mark Cave-Ayland Signed-off-by: Michael Tokarev --- hw/timer/m48t59-internal.h | 9 +++------ hw/timer/m48t59.c | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/hw/timer/m48t59-internal.h b/hw/timer/m48t59-internal.h index 32ae957805..d0f0caf3c7 100644 --- a/hw/timer/m48t59-internal.h +++ b/hw/timer/m48t59-internal.h @@ -25,13 +25,10 @@ #ifndef HW_M48T59_INTERNAL_H #define HW_M48T59_INTERNAL_H 1 -//#define DEBUG_NVRAM +#define M48T59_DEBUG 0 -#if defined(DEBUG_NVRAM) -#define NVRAM_PRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0) -#else -#define NVRAM_PRINTF(fmt, ...) do { } while (0) -#endif +#define NVRAM_PRINTF(fmt, ...) do { \ + if (M48T59_DEBUG) { printf(fmt , ## __VA_ARGS__); } } while (0) /* * The M48T02, M48T08 and M48T59 chips are very similar. The newer '59 has diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c index 742c576443..f2991762ab 100644 --- a/hw/timer/m48t59.c +++ b/hw/timer/m48t59.c @@ -456,7 +456,7 @@ static void NVRAM_writeb(void *opaque, hwaddr addr, uint64_t val, { M48t59State *NVRAM = opaque; - NVRAM_PRINTF("%s: 0x%08x => 0x%08x\n", __func__, addr, val); + NVRAM_PRINTF("%s: 0x%"HWADDR_PRIx" => 0x%"PRIx64"\n", __func__, addr, val); switch (addr) { case 0: NVRAM->addr &= ~0x00FF; @@ -488,7 +488,7 @@ static uint64_t NVRAM_readb(void *opaque, hwaddr addr, unsigned size) retval = -1; break; } - NVRAM_PRINTF("%s: 0x%08x <= 0x%08x\n", __func__, addr, retval); + NVRAM_PRINTF("%s: 0x%"HWADDR_PRIx" <= 0x%08x\n", __func__, addr, retval); return retval; } From patchwork Sun May 20 06:15:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXKb4HWwz9s4b for ; Sun, 20 May 2018 16:38:11 +1000 (AEST) Received: from localhost ([::1]:45359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHyr-00016U-9m for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:38:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHvG-000633-8w for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHvA-0002tk-4P for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:23 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:42813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHv9-0002t9-Sd; Sun, 20 May 2018 02:34:20 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id DDDAB410E4; Sun, 20 May 2018 09:34:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id BDB6E10C9; Sun, 20 May 2018 09:15:13 +0300 (MSK) Received: (nullmailer pid 7402 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:15:02 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 16/22] qemu-options: Allow -no-user-config again X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michal Privoznik , Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Michal Privoznik After 1217d6ca2bf28c0febe1bd7d5b3fa912bbf6af2a we error out explicitly if an unknown -option was passed on the command line. However, we are doing two pass command line option parsing. In the first pass we just look for -no-user-config or -nodefconfig being present which determines whether we load user config or not. Then in the second pass we finally parse everything else throwing an error if an unsupported -option was found. Problem is that in the second pass -no-user-config and -nodefconfig are not handled explicitly which makes us throw the unsupported option error. Signed-off-by: Michal Privoznik Reviewed-by: Thomas Huth Reviewed-by: Marc-André Lureau Signed-off-by: Michael Tokarev --- vl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vl.c b/vl.c index 3b39bbd7a8..d5836c65ae 100644 --- a/vl.c +++ b/vl.c @@ -4011,6 +4011,10 @@ int main(int argc, char **argv, char **envp) exit(1); } break; + case QEMU_OPTION_nodefconfig: + case QEMU_OPTION_nouserconfig: + /* Nothing to be parsed here. Especially, do not error out below. */ + break; default: if (os_parse_cmd_args(popt->index, optarg)) { error_report("Option not supported in this build"); From patchwork Sun May 20 06:15:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917027 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pX5F4LbFz9s4b for ; Sun, 20 May 2018 16:27:29 +1000 (AEST) Received: from localhost ([::1]:45321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHoV-0002De-3m for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:27:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlW-0007mx-Qp for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHlU-0008KB-Ck for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:47913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlU-0008Jn-5t; Sun, 20 May 2018 02:24:20 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 015664112C; Sun, 20 May 2018 09:24:19 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id B22611076; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: (nullmailer pid 7405 invoked by uid 1000); Sun, 20 May 2018 06:15:11 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:15:03 +0300 Message-Id: <201376cb9e500f64209444cb95f566679c0f54a2.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 17/22] typedefs: Remove PcGuestInfo from qemu/typedefs.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , =?utf-8?q?P?= =?utf-8?q?hilippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé It is long gone since e4e8ba04c2007 ... Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- include/qemu/typedefs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index a46b0b347b..325c72de33 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -62,7 +62,6 @@ typedef struct NetClientState NetClientState; typedef struct NetFilterState NetFilterState; typedef struct NICInfo NICInfo; typedef struct NumaNodeMem NumaNodeMem; -typedef struct PcGuestInfo PcGuestInfo; typedef struct PCIBridge PCIBridge; typedef struct PCIBus PCIBus; typedef struct PCIDevice PCIDevice; From patchwork Sun May 20 06:15:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917068 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXmc0sR0z9s3M for ; Sun, 20 May 2018 16:58:08 +1000 (AEST) Received: from localhost ([::1]:45416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKII9-0002tF-Oe for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:58:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIEY-0007pF-KF for qemu-devel@nongnu.org; Sun, 20 May 2018 02:54:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKIEV-0002KG-K0 for qemu-devel@nongnu.org; Sun, 20 May 2018 02:54:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:45493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIEV-0002Jj-CL; Sun, 20 May 2018 02:54:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3EBFB41129; Sun, 20 May 2018 09:54:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id EEBF510B4; Sun, 20 May 2018 09:15:12 +0300 (MSK) Received: (nullmailer pid 7408 invoked by uid 1000); Sun, 20 May 2018 06:15:12 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:15:04 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 18/22] replace functions which are only available in glib-2.24 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Olaf Hering , Michael Tokarev , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Olaf Hering Currently the minimal supported version of glib is 2.22. Since testing is done with a glib that claims to be 2.22, but in fact has APIs from newer version of glib, this bug was not caught during submit of the patch referenced below. Replace g_realloc_n, which is available only since 2.24, with g_renew. Fixes commit 418026ca43 ("util: Introduce vfio helpers") Signed-off-by: Olaf Hering Reviewed-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Michael Tokarev CC: qemu-stable@nongnu.org --- util/vfio-helpers.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c index 006674c916..1d9272efa4 100644 --- a/util/vfio-helpers.c +++ b/util/vfio-helpers.c @@ -522,8 +522,7 @@ static IOVAMapping *qemu_vfio_add_mapping(QEMUVFIOState *s, assert(index >= 0); s->nr_mappings++; - s->mappings = g_realloc_n(s->mappings, sizeof(s->mappings[0]), - s->nr_mappings); + s->mappings = g_renew(IOVAMapping, s->mappings, s->nr_mappings); insert = &s->mappings[index]; shift = s->nr_mappings - index - 1; if (shift) { @@ -577,8 +576,7 @@ static void qemu_vfio_undo_mapping(QEMUVFIOState *s, IOVAMapping *mapping, memmove(mapping, &s->mappings[index + 1], sizeof(s->mappings[0]) * (s->nr_mappings - index - 1)); s->nr_mappings--; - s->mappings = g_realloc_n(s->mappings, sizeof(s->mappings[0]), - s->nr_mappings); + s->mappings = g_renew(IOVAMapping, s->mappings, s->nr_mappings); } /* Check if the mapping list is (ascending) ordered. */ From patchwork Sun May 20 06:15:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917064 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXjG2wJsz9s4b for ; Sun, 20 May 2018 16:55:13 +1000 (AEST) Received: from localhost ([::1]:45401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIFL-00082c-1A for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:55:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIEY-0007pH-KG for qemu-devel@nongnu.org; Sun, 20 May 2018 02:54:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKIEV-0002KB-JH for qemu-devel@nongnu.org; Sun, 20 May 2018 02:54:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:60971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKIEV-0002Je-BB; Sun, 20 May 2018 02:54:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 4A66E4112D; Sun, 20 May 2018 09:54:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 1F9C310CD; Sun, 20 May 2018 09:15:14 +0300 (MSK) Received: (nullmailer pid 7410 invoked by uid 1000); Sun, 20 May 2018 06:15:12 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:15:05 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 19/22] gdbstub: Use qemu_set_cloexec() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell Use the utility routine qemu_set_cloexec() rather than manually calling fcntl(). This lets us drop the #ifndef _WIN32 guards and also means Coverity doesn't complain that we're ignoring the fcntl error return (CID 1005665, CID 1005667). Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- gdbstub.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 9682e16ef7..b99980d2e2 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1828,9 +1828,7 @@ static void gdb_accept(void) perror("accept"); return; } else if (fd >= 0) { -#ifndef _WIN32 - fcntl(fd, F_SETFD, FD_CLOEXEC); -#endif + qemu_set_cloexec(fd); break; } } @@ -1857,9 +1855,7 @@ static int gdbserver_open(int port) perror("socket"); return -1; } -#ifndef _WIN32 - fcntl(fd, F_SETFD, FD_CLOEXEC); -#endif + qemu_set_cloexec(fd); socket_set_fast_reuse(fd); From patchwork Sun May 20 06:15:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917029 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pX5G6Ly6z9s4b for ; Sun, 20 May 2018 16:27:30 +1000 (AEST) Received: from localhost ([::1]:45323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHoW-0002F9-DG for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:27:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlW-0007n5-RP for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHlT-0008JR-Mj for qemu-devel@nongnu.org; Sun, 20 May 2018 02:24:22 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:51493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHlT-0008JB-EO; Sun, 20 May 2018 02:24:19 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id B630B4111D; Sun, 20 May 2018 09:24:18 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id DC79610CB; Sun, 20 May 2018 09:15:13 +0300 (MSK) Received: (nullmailer pid 7412 invoked by uid 1000); Sun, 20 May 2018 06:15:12 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:15:06 +0300 Message-Id: <2f652224f76c115f6c991766b7acac1e22580954.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 20/22] gdbstub: Handle errors in gdb_accept() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell In gdb_accept(), we both fail to check all errors (notably that from socket_set_nodelay(), as Coverity notes in CID 1005666), and fail to return an error status back to our caller. Correct both of these things, so that errors in accept() result in our stopping with a useful error message rather than ignoring it. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Signed-off-by: Michael Tokarev --- gdbstub.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index b99980d2e2..e4ece2f5bc 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1814,7 +1814,7 @@ void gdb_signalled(CPUArchState *env, int sig) put_packet(s, buf); } -static void gdb_accept(void) +static bool gdb_accept(void) { GDBState *s; struct sockaddr_in sockaddr; @@ -1826,7 +1826,7 @@ static void gdb_accept(void) fd = accept(gdbserver_fd, (struct sockaddr *)&sockaddr, &len); if (fd < 0 && errno != EINTR) { perror("accept"); - return; + return false; } else if (fd >= 0) { qemu_set_cloexec(fd); break; @@ -1834,7 +1834,10 @@ static void gdb_accept(void) } /* set short latency */ - socket_set_nodelay(fd); + if (socket_set_nodelay(fd)) { + perror("setsockopt"); + return false; + } s = g_malloc0(sizeof(GDBState)); s->c_cpu = first_cpu; @@ -1843,6 +1846,7 @@ static void gdb_accept(void) gdb_has_xml = false; gdbserver_state = s; + return true; } static int gdbserver_open(int port) @@ -1883,7 +1887,11 @@ int gdbserver_start(int port) if (gdbserver_fd < 0) return -1; /* accept connections */ - gdb_accept(); + if (!gdb_accept()) { + close(gdbserver_fd); + gdbserver_fd = -1; + return -1; + } return 0; } From patchwork Sun May 20 06:15:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXGG1q56z9s4V for ; Sun, 20 May 2018 16:35:16 +1000 (AEST) Received: from localhost ([::1]:45341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHvz-00062s-7F for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:35:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHvD-00060B-9d for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHvA-0002tV-3W for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:23 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:51299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHv9-0002t6-SR; Sun, 20 May 2018 02:34:20 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 085294111E; Sun, 20 May 2018 09:34:19 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 0562410CC; Sun, 20 May 2018 09:15:14 +0300 (MSK) Received: (nullmailer pid 7414 invoked by uid 1000); Sun, 20 May 2018 06:15:12 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:15:07 +0300 Message-Id: <4088b5536436090207dcf6d15e47908f74b2d8f2.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 21/22] qapi/net.json: Fix the version number of the "vlan" removal X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Thomas Huth , Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth "vlan" will be dropped in 2.13, not in 2.12. And while we're at it, use the better wording "dropped in" instead of "removed with" (also for the "dump" removal). Reported-by: Stefan Hajnoczi Reported-by: Eric Blake Signed-off-by: Thomas Huth Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- qapi/net.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/net.json b/qapi/net.json index b4fe4b660b..b8adf1f03f 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -450,7 +450,7 @@ # # Since: 2.7 # -# 'dump' - removed with 2.12 +# 'dump': dropped in 2.12 ## { 'enum': 'NetClientDriver', 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', @@ -498,7 +498,7 @@ # # Since: 1.2 # -# 'vlan' - removed with 2.12 +# 'vlan': dropped in 2.13 ## { 'struct': 'NetLegacy', 'data': { From patchwork Sun May 20 06:15:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 917046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tls.msk.ru Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40pXKc28S2z9s3X for ; Sun, 20 May 2018 16:38:12 +1000 (AEST) Received: from localhost ([::1]:45361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHys-000189-28 for incoming@patchwork.ozlabs.org; Sun, 20 May 2018 02:38:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHvG-000635-92 for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKHvA-0002uH-RB for qemu-devel@nongnu.org; Sun, 20 May 2018 02:34:23 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:48651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKHvA-0002ty-Jt; Sun, 20 May 2018 02:34:20 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 1A4714112C; Sun, 20 May 2018 09:34:19 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 400FF10C2; Sun, 20 May 2018 09:15:13 +0300 (MSK) Received: (nullmailer pid 7416 invoked by uid 1000); Sun, 20 May 2018 06:15:12 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Sun, 20 May 2018 09:15:08 +0300 Message-Id: <9a232487aab8a7640ff8853d7d8d7c27106b44f8.1526796813.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 22/22] acpi: fix a comment about aml_call0() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Michael Tokarev Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Michael Tokarev --- hw/acpi/aml-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 3fa557cea1..1e43cd736d 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -627,7 +627,7 @@ Aml *aml_notify(Aml *arg1, Aml *arg2) return var; } -/* helper to call method with 1 argument */ +/* helper to call method without argument */ Aml *aml_call0(const char *method) { Aml *var = aml_alloc();