From patchwork Thu Jan 26 16:38:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 138016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (unknown [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 05C5AB6EF7 for ; Fri, 27 Jan 2012 06:06:36 +1100 (EST) Received: from localhost ([::1]:33153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqSIt-0001Ug-6R for incoming@patchwork.ozlabs.org; Thu, 26 Jan 2012 11:36:03 -0500 Received: from eggs.gnu.org ([140.186.70.92]:60504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqSI9-0000NH-95 for qemu-devel@nongnu.org; Thu, 26 Jan 2012 11:35:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RqSI3-0003SZ-W7 for qemu-devel@nongnu.org; Thu, 26 Jan 2012 11:35:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RqSI3-0003SK-9I for qemu-devel@nongnu.org; Thu, 26 Jan 2012 11:35:11 -0500 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 q0QGZ9gt024126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Jan 2012 11:35:09 -0500 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q0QGYoY3031205; Thu, 26 Jan 2012 11:35:08 -0500 From: Kevin Wolf To: anthony@codemonkey.ws Date: Thu, 26 Jan 2012 17:38:09 +0100 Message-Id: <1327595896-19623-16-git-send-email-kwolf@redhat.com> In-Reply-To: <1327595896-19623-1-git-send-email-kwolf@redhat.com> References: <1327595896-19623-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 15/22] add QERR_BASE_NOT_FOUND 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: Marcelo Tosatti This qerror will be raised when a given streaming base (backing file) cannot be found. Signed-off-by: Marcelo Tosatti Signed-off-by: Stefan Hajnoczi Acked-by: Luiz Capitulino Signed-off-by: Kevin Wolf --- qapi-schema.json | 1 + qerror.c | 4 ++++ qerror.h | 3 +++ 3 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index 3f72c2c..80debe6 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1493,6 +1493,7 @@ # If streaming is already active on this device, DeviceInUse # If @device does not exist, DeviceNotFound # If image streaming is not supported by this device, NotSupported +# If @base does not exist, BaseNotFound # # Since: 1.1 ## diff --git a/qerror.c b/qerror.c index 2c60e10..637eca7 100644 --- a/qerror.c +++ b/qerror.c @@ -52,6 +52,10 @@ static const QErrorStringTable qerror_table[] = { .desc = "Device '%(device)' can't go on a %(bad_bus_type) bus", }, { + .error_fmt = QERR_BASE_NOT_FOUND, + .desc = "Base '%(base)' not found", + }, + { .error_fmt = QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, .desc = "Block format '%(format)' used by device '%(name)' does not support feature '%(feature)'", }, diff --git a/qerror.h b/qerror.h index b530bc8..8c36ddb 100644 --- a/qerror.h +++ b/qerror.h @@ -57,6 +57,9 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_BAD_BUS_FOR_DEVICE \ "{ 'class': 'BadBusForDevice', 'data': { 'device': %s, 'bad_bus_type': %s } }" +#define QERR_BASE_NOT_FOUND \ + "{ 'class': 'BaseNotFound', 'data': { 'base': %s } }" + #define QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED \ "{ 'class': 'BlockFormatFeatureNotSupported', 'data': { 'format': %s, 'name': %s, 'feature': %s } }"