aboutsummaryrefslogtreecommitdiff
path: root/util/qemu-sockets.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-05-03 15:00:33 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-05-10 14:54:11 +0200
commitcaf88d74a7aebce5c70ac6d6d72c5b1a47eb4ecf (patch)
treeebf2d60910a40b5c7a9cd91625dfd2cc929d6035 /util/qemu-sockets.c
parent9c4d05b741660958cf8769fa7ae73617fe4c67bd (diff)
util: simplify unix_listen()
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>
Diffstat (limited to 'util/qemu-sockets.c')
-rw-r--r--util/qemu-sockets.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index ba6335e71a..8850a280a8 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;
}