提交 836f4e06 编写于 作者: D Daniel P. Berrangé

rpc: add helper API for getting UNIX path from socket object

Reviewed-by: NJán Tomko <jtomko@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 a767af1a
...@@ -219,6 +219,7 @@ virNetSocketCheckProtocols; ...@@ -219,6 +219,7 @@ virNetSocketCheckProtocols;
virNetSocketClose; virNetSocketClose;
virNetSocketDupFD; virNetSocketDupFD;
virNetSocketGetFD; virNetSocketGetFD;
virNetSocketGetPath;
virNetSocketGetPort; virNetSocketGetPort;
virNetSocketGetSELinuxContext; virNetSocketGetSELinuxContext;
virNetSocketGetUNIXIdentity; virNetSocketGetUNIXIdentity;
......
...@@ -1408,6 +1408,14 @@ bool virNetSocketHasPassFD(virNetSocketPtr sock) ...@@ -1408,6 +1408,14 @@ bool virNetSocketHasPassFD(virNetSocketPtr sock)
return hasPassFD; return hasPassFD;
} }
char *virNetSocketGetPath(virNetSocketPtr sock)
{
char *path = NULL;
virObjectLock(sock);
path = virSocketAddrGetPath(&sock->localAddr);
virObjectUnlock(sock);
return path;
}
int virNetSocketGetPort(virNetSocketPtr sock) int virNetSocketGetPort(virNetSocketPtr sock)
{ {
......
...@@ -127,6 +127,7 @@ bool virNetSocketIsLocal(virNetSocketPtr sock); ...@@ -127,6 +127,7 @@ bool virNetSocketIsLocal(virNetSocketPtr sock);
bool virNetSocketHasPassFD(virNetSocketPtr sock); bool virNetSocketHasPassFD(virNetSocketPtr sock);
char *virNetSocketGetPath(virNetSocketPtr sock);
int virNetSocketGetPort(virNetSocketPtr sock); int virNetSocketGetPort(virNetSocketPtr sock);
int virNetSocketGetUNIXIdentity(virNetSocketPtr sock, int virNetSocketGetUNIXIdentity(virNetSocketPtr sock,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册