[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4 07/32] libxl_qmp: Move struct sockaddr_un variable to qmp_open()



On Fri, Jul 27, 2018 at 03:05:49PM +0100, Anthony PERARD wrote:
> This variable is only used once, no need to keep it in the handler.
> 
> Also fix coding style (remove space after sizeof).
> And allow strncpy to use all the space in sun_path.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> ---
> 
> Notes:
>     v4:
>         actually allow strncpy to use all the space in sun_path.
> 
>  tools/libxl/libxl_qmp.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
> index 987bf0232e..1ffa17b632 100644
> --- a/tools/libxl/libxl_qmp.c
> +++ b/tools/libxl/libxl_qmp.c
> @@ -105,7 +105,6 @@ typedef struct callback_id_pair {
>  } callback_id_pair;
>  
>  struct libxl__qmp_handler {
> -    struct sockaddr_un addr;
>      int qmp_fd;
>      bool connected;
>      time_t timeout;
> @@ -431,6 +430,7 @@ static int qmp_open(libxl__qmp_handler *qmp, const char 
> *qmp_socket_path,
>  {
>      int ret = -1;
>      int i = 0;
> +    struct sockaddr_un addr;

You could do:

struct sockaddr_un addr = { };

And get rid of the memset below.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.