From patchwork Fri Sep 28 17:56:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 187855 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E8BC72C007F for ; Sat, 29 Sep 2012 04:02:15 +1000 (EST) Received: from localhost ([::1]:38395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THepz-00056R-Gy for incoming@patchwork.ozlabs.org; Fri, 28 Sep 2012 13:58:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THeom-0003SU-PN for qemu-devel@nongnu.org; Fri, 28 Sep 2012 13:57:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THeol-0007hf-KA for qemu-devel@nongnu.org; Fri, 28 Sep 2012 13:57:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THeol-0007hJ-C0 for qemu-devel@nongnu.org; Fri, 28 Sep 2012 13:57:39 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8SHvaM4025759 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 Sep 2012 13:57:37 -0400 Received: from dhcp-5-188.str.redhat.com (vpn1-7-84.ams2.redhat.com [10.36.7.84]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q8SHvF3H020617; Fri, 28 Sep 2012 13:57:35 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Fri, 28 Sep 2012 19:56:57 +0200 Message-Id: <1348855033-17174-15-git-send-email-kwolf@redhat.com> In-Reply-To: <1348855033-17174-1-git-send-email-kwolf@redhat.com> References: <1348855033-17174-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 14/30] qerror/block: introduce QERR_BLOCK_JOB_NOT_ACTIVE 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 From: Paolo Bonzini The DeviceNotActive text is not a particularly good match, add a separate text while keeping the same class. Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- blockdev.c | 4 ++-- qerror.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index cea22e4..d824612 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1205,7 +1205,7 @@ void qmp_block_job_set_speed(const char *device, int64_t speed, Error **errp) BlockJob *job = find_block_job(device); if (!job) { - error_set(errp, QERR_DEVICE_NOT_ACTIVE, device); + error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device); return; } @@ -1217,7 +1217,7 @@ void qmp_block_job_cancel(const char *device, Error **errp) BlockJob *job = find_block_job(device); if (!job) { - error_set(errp, QERR_DEVICE_NOT_ACTIVE, device); + error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device); return; } diff --git a/qerror.h b/qerror.h index d0a76a4..485c773 100644 --- a/qerror.h +++ b/qerror.h @@ -48,6 +48,9 @@ void assert_no_error(Error *err); #define QERR_BASE_NOT_FOUND \ ERROR_CLASS_GENERIC_ERROR, "Base '%s' not found" +#define QERR_BLOCK_JOB_NOT_ACTIVE \ + ERROR_CLASS_DEVICE_NOT_ACTIVE, "No active block job on device '%s'" + #define QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED \ ERROR_CLASS_GENERIC_ERROR, "Block format '%s' used by device '%s' does not support feature '%s'"