From patchwork Wed May 30 14:14:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 161971 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 75BB3B702D for ; Thu, 31 May 2012 00:15:52 +1000 (EST) Received: from localhost ([::1]:50177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZjgj-0007pX-S2 for incoming@patchwork.ozlabs.org; Wed, 30 May 2012 10:15:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58946) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZjgJ-0007M2-CW for qemu-devel@nongnu.org; Wed, 30 May 2012 10:15:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SZjgC-0007ma-P0 for qemu-devel@nongnu.org; Wed, 30 May 2012 10:15:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SZjfq-0007Rh-9r for qemu-devel@nongnu.org; Wed, 30 May 2012 10:15:16 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4UEEoJZ017862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 30 May 2012 10:14:50 -0400 Received: from localhost (ovpn-116-69.ams2.redhat.com [10.36.116.69]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4UEElAK006233; Wed, 30 May 2012 10:14:49 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 30 May 2012 11:14:49 -0300 Message-Id: <1338387301-10074-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1338387301-10074-1-git-send-email-lcapitulino@redhat.com> References: <1338387301-10074-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 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 | 28 ++++++++++++++++++++++++++++ qerror.h | 21 +++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/qerror.c b/qerror.c index 6c78759..97670a3 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)'", }, @@ -213,10 +221,22 @@ static const QErrorStringTable qerror_table[] = { .desc = "Parameter '%(name)' is missing", }, { + .error_fmt = QERR_NAME_TOO_LONG, + .desc = "Name is too long", + }, + { .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_NO_FILE_DIR, + .desc = "No such file or directory", + }, + { .error_fmt = QERR_NOT_SUPPORTED, .desc = "Not supported", }, @@ -275,6 +295,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", }, @@ -283,6 +307,10 @@ static const QErrorStringTable qerror_table[] = { .desc = "Could not set password", }, { + .error_fmt = QERR_TOO_MANY_FILES_PROC, + .desc = "Too many open files by process", + }, + { .error_fmt = QERR_TOO_MANY_FILES_SYS, .desc = "Too many open files in system", }, diff --git a/qerror.h b/qerror.h index fb7c642..d157e68 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 } }" @@ -181,9 +187,18 @@ 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_NO_FILE_DIR \ + "{ 'class': 'NoSuchFileOrDirectory', 'data': {} }" + #define QERR_NOT_SUPPORTED \ "{ 'class': 'NotSupported', 'data': {} }" @@ -227,12 +242,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': {} }"