From patchwork Tue Apr 17 14:54:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 153221 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 11D8BB7012 for ; Wed, 18 Apr 2012 00:54:39 +1000 (EST) Received: from localhost ([::1]:35827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SK9nh-0004WB-0B for incoming@patchwork.ozlabs.org; Tue, 17 Apr 2012 10:54:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SK9nO-0004E6-UW for qemu-devel@nongnu.org; Tue, 17 Apr 2012 10:54:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SK9nH-0005Uy-GU for qemu-devel@nongnu.org; Tue, 17 Apr 2012 10:54:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58738) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SK9nH-0005UZ-8z for qemu-devel@nongnu.org; Tue, 17 Apr 2012 10:54:11 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3HEs6M0026730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 Apr 2012 10:54:06 -0400 Received: from dhcp-8-167.nay.redhat.com (dhcp-8-167.nay.redhat.com [10.66.8.167]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3HEs3dN007330; Tue, 17 Apr 2012 10:54:04 -0400 To: aliguori@us.ibm.com, quintela@redhat.com, jasowang@redhat.com, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, owasserm@redhat.com, laine@redhat.com From: Amos Kong Date: Tue, 17 Apr 2012 22:54:11 +0800 Message-ID: <20120417145411.22756.29708.stgit@dhcp-8-167.nay.redhat.com> In-Reply-To: <20120417145322.22756.55527.stgit@dhcp-8-167.nay.redhat.com> References: <20120417145322.22756.55527.stgit@dhcp-8-167.nay.redhat.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v6 2/5] qerror: add five qerror strings 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 Add five new qerror strings, they are about socket: QERR_SOCKET_CONNECT_IN_PROGRESS QERR_SOCKET_CONNECT_FAILED QERR_SOCKET_LISTEN_FAILED QERR_SOCKET_BIND_FAILED QERR_SOCKET_CREATE_FAILED Signed-off-by: Amos Kong --- qerror.c | 20 ++++++++++++++++++++ qerror.h | 15 +++++++++++++++ 2 files changed, 35 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index 96fbe71..7afe1ac 100644 --- a/qerror.c +++ b/qerror.c @@ -304,6 +304,26 @@ static const QErrorStringTable qerror_table[] = { .error_fmt = QERR_VNC_SERVER_FAILED, .desc = "Could not start VNC server on %(target)", }, + { + .error_fmt = QERR_SOCKET_CONNECT_IN_PROGRESS, + .desc = "Connection cannot be completed immediately", + }, + { + .error_fmt = QERR_SOCKET_CONNECT_FAILED, + .desc = "Fail to connect socket", + }, + { + .error_fmt = QERR_SOCKET_LISTEN_FAILED, + .desc = "Fail to listen socket", + }, + { + .error_fmt = QERR_SOCKET_BIND_FAILED, + .desc = "Fail to bind socket", + }, + { + .error_fmt = QERR_SOCKET_CREATE_FAILED, + .desc = "Fail to create socket", + }, {} }; diff --git a/qerror.h b/qerror.h index 5c23c1f..4cbba48 100644 --- a/qerror.h +++ b/qerror.h @@ -248,4 +248,19 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_VNC_SERVER_FAILED \ "{ 'class': 'VNCServerFailed', 'data': { 'target': %s } }" +#define QERR_SOCKET_CONNECT_IN_PROGRESS \ + "{ 'class': 'SockConnectInprogress', 'data': {} }" + +#define QERR_SOCKET_CONNECT_FAILED \ + "{ 'class': 'SockConnectFailed', 'data': {} }" + +#define QERR_SOCKET_LISTEN_FAILED \ + "{ 'class': 'SockListenFailed', 'data': {} }" + +#define QERR_SOCKET_BIND_FAILED \ + "{ 'class': 'SockBindFailed', 'data': {} }" + +#define QERR_SOCKET_CREATE_FAILED \ + "{ 'class': 'SockCreateFailed', 'data': {} }" + #endif /* QERROR_H */