From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlrw-0005WC-Os for qemu-devel@nongnu.org; Tue, 08 May 2012 10:58:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRlrs-00020z-W3 for qemu-devel@nongnu.org; Tue, 08 May 2012 10:58:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRlrs-0001zT-N6 for qemu-devel@nongnu.org; Tue, 08 May 2012 10:58:24 -0400 From: Amos Kong Date: Tue, 08 May 2012 22:58:22 +0800 Message-ID: <20120508145822.4027.29292.stgit@t> In-Reply-To: <20120508145718.4027.86985.stgit@t> References: <20120508145718.4027.86985.stgit@t> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v11 1/4] qerror: add five qerror strings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Add five new qerror strings, they are about listen/connect 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 Reviewed-by: Orit Wasserman --- qerror.c | 20 ++++++++++++++++++++ qerror.h | 15 +++++++++++++++ 2 files changed, 35 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index 96fbe71..2963b8c 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 can not be completed immediately", + }, + { + .error_fmt = QERR_SOCKET_CONNECT_FAILED, + .desc = "Failed to connect socket", + }, + { + .error_fmt = QERR_SOCKET_LISTEN_FAILED, + .desc = "Failed to listen socket", + }, + { + .error_fmt = QERR_SOCKET_BIND_FAILED, + .desc = "Failed to bind socket", + }, + { + .error_fmt = QERR_SOCKET_CREATE_FAILED, + .desc = "Failed 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 */