From patchwork Wed Aug 27 13:29:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 383458 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5D8411400D2 for ; Wed, 27 Aug 2014 23:31:10 +1000 (EST) Received: from localhost ([::1]:59582 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMdJc-0003ic-Er for incoming@patchwork.ozlabs.org; Wed, 27 Aug 2014 09:31:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMdIn-0002jn-Gv for qemu-devel@nongnu.org; Wed, 27 Aug 2014 09:30:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMdId-0005IS-2y for qemu-devel@nongnu.org; Wed, 27 Aug 2014 09:30:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMdIc-0005Gc-Su for qemu-devel@nongnu.org; Wed, 27 Aug 2014 09:30:07 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7RDU5hr014561 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 27 Aug 2014 09:30:06 -0400 Received: from localhost (ovpn-112-47.ams2.redhat.com [10.36.112.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7RDU4bC011775; Wed, 27 Aug 2014 09:30:04 -0400 From: Stefan Hajnoczi To: Date: Wed, 27 Aug 2014 14:29:59 +0100 Message-Id: <1409146199-12855-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Markus Armbruster , Stefan Hajnoczi , Luiz Capitulino Subject: [Qemu-devel] [PATCH] blockdev: fix drive-mirror 'granularity' error message X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Name the 'granularity' parameter and give its expected value range. Previously the device name was mistakingly reported as the parameter name. Note that the error class is unchanged from ERROR_CLASS_GENERIC_ERROR. Reported-by: Eric Blake Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake Reviewed-by: BenoƮt Canet --- blockdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 6a204c6..eeb414e 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2179,11 +2179,12 @@ void qmp_drive_mirror(const char *device, const char *target, } if (granularity != 0 && (granularity < 512 || granularity > 1048576 * 64)) { - error_set(errp, QERR_INVALID_PARAMETER, device); + error_set(errp, QERR_INVALID_PARAMETER_VALUE, "granularity", + "a value in range [512B, 64MB]"); return; } if (granularity & (granularity - 1)) { - error_set(errp, QERR_INVALID_PARAMETER, device); + error_set(errp, QERR_INVALID_PARAMETER_VALUE, "granularity", "power of 2"); return; }