qemu-socket: Polish errors for connect() and listen() failure
PATCH 1/1 qemu-socket: Polish errors for connect() and listen() failure
connect() doesn't "connect to socket", it connects a socket to an address and, if it's of type SOCK_STREAM, initiates a connection. Scratch "to".
listen() does "set socket to listening mode", but it sounds awkward. Change to "listen on socket".
--- include/qapi/qmp/qerror.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/qapi/qmp/qerror.h +2 -2
@@ -155,10 +155,10 @@ void qerror_report_err(Error *err); ERROR_CLASS_GENERIC_ERROR, "this feature or command is not currently supported"#define QERR_SOCKET_CONNECT_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to connect to socket" + ERROR_CLASS_GENERIC_ERROR, "Failed to connect socket"#define QERR_SOCKET_LISTEN_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to set socket to listening mode" + ERROR_CLASS_GENERIC_ERROR, "Failed to listen on socket"#define QERR_SOCKET_BIND_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Failed to bind socket"
Signature · 1 line
1.9.3
Quoted 7 lines
Subject: [Qemu-devel] [PATCH] qemu-socket: Polish errors for
connect()andlisten()failure
connect()doesn't "connect to socket", it connects a socket to an address and, if it's of typeSOCK_STREAM, initiates a connection. Scratch "to".
Quoted 8 lines
listen()does "set socket to listening mode", but it sounds awkward. Change to "listen on socket".Signed-off-by Markus Armbruster <[email protected]>--- include/qapi/qmp/qerror.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
And Cc'ing qemu-trivial@
Best regards,
-Gonglei
Quoted 21 lines
include/qapi/qmp/qerror.h +0
-0@@ -155,10 +155,10 @@ void qerror_report_err(Error *err); ERROR_CLASS_GENERIC_ERROR, "this feature or command is notcurrently supported"
#define
QERR_SOCKET_CONNECT_FAILED\include/qapi/qmp/qerror.h +2
-3- ERROR_CLASS_GENERIC_ERROR, "Failed to connect to socket" + ERROR_CLASS_GENERIC_ERROR, "Failed to connect socket"#define QERR_SOCKET_LISTEN_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to set socket to listening mode" + ERROR_CLASS_GENERIC_ERROR, "Failed to listen on socket"#define QERR_SOCKET_BIND_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Failed to bind socket" --1.9.3
Quoted 19 lines · On Fri, 19 Sep 2014 09:27:04 +0200 Markus Armbruster <[email protected]> wrote:
connect()doesn't "connect to socket", it connects a socket to an address and, if it's of typeSOCK_STREAM, initiates a connection. Scratch "to".
listen()does "set socket to listening mode", but it sounds awkward. Change to "listen on socket".Signed-off-by Markus Armbruster <[email protected]>--- include/qapi/qmp/qerror.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/qapi/qmp/qerror.h +0
-0@@ -155,10 +155,10 @@ void qerror_report_err(Error *err);ERROR_CLASS_GENERIC_ERROR ,"this feature or command is not currently supported"
include/qapi/qmp/qerror.h void qerror_report_err(Error *err); · line 164
Quoted 10 lines
include/qapi/qmp/qerror.h +2
-2#define QERR_SOCKET_CONNECT_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to connect to socket" + ERROR_CLASS_GENERIC_ERROR, "Failed to connect socket"#define QERR_SOCKET_LISTEN_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to set socket to listening mode" + ERROR_CLASS_GENERIC_ERROR, "Failed to listen on socket"#define QERR_SOCKET_BIND_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Failed to bind socket"
The word fixing is good, but what about getting rid of the QERR_ macros too?
The easiest way to do this would be to just replace each macro with its text. If the string duplication bothers you (it doesn't bother me very much, btw) you could create wrappers say qemu_listen() or listen_errp() or whatever.
Quoted 36 lines · Luiz Capitulino
Quoted 19 lines · On Fri, 19 Sep 2014 09:27:04 +0200 Markus Armbruster <[email protected]> wrote:
connect()doesn't "connect to socket", it connects a socket to an address and, if it's of typeSOCK_STREAM, initiates a connection. Scratch "to".
listen()does "set socket to listening mode", but it sounds awkward. Change to "listen on socket".Signed-off-by Markus Armbruster <[email protected]>--- include/qapi/qmp/qerror.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/qapi/qmp/qerror.h +0
-0@@ -155,10 +155,10 @@ void qerror_report_err(Error *err);ERROR_CLASS_GENERIC_ERROR ,"this feature or command is not currently supported" include/qapi/qmp/qerror.h void qerror_report_err(Error *err); · line 164
Quoted 10 lines
include/qapi/qmp/qerror.h +2
-2#define QERR_SOCKET_CONNECT_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to connect to socket" + ERROR_CLASS_GENERIC_ERROR, "Failed to connect socket"#define QERR_SOCKET_LISTEN_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to set socket to listening mode" + ERROR_CLASS_GENERIC_ERROR, "Failed to listen on socket"#define QERR_SOCKET_BIND_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Failed to bind socket"The word fixing is good, but what about getting rid of the
QERR_macros too?
Quoted 4 lines
The easiest way to do this would be to just replace each macro with its text. If the string duplication bothers you (it doesn't bother me very much, btw) you could create wrappers say
qemu_listen()orlisten_errp()or whatever.
I can do that on top. Okay?
Quoted 38 lines · On Fri, 19 Sep 2014 19:16:08 +0200 Markus Armbruster <[email protected]> wrote:
Quoted 36 lines · Luiz Capitulino
Quoted 19 lines · On Fri, 19 Sep 2014 09:27:04 +0200 Markus Armbruster <[email protected]> wrote:
connect()doesn't "connect to socket", it connects a socket to an address and, if it's of typeSOCK_STREAM, initiates a connection. Scratch "to".
listen()does "set socket to listening mode", but it sounds awkward. Change to "listen on socket".Signed-off-by Markus Armbruster <[email protected]>--- include/qapi/qmp/qerror.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/qapi/qmp/qerror.h +0
-0@@ -155,10 +155,10 @@ void qerror_report_err(Error *err);ERROR_CLASS_GENERIC_ERROR ,"this feature or command is not currently supported" include/qapi/qmp/qerror.h void qerror_report_err(Error *err); · line 164
Quoted 10 lines
include/qapi/qmp/qerror.h +2
-2#define QERR_SOCKET_CONNECT_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to connect to socket" + ERROR_CLASS_GENERIC_ERROR, "Failed to connect socket"#define QERR_SOCKET_LISTEN_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to set socket to listening mode" + ERROR_CLASS_GENERIC_ERROR, "Failed to listen on socket"#define QERR_SOCKET_BIND_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Failed to bind socket"The word fixing is good, but what about getting rid of the
QERR_macros too?
Quoted 6 lines
Quoted 4 lines
The easiest way to do this would be to just replace each macro with its text. If the string duplication bothers you (it doesn't bother me very much, btw) you could create wrappers say
qemu_listen()orlisten_errp()or whatever.I can do that on top. Okay?
OK.
Luiz Capitulino
AppliedQuoted 8 lines · On Fri, 19 Sep 2014 09:27:04 +0200 Markus Armbruster <[email protected]> wrote:
connect()doesn't "connect to socket", it connects a socket to an address and, if it's of typeSOCK_STREAM, initiates a connection. Scratch "to".
listen()does "set socket to listening mode", but it sounds awkward. Change to "listen on socket".Signed-off-by Markus Armbruster <[email protected]>
Applied to the qmp branch, thanks.
Quoted 21 lines
--- include/qapi/qmp/qerror.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/qapi/qmp/qerror.h +2
-2@@ -155,10 +155,10 @@ void qerror_report_err(Error *err); ERROR_CLASS_GENERIC_ERROR, "this feature or command is not currently supported"#define QERR_SOCKET_CONNECT_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to connect to socket" + ERROR_CLASS_GENERIC_ERROR, "Failed to connect socket"#define QERR_SOCKET_LISTEN_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Failed to set socket to listening mode" + ERROR_CLASS_GENERIC_ERROR, "Failed to listen on socket"#define QERR_SOCKET_BIND_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Failed to bind socket"