qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure
@ 2014-09-19  7:27 Markus Armbruster
  2014-09-19  7:37 ` Gonglei (Arei)
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Markus Armbruster @ 2014-09-19  7:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: akong, lcapitulino

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".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/qapi/qmp/qerror.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
index 902d1a7..774e75d 100644
--- a/include/qapi/qmp/qerror.h
+++ b/include/qapi/qmp/qerror.h
@@ -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"
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure
  2014-09-19  7:27 [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure Markus Armbruster
@ 2014-09-19  7:37 ` Gonglei (Arei)
  2014-09-19 17:05 ` Luiz Capitulino
  2014-09-26 17:19 ` Luiz Capitulino
  2 siblings, 0 replies; 6+ messages in thread
From: Gonglei (Arei) @ 2014-09-19  7:37 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel@nongnu.org
  Cc: qemu-trivial@nongnu.org, akong@redhat.com, lcapitulino@redhat.com

> Subject: [Qemu-devel] [PATCH] 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".
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  include/qapi/qmp/qerror.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Gonglei <arei.gonglei@huawei.com>

And Cc'ing qemu-trivial@

Best regards,
-Gonglei

> diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
> index 902d1a7..774e75d 100644
> --- a/include/qapi/qmp/qerror.h
> +++ b/include/qapi/qmp/qerror.h
> @@ -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"
> --
> 1.9.3
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure
  2014-09-19  7:27 [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure Markus Armbruster
  2014-09-19  7:37 ` Gonglei (Arei)
@ 2014-09-19 17:05 ` Luiz Capitulino
  2014-09-19 17:16   ` Markus Armbruster
  2014-09-26 17:19 ` Luiz Capitulino
  2 siblings, 1 reply; 6+ messages in thread
From: Luiz Capitulino @ 2014-09-19 17:05 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: akong, qemu-devel

On Fri, 19 Sep 2014 09:27:04 +0200
Markus Armbruster <armbru@redhat.com> wrote:

> 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".
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  include/qapi/qmp/qerror.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
> index 902d1a7..774e75d 100644
> --- a/include/qapi/qmp/qerror.h
> +++ b/include/qapi/qmp/qerror.h
> @@ -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"

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure
  2014-09-19 17:05 ` Luiz Capitulino
@ 2014-09-19 17:16   ` Markus Armbruster
  2014-09-19 17:17     ` Luiz Capitulino
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Armbruster @ 2014-09-19 17:16 UTC (permalink / raw)
  To: Luiz Capitulino; +Cc: akong, qemu-devel

Luiz Capitulino <lcapitulino@redhat.com> writes:

> On Fri, 19 Sep 2014 09:27:04 +0200
> Markus Armbruster <armbru@redhat.com> wrote:
>
>> 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".
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>  include/qapi/qmp/qerror.h | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
>> index 902d1a7..774e75d 100644
>> --- a/include/qapi/qmp/qerror.h
>> +++ b/include/qapi/qmp/qerror.h
>> @@ -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"
>
> 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.

I can do that on top.  Okay?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure
  2014-09-19 17:16   ` Markus Armbruster
@ 2014-09-19 17:17     ` Luiz Capitulino
  0 siblings, 0 replies; 6+ messages in thread
From: Luiz Capitulino @ 2014-09-19 17:17 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: akong, qemu-devel

On Fri, 19 Sep 2014 19:16:08 +0200
Markus Armbruster <armbru@redhat.com> wrote:

> Luiz Capitulino <lcapitulino@redhat.com> writes:
> 
> > On Fri, 19 Sep 2014 09:27:04 +0200
> > Markus Armbruster <armbru@redhat.com> wrote:
> >
> >> 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".
> >> 
> >> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> >> ---
> >>  include/qapi/qmp/qerror.h | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >> 
> >> diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
> >> index 902d1a7..774e75d 100644
> >> --- a/include/qapi/qmp/qerror.h
> >> +++ b/include/qapi/qmp/qerror.h
> >> @@ -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"
> >
> > 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.
> 
> I can do that on top.  Okay?

OK.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure
  2014-09-19  7:27 [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure Markus Armbruster
  2014-09-19  7:37 ` Gonglei (Arei)
  2014-09-19 17:05 ` Luiz Capitulino
@ 2014-09-26 17:19 ` Luiz Capitulino
  2 siblings, 0 replies; 6+ messages in thread
From: Luiz Capitulino @ 2014-09-26 17:19 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: akong, qemu-devel

On Fri, 19 Sep 2014 09:27:04 +0200
Markus Armbruster <armbru@redhat.com> wrote:

> 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".
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Applied to the qmp branch, thanks.

> ---
>  include/qapi/qmp/qerror.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
> index 902d1a7..774e75d 100644
> --- a/include/qapi/qmp/qerror.h
> +++ b/include/qapi/qmp/qerror.h
> @@ -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"

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-09-26 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-19  7:27 [Qemu-devel] [PATCH] qemu-socket: Polish errors for connect() and listen() failure Markus Armbruster
2014-09-19  7:37 ` Gonglei (Arei)
2014-09-19 17:05 ` Luiz Capitulino
2014-09-19 17:16   ` Markus Armbruster
2014-09-19 17:17     ` Luiz Capitulino
2014-09-26 17:19 ` Luiz Capitulino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).