aboutsummaryrefslogtreecommitdiff
path: root/chardev
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-11-02 10:44:20 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2020-11-03 13:17:11 +0000
commitdea7cd1794f33c52e4b59fe085daffb318a4bb07 (patch)
treec0f771ec5f23f74f566fe6f9fd32d584c69b283b /chardev
parent3b14b4ec49a801067da19d6b8469eb1c1911c020 (diff)
downloadqemu-dea7cd1794f33c52e4b59fe085daffb318a4bb07.zip
qemu-dea7cd1794f33c52e4b59fe085daffb318a4bb07.tar.gz
qemu-dea7cd1794f33c52e4b59fe085daffb318a4bb07.tar.bz2
char-socket: Fix qemu_chr_socket_address() for abstract sockets
Commit 776b97d360 "qemu-sockets: add abstract UNIX domain socket support" neglected to update qemu_chr_socket_address(). It shows shows neither @abstract nor @tight. Fix that. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'chardev')
-rw-r--r--chardev/char-socket.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 1ee5a8c..27a2954 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -443,10 +443,22 @@ static char *qemu_chr_socket_address(SocketChardev *s, const char *prefix)
s->is_listen ? ",server" : "");
break;
case SOCKET_ADDRESS_TYPE_UNIX:
- return g_strdup_printf("%sunix:%s%s", prefix,
- s->addr->u.q_unix.path,
+ {
+ const char *tight = "", *abstract = "";
+ UnixSocketAddress *sa = &s->addr->u.q_unix;
+
+ if (sa->has_abstract && sa->abstract) {
+ abstract = ",abstract";
+ if (sa->has_tight && sa->tight) {
+ tight = ",tight";
+ }
+ }
+
+ return g_strdup_printf("%sunix:%s%s%s%s", prefix, sa->path,
+ abstract, tight,
s->is_listen ? ",server" : "");
break;
+ }
case SOCKET_ADDRESS_TYPE_FD:
return g_strdup_printf("%sfd:%s%s", prefix, s->addr->u.fd.str,
s->is_listen ? ",server" : "");