[Qemu-devel] [PATCH v8 0/4] Improve error reporting

Mao Zhongyi posted 4 patches 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/cover.1499329674.git.maozy.fnst@cn.fujitsu.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
include/qemu/sockets.h |   3 +-
net/net.c              |  22 +++++--
net/socket.c           | 153 ++++++++++++++++++++++++++++---------------------
3 files changed, 106 insertions(+), 72 deletions(-)
[Qemu-devel] [PATCH v8 0/4] Improve error reporting
Posted by Mao Zhongyi 6 years, 9 months ago
v8:
* PATCH 02 & 04
  -resetting the error message for the user to read.   [Markus Armbruster]
  -fix the indentation and commit message.  [Markus Armbruster]
  
v7:
* PATCH 01
  -fix the error message.    [Daniel P. Berrange]
  -adjust the indentation problem.    [Eric Blake]
* PATCH 03
  -print a generic message when gethostbyname() failed in parse_host_port(),
   drop the misleading ": unkonwn host" part.    [Markus Armbruster]

v6:
* PATCH 02
  -rename the subject
  -drop the "qemu: error: " prefix.
  -correct inappropriate error information settings.
* PATCH 03,04
  -correct inappropriate error information settings.    [Markus Armbruster]

v5:
* PATCH 01 make the commit message more exact about the actual function.    [Markus Armbruster]
* PATCH 02, 03, 04 still retains the original function, but specific
           content and order of each patch has been adjusted substantially, 
           so that ensure each patch is a completed fix.    [Markus Armbruster]

v4: 
* PATCH 01 is redoing previous patch 1, replace the fprintf() with error_report()
		     in the 'default' case of net_socket_fd_init() [Markus Armbruster]

v3:
* PATCH 01 is suggested by Markus and Daniel that removes the dubious 'default' case
           in the net_socket_fd_init(). Jason agreed.
* PATCH 02 is redoing previous patch 4.
* PATCH 04 is redoing previous patch 2, improves sort of error messages. 

v2:
* PATCH 02 reworking of patch 2 following Markus's suggestion that convert error_report()
           in the function called by net_socket_*_init() to Error. Also add many error 
           handling information.
* PATCH 03 net_socket_mcast_create(), net_socket_fd_init_dgram() and net_socket_fd_init() 
           use the function such as fprintf, perror to report an error message. Convert it 
           to Error.
* PATCH 04 parse_host_port() may fail without reporting an error. Now, fix it to set an
           error when it fails.

Cc: jasowang@redhat.com
Cc: armbru@redhat.com
Cc: berrange@redhat.com
Cc: kraxel@redhat.com
Cc: pbonzini@redhat.com
Cc: eblake@redhat.com

Mao Zhongyi (4):
  net/socket: Don't treat odd socket type as SOCK_STREAM
  net/socket: Convert several helper functions to Error
  net/net: Convert parse_host_port() to Error
  net/socket: Improve -net socket error reporting

 include/qemu/sockets.h |   3 +-
 net/net.c              |  22 +++++--
 net/socket.c           | 153 ++++++++++++++++++++++++++++---------------------
 3 files changed, 106 insertions(+), 72 deletions(-)

-- 
2.9.4




Re: [Qemu-devel] [PATCH v8 0/4] Improve error reporting
Posted by Markus Armbruster 6 years, 8 months ago
Jason, did this fall through the cracks?

Mao Zhongyi <maozy.fnst@cn.fujitsu.com> writes:

> v8:
> * PATCH 02 & 04
>   -resetting the error message for the user to read.   [Markus Armbruster]
>   -fix the indentation and commit message.  [Markus Armbruster]
>   
> v7:
> * PATCH 01
>   -fix the error message.    [Daniel P. Berrange]
>   -adjust the indentation problem.    [Eric Blake]
> * PATCH 03
>   -print a generic message when gethostbyname() failed in parse_host_port(),
>    drop the misleading ": unkonwn host" part.    [Markus Armbruster]
>
> v6:
> * PATCH 02
>   -rename the subject
>   -drop the "qemu: error: " prefix.
>   -correct inappropriate error information settings.
> * PATCH 03,04
>   -correct inappropriate error information settings.    [Markus Armbruster]
>
> v5:
> * PATCH 01 make the commit message more exact about the actual function.    [Markus Armbruster]
> * PATCH 02, 03, 04 still retains the original function, but specific
>            content and order of each patch has been adjusted substantially, 
>            so that ensure each patch is a completed fix.    [Markus Armbruster]
>
> v4: 
> * PATCH 01 is redoing previous patch 1, replace the fprintf() with error_report()
> 		     in the 'default' case of net_socket_fd_init() [Markus Armbruster]
>
> v3:
> * PATCH 01 is suggested by Markus and Daniel that removes the dubious 'default' case
>            in the net_socket_fd_init(). Jason agreed.
> * PATCH 02 is redoing previous patch 4.
> * PATCH 04 is redoing previous patch 2, improves sort of error messages. 
>
> v2:
> * PATCH 02 reworking of patch 2 following Markus's suggestion that convert error_report()
>            in the function called by net_socket_*_init() to Error. Also add many error 
>            handling information.
> * PATCH 03 net_socket_mcast_create(), net_socket_fd_init_dgram() and net_socket_fd_init() 
>            use the function such as fprintf, perror to report an error message. Convert it 
>            to Error.
> * PATCH 04 parse_host_port() may fail without reporting an error. Now, fix it to set an
>            error when it fails.
>
> Cc: jasowang@redhat.com
> Cc: armbru@redhat.com
> Cc: berrange@redhat.com
> Cc: kraxel@redhat.com
> Cc: pbonzini@redhat.com
> Cc: eblake@redhat.com
>
> Mao Zhongyi (4):
>   net/socket: Don't treat odd socket type as SOCK_STREAM
>   net/socket: Convert several helper functions to Error
>   net/net: Convert parse_host_port() to Error
>   net/socket: Improve -net socket error reporting
>
>  include/qemu/sockets.h |   3 +-
>  net/net.c              |  22 +++++--
>  net/socket.c           | 153 ++++++++++++++++++++++++++++---------------------
>  3 files changed, 106 insertions(+), 72 deletions(-)

Re: [Qemu-devel] [PATCH v8 0/4] Improve error reporting
Posted by Jason Wang 6 years, 8 months ago

On 2017年08月14日 20:02, Markus Armbruster wrote:
> Jason, did this fall through the cracks?

Unfortunately yes, consider it's rc3, I've queued this for 2.11.

Thanks

>
> Mao Zhongyi <maozy.fnst@cn.fujitsu.com> writes:
>
>> v8:
>> * PATCH 02 & 04
>>    -resetting the error message for the user to read.   [Markus Armbruster]
>>    -fix the indentation and commit message.  [Markus Armbruster]
>>    
>> v7:
>> * PATCH 01
>>    -fix the error message.    [Daniel P. Berrange]
>>    -adjust the indentation problem.    [Eric Blake]
>> * PATCH 03
>>    -print a generic message when gethostbyname() failed in parse_host_port(),
>>     drop the misleading ": unkonwn host" part.    [Markus Armbruster]
>>
>> v6:
>> * PATCH 02
>>    -rename the subject
>>    -drop the "qemu: error: " prefix.
>>    -correct inappropriate error information settings.
>> * PATCH 03,04
>>    -correct inappropriate error information settings.    [Markus Armbruster]
>>
>> v5:
>> * PATCH 01 make the commit message more exact about the actual function.    [Markus Armbruster]
>> * PATCH 02, 03, 04 still retains the original function, but specific
>>             content and order of each patch has been adjusted substantially,
>>             so that ensure each patch is a completed fix.    [Markus Armbruster]
>>
>> v4:
>> * PATCH 01 is redoing previous patch 1, replace the fprintf() with error_report()
>> 		     in the 'default' case of net_socket_fd_init() [Markus Armbruster]
>>
>> v3:
>> * PATCH 01 is suggested by Markus and Daniel that removes the dubious 'default' case
>>             in the net_socket_fd_init(). Jason agreed.
>> * PATCH 02 is redoing previous patch 4.
>> * PATCH 04 is redoing previous patch 2, improves sort of error messages.
>>
>> v2:
>> * PATCH 02 reworking of patch 2 following Markus's suggestion that convert error_report()
>>             in the function called by net_socket_*_init() to Error. Also add many error
>>             handling information.
>> * PATCH 03 net_socket_mcast_create(), net_socket_fd_init_dgram() and net_socket_fd_init()
>>             use the function such as fprintf, perror to report an error message. Convert it
>>             to Error.
>> * PATCH 04 parse_host_port() may fail without reporting an error. Now, fix it to set an
>>             error when it fails.
>>
>> Cc: jasowang@redhat.com
>> Cc: armbru@redhat.com
>> Cc: berrange@redhat.com
>> Cc: kraxel@redhat.com
>> Cc: pbonzini@redhat.com
>> Cc: eblake@redhat.com
>>
>> Mao Zhongyi (4):
>>    net/socket: Don't treat odd socket type as SOCK_STREAM
>>    net/socket: Convert several helper functions to Error
>>    net/net: Convert parse_host_port() to Error
>>    net/socket: Improve -net socket error reporting
>>
>>   include/qemu/sockets.h |   3 +-
>>   net/net.c              |  22 +++++--
>>   net/socket.c           | 153 ++++++++++++++++++++++++++++---------------------
>>   3 files changed, 106 insertions(+), 72 deletions(-)


Re: [Qemu-devel] [PATCH v8 0/4] Improve error reporting
Posted by Jason Wang 6 years, 7 months ago

On 2017年07月06日 16:47, Mao Zhongyi wrote:
> v8:
> * PATCH 02 & 04
>    -resetting the error message for the user to read.   [Markus Armbruster]
>    -fix the indentation and commit message.  [Markus Armbruster]
>    
> v7:
> * PATCH 01
>    -fix the error message.    [Daniel P. Berrange]
>    -adjust the indentation problem.    [Eric Blake]
> * PATCH 03
>    -print a generic message when gethostbyname() failed in parse_host_port(),
>     drop the misleading ": unkonwn host" part.    [Markus Armbruster]
>
> v6:
> * PATCH 02
>    -rename the subject
>    -drop the "qemu: error: " prefix.
>    -correct inappropriate error information settings.
> * PATCH 03,04
>    -correct inappropriate error information settings.    [Markus Armbruster]
>
> v5:
> * PATCH 01 make the commit message more exact about the actual function.    [Markus Armbruster]
> * PATCH 02, 03, 04 still retains the original function, but specific
>             content and order of each patch has been adjusted substantially,
>             so that ensure each patch is a completed fix.    [Markus Armbruster]
>
> v4:
> * PATCH 01 is redoing previous patch 1, replace the fprintf() with error_report()
> 		     in the 'default' case of net_socket_fd_init() [Markus Armbruster]
>
> v3:
> * PATCH 01 is suggested by Markus and Daniel that removes the dubious 'default' case
>             in the net_socket_fd_init(). Jason agreed.
> * PATCH 02 is redoing previous patch 4.
> * PATCH 04 is redoing previous patch 2, improves sort of error messages.
>
> v2:
> * PATCH 02 reworking of patch 2 following Markus's suggestion that convert error_report()
>             in the function called by net_socket_*_init() to Error. Also add many error
>             handling information.
> * PATCH 03 net_socket_mcast_create(), net_socket_fd_init_dgram() and net_socket_fd_init()
>             use the function such as fprintf, perror to report an error message. Convert it
>             to Error.
> * PATCH 04 parse_host_port() may fail without reporting an error. Now, fix it to set an
>             error when it fails.
>
> Cc: jasowang@redhat.com
> Cc: armbru@redhat.com
> Cc: berrange@redhat.com
> Cc: kraxel@redhat.com
> Cc: pbonzini@redhat.com
> Cc: eblake@redhat.com
>
> Mao Zhongyi (4):
>    net/socket: Don't treat odd socket type as SOCK_STREAM
>    net/socket: Convert several helper functions to Error
>    net/net: Convert parse_host_port() to Error
>    net/socket: Improve -net socket error reporting
>
>   include/qemu/sockets.h |   3 +-
>   net/net.c              |  22 +++++--
>   net/socket.c           | 153 ++++++++++++++++++++++++++++---------------------
>   3 files changed, 106 insertions(+), 72 deletions(-)
>

Hi:

Want to apply this, but looks like it does not apply cleanly, could you 
please send a new version?

Thanks

Re: [Qemu-devel] [PATCH v8 0/4] Improve error reporting
Posted by Mao Zhongyi 6 years, 7 months ago
On 09/04/2017 11:09 AM, Jason Wang wrote:
>
>
> On 2017年07月06日 16:47, Mao Zhongyi wrote:
>> v8:
>> * PATCH 02 & 04
>>    -resetting the error message for the user to read.   [Markus Armbruster]
>>    -fix the indentation and commit message.  [Markus Armbruster]
>>    v7:
>> * PATCH 01
>>    -fix the error message.    [Daniel P. Berrange]
>>    -adjust the indentation problem.    [Eric Blake]
>> * PATCH 03
>>    -print a generic message when gethostbyname() failed in parse_host_port(),
>>     drop the misleading ": unkonwn host" part.    [Markus Armbruster]
>>
>> v6:
>> * PATCH 02
>>    -rename the subject
>>    -drop the "qemu: error: " prefix.
>>    -correct inappropriate error information settings.
>> * PATCH 03,04
>>    -correct inappropriate error information settings.    [Markus Armbruster]
>>
>> v5:
>> * PATCH 01 make the commit message more exact about the actual function.    [Markus Armbruster]
>> * PATCH 02, 03, 04 still retains the original function, but specific
>>             content and order of each patch has been adjusted substantially,
>>             so that ensure each patch is a completed fix.    [Markus Armbruster]
>>
>> v4:
>> * PATCH 01 is redoing previous patch 1, replace the fprintf() with error_report()
>>              in the 'default' case of net_socket_fd_init() [Markus Armbruster]
>>
>> v3:
>> * PATCH 01 is suggested by Markus and Daniel that removes the dubious 'default' case
>>             in the net_socket_fd_init(). Jason agreed.
>> * PATCH 02 is redoing previous patch 4.
>> * PATCH 04 is redoing previous patch 2, improves sort of error messages.
>>
>> v2:
>> * PATCH 02 reworking of patch 2 following Markus's suggestion that convert error_report()
>>             in the function called by net_socket_*_init() to Error. Also add many error
>>             handling information.
>> * PATCH 03 net_socket_mcast_create(), net_socket_fd_init_dgram() and net_socket_fd_init()
>>             use the function such as fprintf, perror to report an error message. Convert it
>>             to Error.
>> * PATCH 04 parse_host_port() may fail without reporting an error. Now, fix it to set an
>>             error when it fails.
>>
>> Cc: jasowang@redhat.com
>> Cc: armbru@redhat.com
>> Cc: berrange@redhat.com
>> Cc: kraxel@redhat.com
>> Cc: pbonzini@redhat.com
>> Cc: eblake@redhat.com
>>
>> Mao Zhongyi (4):
>>    net/socket: Don't treat odd socket type as SOCK_STREAM
>>    net/socket: Convert several helper functions to Error
>>    net/net: Convert parse_host_port() to Error
>>    net/socket: Improve -net socket error reporting
>>
>>   include/qemu/sockets.h |   3 +-
>>   net/net.c              |  22 +++++--
>>   net/socket.c           | 153 ++++++++++++++++++++++++++++---------------------
>>   3 files changed, 106 insertions(+), 72 deletions(-)
>>
>
> Hi:
>
> Want to apply this, but looks like it does not apply cleanly, could you please send a new version?
>
> Thanks

OK, I will.

Thanks,
Mao