From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbPp7-0002lz-Nl for qemu-devel@nongnu.org; Mon, 04 Jun 2012 01:27:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbPp5-000093-Uy for qemu-devel@nongnu.org; Mon, 04 Jun 2012 01:27:25 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:60129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbPp5-00008u-OE for qemu-devel@nongnu.org; Mon, 04 Jun 2012 01:27:23 -0400 Received: by dadv2 with SMTP id v2so5807934dad.4 for ; Sun, 03 Jun 2012 22:27:22 -0700 (PDT) Message-ID: <4FCC4726.8020606@codemonkey.ws> Date: Mon, 04 Jun 2012 13:27:02 +0800 From: Anthony Liguori MIME-Version: 1.0 References: <1338591268-23962-1-git-send-email-akong@redhat.com> <1338591268-23962-2-git-send-email-akong@redhat.com> In-Reply-To: <1338591268-23962-2-git-send-email-akong@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/6] qerror: add QERR_OVERFLOW List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amos Kong Cc: aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com On 06/02/2012 06:54 AM, Amos Kong wrote: > Signed-off-by: Amos Kong I think QERR_INVALID_PARAMETER_VALUE is a more logical choice for the error you're generating. Regards, Anthony Liguori > --- > qerror.c | 4 ++++ > qerror.h | 3 +++ > 2 files changed, 7 insertions(+), 0 deletions(-) > > diff --git a/qerror.c b/qerror.c > index 5092fe7..b66af09 100644 > --- a/qerror.c > +++ b/qerror.c > @@ -172,6 +172,10 @@ static const QErrorStringTable qerror_table[] = { > .desc = "Parameter '%(name)' expects %(expected)", > }, > { > + .error_fmt = QERR_OVERFLOW, > + .desc = "Input is overflow", > + }, > + { > .error_fmt = QERR_INVALID_PASSWORD, > .desc = "Password incorrect", > }, > diff --git a/qerror.h b/qerror.h > index 4cbba48..dfe9c89 100644 > --- a/qerror.h > +++ b/qerror.h > @@ -151,6 +151,9 @@ QError *qobject_to_qerror(const QObject *obj); > #define QERR_INVALID_PARAMETER_VALUE \ > "{ 'class': 'InvalidParameterValue', 'data': { 'name': %s, 'expected': %s } }" > > +#define QERR_OVERFLOW \ > + "{ 'class': 'Overflow', 'data': {} }" > + > #define QERR_INVALID_PASSWORD \ > "{ 'class': 'InvalidPassword', 'data': {} }" >