qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PULL 5/7] util: simplify unix_listen()
Date: Mon, 13 May 2019 08:53:08 +0200	[thread overview]
Message-ID: <20190513065310.10263-6-kraxel@redhat.com> (raw)
In-Reply-To: <20190513065310.10263-1-kraxel@redhat.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

The only caller of unix_listen() left is qga/channel-posix.c.

There is no need to deal with legacy coma-trailing options ",...".

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20190503130034.24916-6-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 util/qemu-sockets.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index ba6335e71a95..8850a280a84b 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -970,26 +970,12 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)
 /* compatibility wrapper */
 int unix_listen(const char *str, Error **errp)
 {
-    char *path, *optstr;
-    int sock, len;
     UnixSocketAddress *saddr;
+    int sock;
 
     saddr = g_new0(UnixSocketAddress, 1);
-
-    optstr = strchr(str, ',');
-    if (optstr) {
-        len = optstr - str;
-        if (len) {
-            path = g_malloc(len+1);
-            snprintf(path, len+1, "%.*s", len, str);
-            saddr->path = path;
-        }
-    } else {
-        saddr->path = g_strdup(str);
-    }
-
+    saddr->path = g_strdup(str);
     sock = unix_listen_saddr(saddr, errp);
-
     qapi_free_UnixSocketAddress(saddr);
     return sock;
 }
-- 
2.18.1



  parent reply	other threads:[~2019-05-13  7:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13  6:53 [Qemu-devel] [PULL 0/7] Input 20190513 v2 patches Gerd Hoffmann
2019-05-13  6:53 ` [Qemu-devel] [PULL 1/7] libvhost-user: fix -Waddress-of-packed-member Gerd Hoffmann
2019-05-13  6:53 ` [Qemu-devel] [PULL 2/7] libvhost-user: add PROTOCOL_F_CONFIG if {set, get}_config Gerd Hoffmann
2019-05-13  6:53 ` [Qemu-devel] [PULL 3/7] Add vhost-user-backend Gerd Hoffmann
2019-05-13  6:53 ` [Qemu-devel] [PULL 4/7] Add vhost-user-input-pci Gerd Hoffmann
2019-05-13  6:53 ` Gerd Hoffmann [this message]
2019-05-13  6:53 ` [Qemu-devel] [PULL 6/7] virtio-input-host-pci: cleanup types Gerd Hoffmann
2019-05-13  6:53 ` [Qemu-devel] [PULL 7/7] virtio-input: fix Kconfig dependency and Makefile Gerd Hoffmann
2019-05-13 12:54 ` [Qemu-devel] [PULL 0/7] Input 20190513 v2 patches Peter Maydell

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=20190513065310.10263-6-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@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).