From nobody Fri Apr 19 04:50:05 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 148760867944286.98817920525437; Mon, 20 Feb 2017 08:37:59 -0800 (PST) Received: from localhost ([::1]:39687 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfqyL-00028a-0l for importer@patchew.org; Mon, 20 Feb 2017 11:37:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfqRM-0006O6-Ia for qemu-devel@nongnu.org; Mon, 20 Feb 2017 11:03:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfqRH-0004ys-Iu for qemu-devel@nongnu.org; Mon, 20 Feb 2017 11:03:52 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cfqRH-0004yM-9i for qemu-devel@nongnu.org; Mon, 20 Feb 2017 11:03:47 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1KFdOPn141450 for ; Mon, 20 Feb 2017 11:03:45 -0500 Received: from e24smtp01.br.ibm.com (e24smtp01.br.ibm.com [32.104.18.85]) by mx0a-001b2d01.pphosted.com with ESMTP id 28qw8ws3hf-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 20 Feb 2017 11:03:44 -0500 Received: from localhost by e24smtp01.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Feb 2017 13:03:41 -0300 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp01.br.ibm.com (10.172.0.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Feb 2017 13:03:40 -0300 Received: from d24relay02.br.ibm.com (d24relay02.br.ibm.com [9.18.232.42]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id A85601DC006D for ; Mon, 20 Feb 2017 11:03:40 -0500 (EST) Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by d24relay02.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1KG3dYi32112794 for ; Mon, 20 Feb 2017 13:03:39 -0300 Received: from d24av04.br.ibm.com (localhost [127.0.0.1]) by d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1KG3cIE010467 for ; Mon, 20 Feb 2017 13:03:39 -0300 Received: from arthas.ltc.br.ibm.com ([9.80.212.112]) by d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1KG3ZbN010448; Mon, 20 Feb 2017 13:03:37 -0300 From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Date: Mon, 20 Feb 2017 13:03:16 -0300 X-Mailer: git-send-email 2.9.3 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022016-1523-0000-0000-000002813DC8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022016-1524-0000-0000-00002A1646DA Message-Id: <20170220160316.16803-1-danielhb@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-20_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702200153 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v2] Changing error message of QMP 'migrate_set_downtime' to seconds 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: dgilbert@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The previous error message was displaying the values in miliseconds, being misleading with the command that accepts the value in seconds: { "execute": "migrate_set_downtime", "arguments": {"value": 3000}} {"error": {"class": "GenericError", "desc": "Parameter 'downtime_limit' expects an integer in the range of 0 to 2000000 milliseconds"}} This patch changes it to '2000 seconds' to keep consistency with the expected parameter. The macro 'QERR_INVALID_PARAMETER_VALUE' was changed for a regular string that allows the use of the MAX_MIGRATE_SET_DOWNTIME as a parameter, instead of hardcoding the value in the error message. Signed-off-by: Daniel Henrique Barboza --- migration/migration.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index c6ae69d..c05e764 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -49,6 +49,9 @@ * for sending the last part */ #define DEFAULT_MIGRATE_SET_DOWNTIME 300 =20 +/* Maximum migrate downtime set to 2000*1000 miliseconds */ +#define MAX_MIGRATE_SET_DOWNTIME (2000 * 1000) + /* Default compression thread count */ #define DEFAULT_MIGRATE_COMPRESS_THREAD_COUNT 8 /* Default decompression thread count, usually decompression is at @@ -843,10 +846,11 @@ void qmp_migrate_set_parameters(MigrationParameters *= params, Error **errp) return; } if (params->has_downtime_limit && - (params->downtime_limit < 0 || params->downtime_limit > 2000000)) { - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, - "downtime_limit", - "an integer in the range of 0 to 2000000 milliseconds"); + (params->downtime_limit < 0 || + params->downtime_limit > MAX_MIGRATE_SET_DOWNTIME)) { + error_setg(errp, "Parameter 'downtime_limit' expects an integer in= " + "the range of 0 to %d seconds", + MAX_MIGRATE_SET_DOWNTIME / 1000); return; } if (params->has_x_checkpoint_delay && (params->x_checkpoint_delay < 0)= ) { --=20 2.9.3