Signed-off-by: Daniel P. Berrangé <berra...@redhat.com>
---
 src/libvirt_remote.syms | 1 +
 src/rpc/virnetsocket.c  | 8 ++++++++
 src/rpc/virnetsocket.h  | 1 +
 3 files changed, 10 insertions(+)

diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
index b63eac123f..99fe3dd07c 100644
--- a/src/libvirt_remote.syms
+++ b/src/libvirt_remote.syms
@@ -219,6 +219,7 @@ virNetSocketCheckProtocols;
 virNetSocketClose;
 virNetSocketDupFD;
 virNetSocketGetFD;
+virNetSocketGetPath;
 virNetSocketGetPort;
 virNetSocketGetSELinuxContext;
 virNetSocketGetUNIXIdentity;
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index bfa1952989..254f39c4ec 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -1408,6 +1408,14 @@ bool virNetSocketHasPassFD(virNetSocketPtr sock)
     return hasPassFD;
 }
 
+char *virNetSocketGetPath(virNetSocketPtr sock)
+{
+    char *path = NULL;
+    virObjectLock(sock);
+    path = virSocketAddrGetPath(&sock->localAddr);
+    virObjectUnlock(sock);
+    return path;
+}
 
 int virNetSocketGetPort(virNetSocketPtr sock)
 {
diff --git a/src/rpc/virnetsocket.h b/src/rpc/virnetsocket.h
index 343c8f43e0..de5a465cde 100644
--- a/src/rpc/virnetsocket.h
+++ b/src/rpc/virnetsocket.h
@@ -127,6 +127,7 @@ bool virNetSocketIsLocal(virNetSocketPtr sock);
 
 bool virNetSocketHasPassFD(virNetSocketPtr sock);
 
+char *virNetSocketGetPath(virNetSocketPtr sock);
 int virNetSocketGetPort(virNetSocketPtr sock);
 
 int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to