From patchwork Fri May 25 19:41:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 161405 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 CAC25B6F13 for ; Sat, 26 May 2012 05:41:31 +1000 (EST) Received: from localhost ([::1]:41366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SY0O9-0005HH-Kk for incoming@patchwork.ozlabs.org; Fri, 25 May 2012 15:41:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SY0Nt-000544-Bv for qemu-devel@nongnu.org; Fri, 25 May 2012 15:41:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SY0Nr-0004FU-Dg for qemu-devel@nongnu.org; Fri, 25 May 2012 15:41:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SY0Nr-0004Ep-5j for qemu-devel@nongnu.org; Fri, 25 May 2012 15:41:11 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4PJf9Jg009804 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 May 2012 15:41:09 -0400 Received: from localhost (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4PJf7it025872; Fri, 25 May 2012 15:41:08 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Fri, 25 May 2012 16:41:07 -0300 Message-Id: <1337974879-3656-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1337974879-3656-1-git-send-email-lcapitulino@redhat.com> References: <1337974879-3656-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, alevy@redhat.com, armbru@redhat.com Subject: [Qemu-devel] [PATCH 02/14] qerror: add new errors 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 New errors for write() and open() failures. Will be used by the next commits. Signed-off-by: Luiz Capitulino --- qerror.c | 24 ++++++++++++++++++++++++ qerror.h | 18 ++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/qerror.c b/qerror.c index 2c97382..58e4570 100644 --- a/qerror.c +++ b/qerror.c @@ -152,6 +152,14 @@ static const QErrorStringTable qerror_table[] = { .desc = "The feature '%(name)' is not enabled", }, { + .error_fmt = QERR_FILE_TOO_BIG, + .desc = "File exceeds maxium file size limit", + }, + { + .error_fmt = QERR_INVALID_ACCESS, + .desc = "The access is invalid", + }, + { .error_fmt = QERR_INVALID_BLOCK_FORMAT, .desc = "Invalid block format '%(name)'", }, @@ -209,10 +217,18 @@ static const QErrorStringTable qerror_table[] = { .desc = "Parameter '%(name)' is missing", }, { + .error_fmt = QERR_NAME_TOO_LONG, + .desc = "Name is too longe", + }, + { .error_fmt = QERR_NO_BUS_FOR_DEVICE, .desc = "No '%(bus)' bus found for device '%(device)'", }, { + .error_fmt = QERR_NO_SPACE, + .desc = "No space left in device", + }, + { .error_fmt = QERR_NOT_SUPPORTED, .desc = "Not supported", }, @@ -271,6 +287,10 @@ static const QErrorStringTable qerror_table[] = { .desc = "QMP input object member '%(member)' is unexpected", }, { + .error_fmt = QERR_READ_ONLY_FS, + .desc = "File System is read-only", + }, + { .error_fmt = QERR_RESET_REQUIRED, .desc = "Resetting the Virtual Machine is required", }, @@ -279,6 +299,10 @@ static const QErrorStringTable qerror_table[] = { .desc = "Could not set password", }, { + .error_fmt = QERR_TOO_MANY_FILES_PROC, + .desc = "Too many opened files by the process", + }, + { .error_fmt = QERR_TOO_MANY_FILES_SYS, .desc = "Too many opened files in the system", }, diff --git a/qerror.h b/qerror.h index 9ddf09c..e8dc9e7 100644 --- a/qerror.h +++ b/qerror.h @@ -136,6 +136,12 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_FEATURE_DISABLED \ "{ 'class': 'FeatureDisabled', 'data': { 'name': %s } }" +#define QERR_FILE_TOO_BIG \ + "{ 'class': 'FileTooBig', 'data': {} }" + +#define QERR_INVALID_ACCESS \ + "{ 'class': 'InvalidAccess', 'data': {} }" + #define QERR_INVALID_BLOCK_FORMAT \ "{ 'class': 'InvalidBlockFormat', 'data': { 'name': %s } }" @@ -178,9 +184,15 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_MISSING_PARAMETER \ "{ 'class': 'MissingParameter', 'data': { 'name': %s } }" +#define QERR_NAME_TOO_LONG \ + "{ 'class': 'NameTooLong', 'data': {} }" + #define QERR_NO_BUS_FOR_DEVICE \ "{ 'class': 'NoBusForDevice', 'data': { 'device': %s, 'bus': %s } }" +#define QERR_NO_SPACE \ + "{ 'class': 'NoSpace', 'data': {} }" + #define QERR_NOT_SUPPORTED \ "{ 'class': 'NotSupported', 'data': {} }" @@ -224,12 +236,18 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_QMP_EXTRA_MEMBER \ "{ 'class': 'QMPExtraInputObjectMember', 'data': { 'member': %s } }" +#define QERR_READ_ONLY_FS \ + "{ 'class': 'ReadOnlyFileSystem', 'data': {} }" + #define QERR_RESET_REQUIRED \ "{ 'class': 'ResetRequired', 'data': {} }" #define QERR_SET_PASSWD_FAILED \ "{ 'class': 'SetPasswdFailed', 'data': {} }" +#define QERR_TOO_MANY_FILES_PROC \ + "{ 'class': 'TooManyFilesByProcess', 'data': {} }" + #define QERR_TOO_MANY_FILES_SYS \ "{ 'class': 'TooManyFilesInSystem', 'data': {} }"