diff options
author | Markus Armbruster <armbru@redhat.com> | 2020-11-02 10:44:20 +0100 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2020-11-03 13:17:11 +0000 |
commit | dea7cd1794f33c52e4b59fe085daffb318a4bb07 (patch) | |
tree | c0f771ec5f23f74f566fe6f9fd32d584c69b283b /chardev | |
parent | 3b14b4ec49a801067da19d6b8469eb1c1911c020 (diff) |
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.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 1ee5a8c295..27a2954f47 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" : ""); |