From patchwork Wed Nov 25 01:45:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yutao Ai X-Patchwork-Id: 1405793 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; 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=huawei.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cgkcf2yNVz9sRK for ; Wed, 25 Nov 2020 13:00:34 +1100 (AEDT) Received: from localhost ([::1]:53392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khk6i-0001Tx-EB for incoming@patchwork.ozlabs.org; Tue, 24 Nov 2020 21:00:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khk43-0007nr-OI for qemu-devel@nongnu.org; Tue, 24 Nov 2020 20:57:47 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2866) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khk41-0007OX-37 for qemu-devel@nongnu.org; Tue, 24 Nov 2020 20:57:47 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CgkXg20wPz15Rgf; Wed, 25 Nov 2020 09:57:07 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 25 Nov 2020 09:57:21 +0800 From: Yutao Ai To: , Subject: [PATCH 1/3] monitor:open brace '{' following struct go on the same line Date: Wed, 25 Nov 2020 01:45:12 +0000 Message-ID: <20201125014514.55562-2-aiyutao@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20201125014514.55562-1-aiyutao@huawei.com> References: <20201125014514.55562-1-aiyutao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.190; envelope-from=aiyutao@huawei.com; helo=szxga04-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.chen@huawei.com, aiyutao@huawei.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Move the open brace '{' following struct go on the same line Signed-off-by: Yutao Ai --- monitor/hmp-cmds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 8d7f5fee7e..64188c9fa2 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1548,8 +1548,7 @@ end: hmp_handle_error(mon, err); } -typedef struct HMPMigrationStatus -{ +typedef struct HMPMigrationStatus { QEMUTimer *timer; Monitor *mon; bool is_block_migration; From patchwork Wed Nov 25 01:45:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yutao Ai X-Patchwork-Id: 1405792 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; 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=huawei.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CgkZX3P32z9sVD for ; Wed, 25 Nov 2020 12:58:42 +1100 (AEDT) Received: from localhost ([::1]:48614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khk4t-0007ou-0r for incoming@patchwork.ozlabs.org; Tue, 24 Nov 2020 20:58:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khk44-0007o8-VU for qemu-devel@nongnu.org; Tue, 24 Nov 2020 20:57:49 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:2099) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khk41-0007P9-3n for qemu-devel@nongnu.org; Tue, 24 Nov 2020 20:57:48 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4CgkXs2Vl5zhYm4; Wed, 25 Nov 2020 09:57:17 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 25 Nov 2020 09:57:22 +0800 From: Yutao Ai To: , Subject: [PATCH 2/3] monitor:braces {} are necessary for all arms of this statement Date: Wed, 25 Nov 2020 01:45:13 +0000 Message-ID: <20201125014514.55562-3-aiyutao@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20201125014514.55562-1-aiyutao@huawei.com> References: <20201125014514.55562-1-aiyutao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.32; envelope-from=aiyutao@huawei.com; helo=szxga06-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.chen@huawei.com, aiyutao@huawei.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Fix the errors by add {} Signed-off-by: Yutao Ai --- monitor/misc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/monitor/misc.c b/monitor/misc.c index 398211a034..7588f12053 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -492,8 +492,10 @@ static void hmp_singlestep(Monitor *mon, const QDict *qdict) static void hmp_gdbserver(Monitor *mon, const QDict *qdict) { const char *device = qdict_get_try_str(qdict, "device"); - if (!device) + if (!device) { device = "tcp::" DEFAULT_GDBSTUB_PORT; + } + if (gdbserver_start(device) < 0) { monitor_printf(mon, "Could not open gdbserver on device '%s'\n", device); @@ -559,10 +561,11 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize, } len = wsize * count; - if (wsize == 1) + if (wsize == 1) { line_size = 8; - else + } else { line_size = 16; + } max_digits = 0; switch(format) { @@ -583,10 +586,11 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize, } while (len > 0) { - if (is_physical) + if (is_physical) { monitor_printf(mon, TARGET_FMT_plx ":", addr); - else + } else { monitor_printf(mon, TARGET_FMT_lx ":", (target_ulong)addr); + } l = len; if (l > line_size) l = line_size; From patchwork Wed Nov 25 01:45:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yutao Ai X-Patchwork-Id: 1405794 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; 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=huawei.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cgkhd02Lhz9sRK for ; Wed, 25 Nov 2020 13:03:58 +1100 (AEDT) Received: from localhost ([::1]:55828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khk9z-0002k7-GN for incoming@patchwork.ozlabs.org; Tue, 24 Nov 2020 21:03:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khk45-0007o9-1m for qemu-devel@nongnu.org; Tue, 24 Nov 2020 20:57:49 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:2100) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khk41-0007PA-3r for qemu-devel@nongnu.org; Tue, 24 Nov 2020 20:57:48 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4CgkXs2ggkzhZrK; Wed, 25 Nov 2020 09:57:17 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Wed, 25 Nov 2020 09:57:22 +0800 From: Yutao Ai To: , Subject: [PATCH 3/3] monitor:Don't use '#' flag of printf format ('%#') in format strings Date: Wed, 25 Nov 2020 01:45:14 +0000 Message-ID: <20201125014514.55562-4-aiyutao@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20201125014514.55562-1-aiyutao@huawei.com> References: <20201125014514.55562-1-aiyutao@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected Received-SPF: pass client-ip=45.249.212.32; envelope-from=aiyutao@huawei.com; helo=szxga06-in.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.chen@huawei.com, aiyutao@huawei.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Delete '#' and use '0x' prefix instead Signed-off-by: Yutao Ai Reviewed-by: Philippe Mathieu-Daudé --- monitor/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/misc.c b/monitor/misc.c index 7588f12053..2eb563f6f3 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -910,7 +910,7 @@ static void hmp_ioport_read(Monitor *mon, const QDict *qdict) suffix = 'l'; break; } - monitor_printf(mon, "port%c[0x%04x] = %#0*x\n", + monitor_printf(mon, "port%c[0x%04x] = 0x%0*x\n", suffix, addr, size * 2, val); }