mirror of
https://github.com/libvirt/libvirt.git
synced 2026-08-14 07:04:43 -05:00
Include socket address in client probe data
It is useful to know where the client is connecting from, so include the socket address in probe data. * daemon/libvirtd.h: Use virSocketAddr for storing client address and keep printable address handy for logging * daemon/libvirtd.c: Include socket address in client connect/disconnect probes * daemon/probes.d: Add socket address to probes * examples/systemtap/client.stp: Print socket address * src/util/network.h: Add sockaddr_un to virSocketAddr union
This commit is contained in:
+10
-5
@@ -48,6 +48,7 @@
|
||||
# include "qemu_protocol.h"
|
||||
# include "logging.h"
|
||||
# include "threads.h"
|
||||
# include "network.h"
|
||||
|
||||
# if WITH_DTRACE
|
||||
# ifndef LIBVIRTD_PROBES_H
|
||||
@@ -61,8 +62,8 @@
|
||||
LIBVIRTD_ ## NAME(__VA_ARGS__); \
|
||||
}
|
||||
# else
|
||||
# define PROBE(NAME, FMT, ...) \
|
||||
VIR_DEBUG_INT("trace." __FILE__, __func__, __LINE__, \
|
||||
# define PROBE(NAME, FMT, ...) \
|
||||
VIR_DEBUG_INT("trace." __FILE__, __func__, __LINE__, \
|
||||
#NAME ": " FMT, __VA_ARGS__);
|
||||
# endif
|
||||
|
||||
@@ -197,8 +198,8 @@ struct qemud_client {
|
||||
unsigned int closing :1;
|
||||
int domainEventCallbackID[VIR_DOMAIN_EVENT_ID_LAST];
|
||||
|
||||
struct sockaddr_storage addr;
|
||||
socklen_t addrlen;
|
||||
virSocketAddr addr;
|
||||
const char *addrstr;
|
||||
|
||||
int type; /* qemud_sock_type */
|
||||
gnutls_session_t tlssession;
|
||||
@@ -252,12 +253,16 @@ struct qemud_client {
|
||||
|
||||
struct qemud_socket {
|
||||
char *path;
|
||||
|
||||
virSocketAddr addr;
|
||||
const char *addrstr;
|
||||
|
||||
int fd;
|
||||
int watch;
|
||||
int readonly;
|
||||
int type; /* qemud_sock_type */
|
||||
int auth;
|
||||
int port;
|
||||
|
||||
struct qemud_socket *next;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user