From nobody Tue Feb 10 07:22:56 2026 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