From nobody Thu May 2 04:20:39 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=1585458260; cv=none; d=zohomail.com; s=zohoarc; b=cVXmMwNcPOAMKhVBcPncn7fJeGlkKVEAokQ7m7jg8YfUjPq6tL+/Gn55yF0IwrMy/+CPLLN1I/+b1qGCoeNOsenqdJ3ULYjCSjmhhixvUO7aJN5xzH7NUt34qzs4MzaZ6BXubb8Nm+/owDRph3Ds32o+0/pvA5+AfcD9u+qeCk4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585458260; 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=pOyUoSlwuXRVZ2UxNpQYGWbicn9Q5q0O8mcFyAWRhJs=; b=Nu8vccx1vV5Ol87GnkSKVkCc78qZlREAfqHRWZ/w3pugxZia0HKwO4+zK9UvoijsYJvYHRufSYZorue7mMVMfgoAzbydYEETs7lsxA9iG2+rUKfvRDzPYmRqj7Iwn6hLB0VqN3DRjWcHLxSmkWskwK2jjMHq2kyGPVEsFt10Kf8= 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 1585458260451119.42151736377468; Sat, 28 Mar 2020 22:04:20 -0700 (PDT) Received: from localhost ([::1]:34318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIQ7P-0002Gh-8M for importer@patchew.org; Sun, 29 Mar 2020 01:04:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41643) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIQ5M-00086C-5o for qemu-devel@nongnu.org; Sun, 29 Mar 2020 01:02:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIQ5K-0005UV-QD for qemu-devel@nongnu.org; Sun, 29 Mar 2020 01:02:11 -0400 Received: from cmccmta3.chinamobile.com ([221.176.66.81]:48246) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jIQ5K-0005K9-5V for qemu-devel@nongnu.org; Sun, 29 Mar 2020 01:02:10 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app12-12012 (RichMail) with SMTP id 2eec5e802bb9d4a-f3cb7; Sun, 29 Mar 2020 13:01:45 +0800 (CST) Received: from maozy-host.localdomain (unknown[117.136.46.37]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee65e802baee64-267c4; Sun, 29 Mar 2020 13:01:45 +0800 (CST) X-RM-TRANSID: 2eec5e802bb9d4a-f3cb7 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee65e802baee64-267c4 From: Mao Zhongyi To: qemu-devel@nongnu.org Subject: [PATCH 1/3] migration/migration: improve error reporting for migrate parameters Date: Sun, 29 Mar 2020 13:01:29 +0800 Message-Id: <20200329050131.26864-2-maozhongyi@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200329050131.26864-1-maozhongyi@cmss.chinamobile.com> References: <20200329050131.26864-1-maozhongyi@cmss.chinamobile.com> 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" use QERR_INVALID_PARAMETER_VALUE instead of "Parameter '%s' expects" for consistency. Signed-off-by: Mao Zhongyi --- migration/migration.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 2b7b5bccfa..e0223f3b15 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1202,16 +1202,17 @@ 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 '2^64 - 1' bytes/secon= d"); 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 2000000 milliseconds"); return false; } =20 @@ -2108,9 +2109,9 @@ void qmp_migrate_set_speed(int64_t value, Error **err= p) 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 2000 seconds"); return; } =20 --=20 2.17.1 From nobody Thu May 2 04:20:39 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=1585458263; cv=none; d=zohomail.com; s=zohoarc; b=gc3puBSv7sQfgF7fU2/UPFoxakFP4gunPWT9L5KhTC1N+6hYuzvLdimsjf3Co4HU+7FWgBeRBwx0mAqS8Fl2DG/9tT0RMa0Zrynm2hEV/5eFe+ozXEobwHaTFrqhGOWiySm0EFqJakDerY1K9kS18ifVBJJwZQhS8kg/dLxSssY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585458263; 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=VX6t+VuM3ft4DUkDmr5PRqwDfIUfNugQyK41bwlntUI=; b=DpYHYL8E/V6PYsWf2PWLZEJOW1sm3iiprwq5RdvFxtJeBU3QlRv6Jw0nbx9/dFER5qaZeP5j2JFnKeXsi20tdn83laA8easbvFgc4hd9k3qX0DRSRd4HBm3yp0idui00jSr/DPOXbnMHAQ6wUHva8xY7jtzaeqtHykbpD3WDHwQ= 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 1585458263549232.06719346103023; Sat, 28 Mar 2020 22:04:23 -0700 (PDT) Received: from localhost ([::1]:34320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIQ7S-0002Ld-B3 for importer@patchew.org; Sun, 29 Mar 2020 01:04:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41669) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIQ5N-00086P-JT for qemu-devel@nongnu.org; Sun, 29 Mar 2020 01:02:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIQ5M-0005Vz-Jx for qemu-devel@nongnu.org; Sun, 29 Mar 2020 01:02:13 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:7098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jIQ5M-0005H9-1k for qemu-devel@nongnu.org; Sun, 29 Mar 2020 01:02:12 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app04-12004 (RichMail) with SMTP id 2ee45e802bb9d22-f3ce7; Sun, 29 Mar 2020 13:01:46 +0800 (CST) Received: from maozy-host.localdomain (unknown[117.136.46.37]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee65e802baee64-267ca; Sun, 29 Mar 2020 13:01:46 +0800 (CST) X-RM-TRANSID: 2ee45e802bb9d22-f3ce7 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee65e802baee64-267ca From: Mao Zhongyi To: qemu-devel@nongnu.org Subject: [PATCH 2/3] monitor/hmp-cmds: add hmp_handle_error() for hmp_migrate_set_speed() Date: Sun, 29 Mar 2020 13:01:30 +0800 Message-Id: <20200329050131.26864-3-maozhongyi@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200329050131.26864-1-maozhongyi@cmss.chinamobile.com> References: <20200329050131.26864-1-maozhongyi@cmss.chinamobile.com> 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 Thu May 2 04:20:39 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=1585458197; cv=none; d=zohomail.com; s=zohoarc; b=Z+x0BBuMVIL80Smz7BHXN9yjbPVrZEmaYCSD4krDoL89P5A6yJuafN1Os5jPB+slmgMTS4mXrXle7gbFGnFiAQd/32HIESe1AYM0TbRtUfJJ8E5ypSh+y7c+sAtuFRAUhh0rXdcj/Sp1730uCOtetqw5OxFtzT+5qZSAFTrofl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585458197; 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=f4216cfeGsP8p3o3KvHUYLqSHKwKRVV1kvj3GsAMB2I=; b=LYCEVOb/12F2y+QKlaPX72VbgZy9UHfp7pIhwxUEpJic76u1rYIOga0WA1w+2DWOrdmDyr0md3yPV/WMi7+YdxMrzz5dwdvL2qGzH63mnwd6ABkkZanQ0luHx0SdncSqgVb90yrf+A9wVfAB7n5FC9X/OmFswdf+nIfvySZIJ3M= 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 1585458197086726.5446453938697; Sat, 28 Mar 2020 22:03:17 -0700 (PDT) Received: from localhost ([::1]:34308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIQ6N-0000Vs-LV for importer@patchew.org; Sun, 29 Mar 2020 01:03:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41680) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIQ5P-00086Y-42 for qemu-devel@nongnu.org; Sun, 29 Mar 2020 01:02:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIQ5O-0005Ww-4K for qemu-devel@nongnu.org; Sun, 29 Mar 2020 01:02:15 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:10348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1jIQ5N-000597-Gt for qemu-devel@nongnu.org; Sun, 29 Mar 2020 01:02:14 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app06-12006 (RichMail) with SMTP id 2ee65e802bb9ab4-f3939; Sun, 29 Mar 2020 13:01:47 +0800 (CST) Received: from maozy-host.localdomain (unknown[117.136.46.37]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee65e802baee64-267d2; Sun, 29 Mar 2020 13:01:46 +0800 (CST) X-RM-TRANSID: 2ee65e802bb9ab4-f3939 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee65e802baee64-267d2 From: Mao Zhongyi To: qemu-devel@nongnu.org Subject: [PATCH 3/3] migration: move the units of migrate parameters from milliseconds to ms. Date: Sun, 29 Mar 2020 13:01:31 +0800 Message-Id: <20200329050131.26864-4-maozhongyi@cmss.chinamobile.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200329050131.26864-1-maozhongyi@cmss.chinamobile.com> References: <20200329050131.26864-1-maozhongyi@cmss.chinamobile.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 221.176.66.80 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 Suggested-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela --- 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 e0223f3b15..d014da388a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1212,7 +1212,7 @@ static bool migrate_params_check(MigrationParameters = *params, Error **errp) (params->downtime_limit > MAX_MIGRATE_DOWNTIME)) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "downtime_limit", - "an integer in the range of 0 to 2000000 milliseconds"); + "an integer in the range of 0 to 2000000 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