qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH 1/4] qga: drop unused sockaddr in accept(2) call
Date: Thu,  6 Oct 2016 17:40:15 +0100	[thread overview]
Message-ID: <1475772018-27484-2-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1475772018-27484-1-git-send-email-stefanha@redhat.com>

ga_channel_listen_accept() is currently hard-coded to support only
AF_UNIX because the struct sockaddr_un type is used.  This function
should work with any address family.

Drop the sockaddr since the client address is unused and is an optional
argument to accept(2).

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 qga/channel-posix.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index bb65d8b..bf32158 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -26,13 +26,10 @@ static gboolean ga_channel_listen_accept(GIOChannel *channel,
     GAChannel *c = data;
     int ret, client_fd;
     bool accepted = false;
-    struct sockaddr_un addr;
-    socklen_t addrlen = sizeof(addr);
 
     g_assert(channel != NULL);
 
-    client_fd = qemu_accept(g_io_channel_unix_get_fd(channel),
-                            (struct sockaddr *)&addr, &addrlen);
+    client_fd = qemu_accept(g_io_channel_unix_get_fd(channel), NULL, NULL);
     if (client_fd == -1) {
         g_warning("error converting fd to gsocket: %s", strerror(errno));
         goto out;
-- 
2.7.4

  reply	other threads:[~2016-10-06 16:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06 16:40 [Qemu-devel] [PATCH 0/4] qga: add vsock-listen Stefan Hajnoczi
2016-10-06 16:40 ` Stefan Hajnoczi [this message]
2016-10-07 16:01   ` [Qemu-devel] [PATCH 1/4] qga: drop unused sockaddr in accept(2) call Michael Roth
2016-10-06 16:40 ` [Qemu-devel] [PATCH 2/4] qga: drop unnecessary GA_CHANNEL_UNIX_LISTEN checks Stefan Hajnoczi
2016-10-07 16:04   ` Michael Roth
2016-10-06 16:40 ` [Qemu-devel] [PATCH 3/4] sockets: add AF_VSOCK support Stefan Hajnoczi
2016-10-06 18:14   ` Eric Blake
2016-10-07 12:21     ` Stefan Hajnoczi
2016-10-07 16:42   ` Michael Roth
2016-10-12 15:06     ` Stefan Hajnoczi
2016-10-13 20:20       ` Michael Roth
2016-10-06 16:40 ` [Qemu-devel] [PATCH 4/4] qga: add vsock-listen method Stefan Hajnoczi
2016-10-07 17:07   ` Michael Roth
2016-10-12 15:07     ` Stefan Hajnoczi
2016-10-13 20:29       ` Michael Roth

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=1475772018-27484-2-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=mdroth@linux.vnet.ibm.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).