From nobody Sun May 5 13:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585643057; cv=none; d=zohomail.com; s=zohoarc; b=jTvJAyeTRD+q+UJCZHrBhpFCz7qoSR6V/mV9pYJOoFqPz6Lb+NBra2tntcAt8751XcVV282iDkDG9vGqjhk3Ma3ej6+H0ebO4mfBYzDIMeOs0ktjbJbp9YoHlWKrMwCP4LO+w5fCo3ULVZCVoRR1qxajhFMeep5Lfsg7r41h3/8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585643057; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=NfZUJ6vaLSHFTRaOVgXeRn54igdzyXuN5WiwyyxnEaE=; b=CGTi0kwmOIsnUzIMGsGOxxE6omRUKjob3FG9bEUQgLv27bfPc6g4JPqqIrBy9/5h56Q20aPtcFfcRl3cnEhjMfYtVhTDN5gGhpyv9SE+Jh1Zuw8YPCF2fUtpBCF742713FHw8DZBO2qp4MHuQEY+iB0E/DCYz5ovjzOhXOg1q0U= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585643056031879.7504817700432; Tue, 31 Mar 2020 01:24:16 -0700 (PDT) Received: from localhost ([::1]:33828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJCBy-0005RT-PI for importer@patchew.org; Tue, 31 Mar 2020 04:24:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56482) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJCAZ-0003hN-Tc for qemu-devel@nongnu.org; Tue, 31 Mar 2020 04:22:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJCAY-0001Ht-07 for qemu-devel@nongnu.org; Tue, 31 Mar 2020 04:22:47 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:2593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jJCAW-0001GY-Rl for qemu-devel@nongnu.org; Tue, 31 Mar 2020 04:22:45 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.9]) by rmmx-syy-dmz-app03-12003 (RichMail) with SMTP id 2ee35e82fdbcc33-25d0a; Tue, 31 Mar 2020 16:22:20 +0800 (CST) Received: from localhost.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr05-12005 (RichMail) with SMTP id 2ee55e82fdb5ba9-276a2; Tue, 31 Mar 2020 16:22:19 +0800 (CST) X-RM-TRANSID: 2ee35e82fdbcc33-25d0a X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee55e82fdb5ba9-276a2 From: Mao Zhongyi To: qemu-devel@nongnu.org Subject: [PATCH v2 1/3] migration/migration: improve error reporting for migrate parameters Date: Tue, 31 Mar 2020 16:22:05 +0800 Message-Id: <4ce71da4a5f98ad6ead0806ec71043473dcb4c07.1585641083.git.maozhongyi@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 221.176.66.79 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: dgilbert@redhat.com, Mao Zhongyi , quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" use QERR_INVALID_PARAMETER_VALUE instead of "Parameter '%s' expects" for consistency. Signed-off-by: Mao Zhongyi Reviewed-by: Juan Quintela --- migration/migration.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 2b7b5bccfa..5a6436d035 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1202,16 +1202,19 @@ static bool migrate_params_check(MigrationParameter= s *params, Error **errp) } =20 if (params->has_max_bandwidth && (params->max_bandwidth > SIZE_MAX)) { - error_setg(errp, "Parameter 'max_bandwidth' expects an integer in = the" - " range of 0 to %zu bytes/second", SIZE_MAX); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + "max_bandwidth", + "an integer in the range of 0 to "stringify(SIZE_MAX) + " bytes/second"); return false; } =20 if (params->has_downtime_limit && (params->downtime_limit > MAX_MIGRATE_DOWNTIME)) { - error_setg(errp, "Parameter 'downtime_limit' expects an integer in= " - "the range of 0 to %d milliseconds", - MAX_MIGRATE_DOWNTIME); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + "downtime_limit", + "an integer in the range of 0 to " + stringify(MAX_MIGRATE_DOWNTIME)" milliseconds"); return false; } =20 @@ -2108,9 +2111,10 @@ void qmp_migrate_set_speed(int64_t value, Error **er= rp) void qmp_migrate_set_downtime(double value, Error **errp) { if (value < 0 || value > MAX_MIGRATE_DOWNTIME_SECONDS) { - error_setg(errp, "Parameter 'downtime_limit' expects an integer in= " - "the range of 0 to %d seconds", - MAX_MIGRATE_DOWNTIME_SECONDS); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, + "downtime_limit", + "an integer in the range of 0 to " + stringify(MAX_MIGRATE_DOWNTIME_SECONDS)" seconds"); return; } =20 --=20 2.17.1 From nobody Sun May 5 13:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585643110; cv=none; d=zohomail.com; s=zohoarc; b=Yn41gGX2hUiq0Qs5AyA398TimqJavvFo9bDR0t1yMXgpjelWWdmghZjdx25O15AiCqzIgNI5lPPKq58gMd/kDj2h0oqSARW1vDl1CThRHojatnuFX8of/EKp2eM1H1iFSU0yaeyg4Hk6nKRRwBp/Dcpl0CGXivjb5oWxG5FYcNA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585643110; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=9OpiKZ5PSRqPc3NU6EAmgKiEvLUjsVA+GysHR8IxuKA=; b=VsrnG24gQSV1HrfEsYcssSwHdCrxFsFSL8m8NKtyeKFvZ1JSEfBPqEOKK7R5CyUwdmi8ISunZPs9XT8eEV0tz5le6gJ/Dw0SQp4FQH0RuT6SQ3E713W3TAzELjiZGeYlT1kMW/rQEH1/I0+QO69GcM95sTi82irHVE8eX14cVqY= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585643110432582.5396972675094; Tue, 31 Mar 2020 01:25:10 -0700 (PDT) Received: from localhost ([::1]:33862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJCCr-0007pH-6R for importer@patchew.org; Tue, 31 Mar 2020 04:25:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56459) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJCAS-0003fK-U6 for qemu-devel@nongnu.org; Tue, 31 Mar 2020 04:22:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJCAQ-0001DR-Qv for qemu-devel@nongnu.org; Tue, 31 Mar 2020 04:22:40 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:3974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jJCAQ-000196-7t for qemu-devel@nongnu.org; Tue, 31 Mar 2020 04:22:38 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.9]) by rmmx-syy-dmz-app01-12001 (RichMail) with SMTP id 2ee15e82fdbccc1-25ba3; Tue, 31 Mar 2020 16:22:20 +0800 (CST) Received: from localhost.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr05-12005 (RichMail) with SMTP id 2ee55e82fdb5ba9-276a6; Tue, 31 Mar 2020 16:22:20 +0800 (CST) X-RM-TRANSID: 2ee15e82fdbccc1-25ba3 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee55e82fdb5ba9-276a6 From: Mao Zhongyi To: qemu-devel@nongnu.org Subject: [PATCH v2 2/3] monitor/hmp-cmds: add hmp_handle_error() for hmp_migrate_set_speed() Date: Tue, 31 Mar 2020 16:22:06 +0800 Message-Id: <305323f835436023c53d759f5ab18af3ec874183.1585641083.git.maozhongyi@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 221.176.66.79 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: dgilbert@redhat.com, Mao Zhongyi , quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mao Zhongyi Reviewed-by: Juan Quintela --- monitor/hmp-cmds.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 790fad3afe..63097ddcc8 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1203,8 +1203,11 @@ void hmp_migrate_set_cache_size(Monitor *mon, const = QDict *qdict) /* Kept for backwards compatibility */ void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict) { + Error *err =3D NULL; + int64_t value =3D qdict_get_int(qdict, "value"); - qmp_migrate_set_speed(value, NULL); + qmp_migrate_set_speed(value, &err); + hmp_handle_error(mon, err); } =20 void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict) --=20 2.17.1 From nobody Sun May 5 13:14:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1585643055; cv=none; d=zohomail.com; s=zohoarc; b=Mn7zY+gPDbpt23gXy3uF0LzfiiWZVE0X5SAtyJzQk9P2CibQXB3zkCt7bT54Nif4+4QS1KxfYXeQAKGopvU0wrDHhk6DWcAE+48CWR0tt6jwoH4/9bsm3itTtZY23KXjS3Qe3Ju3+4rkAnwnvD/PzicoiWiVuih7oeQqgvzieyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585643055; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=gNzkTXH1wO7DikQyk6qQNLURX4qpsgZst+RiVzt26Ao=; b=NxZ7S8JZuAwnzuIRTux8MSZ/2Z83c0QlV9KUJGHX4BROoekEatmTONjdq/3FIQrrjUimMqkuI16AFuJ+YwB8mIhu/tpLHFuAkLarhd3EE3O3aRKxOoY+VKg/XH3XhkRBeMIVlXfOoUt7NqWSZObUDgtz+0PSIX8yK7NvYHyuf28= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1585643054566491.0583735850213; Tue, 31 Mar 2020 01:24:14 -0700 (PDT) Received: from localhost ([::1]:33824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJCBx-0005O0-5Y for importer@patchew.org; Tue, 31 Mar 2020 04:24:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56469) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJCAT-0003gA-Iz for qemu-devel@nongnu.org; Tue, 31 Mar 2020 04:22:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJCAR-0001EB-WA for qemu-devel@nongnu.org; Tue, 31 Mar 2020 04:22:41 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:4969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jJCAQ-00019W-7r for qemu-devel@nongnu.org; Tue, 31 Mar 2020 04:22:39 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.9]) by rmmx-syy-dmz-app09-12009 (RichMail) with SMTP id 2ee95e82fdbda0e-25970; Tue, 31 Mar 2020 16:22:21 +0800 (CST) Received: from localhost.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr05-12005 (RichMail) with SMTP id 2ee55e82fdb5ba9-276ae; Tue, 31 Mar 2020 16:22:21 +0800 (CST) X-RM-TRANSID: 2ee95e82fdbda0e-25970 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee55e82fdb5ba9-276ae From: Mao Zhongyi To: qemu-devel@nongnu.org Subject: [PATCH v2 3/3] migration: move the units of migrate parameters from milliseconds to ms Date: Tue, 31 Mar 2020 16:22:07 +0800 Message-Id: <474bb6cf67defb8be9de5035c11aee57a680557a.1585641083.git.maozhongyi@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 221.176.66.81 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: dgilbert@redhat.com, Mao Zhongyi , quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Mao Zhongyi Reviewed-by: Juan Quintela Reviewed-by: Stefano Garzarella --- migration/migration.c | 2 +- monitor/hmp-cmds.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 5a6436d035..b3d36d1467 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1214,7 +1214,7 @@ static bool migrate_params_check(MigrationParameters = *params, Error **errp) error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "downtime_limit", "an integer in the range of 0 to " - stringify(MAX_MIGRATE_DOWNTIME)" milliseconds"); + stringify(MAX_MIGRATE_DOWNTIME)" ms"); return false; } =20 diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 63097ddcc8..c5de8af1ee 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -231,18 +231,18 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdic= t) monitor_printf(mon, "\n"); } =20 - monitor_printf(mon, "total time: %" PRIu64 " milliseconds\n", + monitor_printf(mon, "total time: %" PRIu64 " ms\n", info->total_time); if (info->has_expected_downtime) { - monitor_printf(mon, "expected downtime: %" PRIu64 " millisecon= ds\n", + monitor_printf(mon, "expected downtime: %" PRIu64 " ms\n", info->expected_downtime); } if (info->has_downtime) { - monitor_printf(mon, "downtime: %" PRIu64 " milliseconds\n", + monitor_printf(mon, "downtime: %" PRIu64 " ms\n", info->downtime); } if (info->has_setup_time) { - monitor_printf(mon, "setup: %" PRIu64 " milliseconds\n", + monitor_printf(mon, "setup: %" PRIu64 " ms\n", info->setup_time); } } --=20 2.17.1