qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <dgibson@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: qemu-devel@nongnu.org, Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH 1/3] net: socket: prepare to cleanup net_init_socket()
Date: Thu, 15 Jun 2023 15:06:52 +1000	[thread overview]
Message-ID: <20230615150652.0dacc153@zatzit> (raw)
In-Reply-To: <20230609072748.4179873-2-lvivier@redhat.com>

On Fri,  9 Jun 2023 09:27:46 +0200
Laurent Vivier <lvivier@redhat.com> wrote:

> Use directly net_socket_fd_init_stream() and net_socket_fd_init_dgram()
> when the socket type is already known.
> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>

This makes sense as a clean up regardless of the rest of the series.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>


> ---
>  net/socket.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/socket.c b/net/socket.c
> index ba6e5b0b0035..24dcaa55bc46 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -587,7 +587,7 @@ static int net_socket_connect_init(NetClientState *peer,
>              break;
>          }
>      }
> -    s = net_socket_fd_init(peer, model, name, fd, connected, NULL, errp);
> +    s = net_socket_fd_init_stream(peer, model, name, fd, connected);
>      if (!s) {
>          return -1;
>      }
> @@ -629,7 +629,7 @@ static int net_socket_mcast_init(NetClientState *peer,
>          return -1;
>      }
>  
> -    s = net_socket_fd_init(peer, model, name, fd, 0, NULL, errp);
> +    s = net_socket_fd_init_dgram(peer, model, name, fd, 0, NULL, errp);
>      if (!s) {
>          return -1;
>      }
> @@ -683,7 +683,7 @@ static int net_socket_udp_init(NetClientState *peer,
>      }
>      qemu_socket_set_nonblock(fd);
>  
> -    s = net_socket_fd_init(peer, model, name, fd, 0, NULL, errp);
> +    s = net_socket_fd_init_dgram(peer, model, name, fd, 0, NULL, errp);
>      if (!s) {
>          return -1;
>      }
> -- 
> 2.39.2
> 


-- 
David Gibson <dgibson@redhat.com>
Principal Software Engineer, Virtualization, Red Hat



  reply	other threads:[~2023-06-15  5:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09  7:27 [PATCH 0/3] net: socket: do not close file descriptor if it's not a socket Laurent Vivier
2023-06-09  7:27 ` [PATCH 1/3] net: socket: prepare to cleanup net_init_socket() Laurent Vivier
2023-06-15  5:06   ` David Gibson [this message]
2023-06-09  7:27 ` [PATCH 2/3] net: socket: move fd type checking to its own function Laurent Vivier
2023-06-15  5:09   ` David Gibson
2023-06-09  7:27 ` [PATCH 3/3] net: socket: remove net_init_socket() Laurent Vivier
2023-06-15  5:10   ` David Gibson
2023-06-30  6:02 ` [PATCH 0/3] net: socket: do not close file descriptor if it's not a socket Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230615150652.0dacc153@zatzit \
    --to=dgibson@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).