src: convert all code to use virsocket.h

There are a large number of different header files that
are related to the sockets APIs. The virsocket.h header
includes all of the relevant headers for Windows and UNIX
in one convenient place. If virsocketaddr.h is already
included, then there's no need for virsocket.h

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-01-14 17:38:59 +00:00
parent a464220430
commit fc920f704c
41 changed files with 43 additions and 130 deletions

View File

@ -231,9 +231,13 @@ AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"]) AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"])
AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"]) AM_CONDITIONAL([WITH_MACOS], [test "$with_macos" = "yes"])
# We don't support the daemon yet
if test "$with_win" = "yes" ; then if test "$with_win" = "yes" ; then
# We don't support the daemon yet
with_libvirtd=no with_libvirtd=no
# For AI_ADDRCONFIG
AC_DEFINE([_WIN32_WINNT], [0x0600], [Win Vista / Server 2008])
AC_DEFINE([WINVER], [0x0600], [Win Vista / Server 2008])
fi fi
# The daemon requires remote support. Likewise, if we are not using # The daemon requires remote support. Likewise, if we are not using
@ -382,7 +386,6 @@ AC_CHECK_HEADERS([\
linux/magic.h \ linux/magic.h \
mntent.h \ mntent.h \
net/ethernet.h \ net/ethernet.h \
netinet/tcp.h \
net/if.h \ net/if.h \
pty.h \ pty.h \
pwd.h \ pwd.h \
@ -393,7 +396,6 @@ AC_CHECK_HEADERS([\
sys/syscall.h \ sys/syscall.h \
sys/sysctl.h \ sys/sysctl.h \
sys/ucred.h \ sys/ucred.h \
sys/un.h \
]) ])
dnl Check whether endian provides handy macros. dnl Check whether endian provides handy macros.
AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]]) AC_CHECK_DECLS([htole64], [], [], [[#include <endian.h>]])

View File

@ -22,8 +22,6 @@
#include <config.h> #include <config.h>
#include <unistd.h> #include <unistd.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -23,8 +23,6 @@
#include <config.h> #include <config.h>
#include <netdb.h>
#include "internal.h" #include "internal.h"
#include "datatypes.h" #include "datatypes.h"
#include "viralloc.h" #include "viralloc.h"
@ -34,6 +32,7 @@
#include "esx_private.h" #include "esx_private.h"
#include "esx_util.h" #include "esx_util.h"
#include "virstring.h" #include "virstring.h"
#include "virsocket.h"
#define VIR_FROM_THIS VIR_FROM_ESX #define VIR_FROM_THIS VIR_FROM_ESX

View File

@ -21,7 +21,6 @@
#pragma once #pragma once
#include <netdb.h>
#include "internal.h" #include "internal.h"
#include "viruri.h" #include "viruri.h"

View File

@ -24,7 +24,6 @@
#include <libxl.h> #include <libxl.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h>
#include "internal.h" #include "internal.h"
#include "virlog.h" #include "virlog.h"
@ -48,7 +47,6 @@
#include "virnetdevvportprofile.h" #include "virnetdevvportprofile.h"
#include "virenum.h" #include "virenum.h"
#define VIR_FROM_THIS VIR_FROM_LIBXL #define VIR_FROM_THIS VIR_FROM_LIBXL
VIR_LOG_INIT("libxl.libxl_conf"); VIR_LOG_INIT("libxl.libxl_conf");

View File

@ -23,7 +23,6 @@
#include <sys/epoll.h> #include <sys/epoll.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/socket.h>
#ifdef MAJOR_IN_MKDEV #ifdef MAJOR_IN_MKDEV
# include <sys/mkdev.h> # include <sys/mkdev.h>
@ -31,8 +30,6 @@
# include <sys/sysmacros.h> # include <sys/sysmacros.h>
#endif #endif
#include <sys/types.h>
#include <sys/un.h>
#include <sys/personality.h> #include <sys/personality.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -69,6 +66,7 @@
#include "rpc/virnetdaemon.h" #include "rpc/virnetdaemon.h"
#include "virstring.h" #include "virstring.h"
#include "virgettext.h" #include "virgettext.h"
#include "virsocket.h"
#define VIR_FROM_THIS VIR_FROM_LXC #define VIR_FROM_THIS VIR_FROM_LXC

View File

@ -31,10 +31,7 @@
# include <sys/sysmacros.h> # include <sys/sysmacros.h>
#endif #endif
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/un.h>
#include <sys/poll.h> #include <sys/poll.h>
#include <unistd.h> #include <unistd.h>
#include <wait.h> #include <wait.h>
@ -75,6 +72,7 @@
#include "viraccessapichecklxc.h" #include "viraccessapichecklxc.h"
#include "virhostdev.h" #include "virhostdev.h"
#include "netdev_bandwidth_conf.h" #include "netdev_bandwidth_conf.h"
#include "virsocket.h"
#define VIR_FROM_THIS VIR_FROM_LXC #define VIR_FROM_THIS VIR_FROM_LXC

View File

@ -43,9 +43,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <poll.h> #include <poll.h>
#include <arpa/inet.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <net/if.h> #include <net/if.h>
#include "viralloc.h" #include "viralloc.h"

View File

@ -31,10 +31,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <poll.h> #include <poll.h>
#include <arpa/inet.h>
#include <net/ethernet.h> #include <net/ethernet.h>
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <net/if_arp.h> #include <net/if_arp.h>
#include "internal.h" #include "internal.h"
@ -53,6 +50,7 @@
#include "nwfilter_ipaddrmap.h" #include "nwfilter_ipaddrmap.h"
#include "nwfilter_learnipaddr.h" #include "nwfilter_learnipaddr.h"
#include "virstring.h" #include "virstring.h"
#include "virsocket.h"
#define VIR_FROM_THIS VIR_FROM_NWFILTER #define VIR_FROM_THIS VIR_FROM_NWFILTER

View File

@ -21,9 +21,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <poll.h> #include <poll.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -41,6 +38,7 @@
#include "virobject.h" #include "virobject.h"
#include "virstring.h" #include "virstring.h"
#include "virenum.h" #include "virenum.h"
#include "virsocket.h"
#define VIR_FROM_THIS VIR_FROM_QEMU #define VIR_FROM_THIS VIR_FROM_QEMU

View File

@ -26,7 +26,6 @@
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <arpa/inet.h>
#include "virerror.h" #include "virerror.h"
#include "qemu_conf.h" #include "qemu_conf.h"
@ -44,7 +43,7 @@
#include "cpu/cpu.h" #include "cpu/cpu.h"
#include "domain_nwfilter.h" #include "domain_nwfilter.h"
#include "virfile.h" #include "virfile.h"
#include "virsocketaddr.h" #include "virsocket.h"
#include "virstring.h" #include "virstring.h"
#include "viratomic.h" #include "viratomic.h"
#include "storage_conf.h" #include "storage_conf.h"

View File

@ -32,8 +32,6 @@
#include <signal.h> #include <signal.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/un.h>
#include "qemu_driver.h" #include "qemu_driver.h"
#include "qemu_agent.h" #include "qemu_agent.h"
@ -104,6 +102,7 @@
#include "virdomainsnapshotobjlist.h" #include "virdomainsnapshotobjlist.h"
#include "virenum.h" #include "virenum.h"
#include "virdomaincheckpointobjlist.h" #include "virdomaincheckpointobjlist.h"
#include "virsocket.h"
#define VIR_FROM_THIS VIR_FROM_QEMU #define VIR_FROM_THIS VIR_FROM_QEMU

View File

@ -21,8 +21,6 @@
#include <config.h> #include <config.h>
#include <netdb.h>
#include <sys/socket.h>
#include <sys/time.h> #include <sys/time.h>
#include <fcntl.h> #include <fcntl.h>
#include <poll.h> #include <poll.h>
@ -62,6 +60,7 @@
#include "virprocess.h" #include "virprocess.h"
#include "nwfilter_conf.h" #include "nwfilter_conf.h"
#include "virdomainsnapshotobjlist.h" #include "virdomainsnapshotobjlist.h"
#include "virsocket.h"
#define VIR_FROM_THIS VIR_FROM_QEMU #define VIR_FROM_THIS VIR_FROM_QEMU

View File

@ -22,8 +22,6 @@
#include <config.h> #include <config.h>
#include <poll.h> #include <poll.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -41,6 +39,7 @@
#include "virprobe.h" #include "virprobe.h"
#include "virstring.h" #include "virstring.h"
#include "virtime.h" #include "virtime.h"
#include "virsocket.h"
#ifdef WITH_DTRACE_PROBES #ifdef WITH_DTRACE_PROBES
# include "libvirt_qemu_probes.h" # include "libvirt_qemu_probes.h"

View File

@ -21,9 +21,6 @@
#include <config.h> #include <config.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <poll.h> #include <poll.h>
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
@ -41,6 +38,7 @@
#include "virstring.h" #include "virstring.h"
#include "cpu/cpu_x86.h" #include "cpu/cpu_x86.h"
#include "virenum.h" #include "virenum.h"
#include "virsocket.h"
#ifdef WITH_DTRACE_PROBES #ifdef WITH_DTRACE_PROBES
# include "libvirt_qemu_probes.h" # include "libvirt_qemu_probes.h"

View File

@ -22,7 +22,6 @@
%#include "internal.h" %#include "internal.h"
%#include "remote_protocol.h" %#include "remote_protocol.h"
%#include <arpa/inet.h>
/*----- Protocol. -----*/ /*----- Protocol. -----*/
struct qemu_domain_monitor_command_args { struct qemu_domain_monitor_command_args {

View File

@ -37,7 +37,7 @@
%#include <libvirt/libvirt.h> %#include <libvirt/libvirt.h>
%#include "internal.h" %#include "internal.h"
%#include "virxdrdefs.h" %#include "virxdrdefs.h"
%#include <arpa/inet.h> %#include "virsocket.h"
/*----- Data types. -----*/ /*----- Data types. -----*/

View File

@ -20,7 +20,7 @@
%#include "internal.h" %#include "internal.h"
%#include "virxdrdefs.h" %#include "virxdrdefs.h"
%#include <arpa/inet.h> %#include "virsocket.h"
/*----- Data types. -----*/ /*----- Data types. -----*/

View File

@ -22,7 +22,6 @@
#include <config.h> #include <config.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/socket.h>
#include <unistd.h> #include <unistd.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <signal.h> #include <signal.h>
@ -30,11 +29,6 @@
#ifdef HAVE_IFADDRS_H #ifdef HAVE_IFADDRS_H
# include <ifaddrs.h> # include <ifaddrs.h>
#endif #endif
#include <netdb.h>
#ifdef HAVE_NETINET_TCP_H
# include <netinet/tcp.h>
#endif
#ifdef HAVE_SYS_UCRED_H #ifdef HAVE_SYS_UCRED_H
# include <sys/ucred.h> # include <sys/ucred.h>
@ -459,7 +453,7 @@ int virNetSocketNewListenTCP(const char *nodename,
} }
#if HAVE_SYS_UN_H #ifndef WIN32
int virNetSocketNewListenUNIX(const char *path, int virNetSocketNewListenUNIX(const char *path,
mode_t mask, mode_t mask,
uid_t user, uid_t user,
@ -645,7 +639,7 @@ int virNetSocketNewConnectTCP(const char *nodename,
} }
#ifdef HAVE_SYS_UN_H #ifndef WIN32
int virNetSocketNewConnectUNIX(const char *path, int virNetSocketNewConnectUNIX(const char *path,
bool spawnDaemon, bool spawnDaemon,
const char *binary, const char *binary,
@ -1345,7 +1339,7 @@ void virNetSocketDispose(void *obj)
sock->watch = -1; sock->watch = -1;
} }
#ifdef HAVE_SYS_UN_H #ifndef WIN32
/* If a server socket, then unlink UNIX path */ /* If a server socket, then unlink UNIX path */
if (sock->unlinkUNIX && if (sock->unlinkUNIX &&
sock->localAddr.data.sa.sa_family == AF_UNIX && sock->localAddr.data.sa.sa_family == AF_UNIX &&
@ -2273,7 +2267,7 @@ void virNetSocketClose(virNetSocketPtr sock)
sock->fd = -1; sock->fd = -1;
} }
#ifdef HAVE_SYS_UN_H #ifndef WIN32
/* If a server socket, then unlink UNIX path */ /* If a server socket, then unlink UNIX path */
if (sock->unlinkUNIX && if (sock->unlinkUNIX &&
sock->localAddr.data.sa.sa_family == AF_UNIX && sock->localAddr.data.sa.sa_family == AF_UNIX &&

View File

@ -20,7 +20,6 @@
#include <config.h> #include <config.h>
#include <arpa/inet.h>
#ifdef __linux__ #ifdef __linux__
# include <linux/rtnetlink.h> # include <linux/rtnetlink.h>
#endif #endif

View File

@ -25,12 +25,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <sys/socket.h>
#include <sys/wait.h> #include <sys/wait.h>
#if HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#include <netinet/in.h>
#ifndef WIN32 #ifndef WIN32
# include <termios.h> # include <termios.h>
#endif #endif
@ -46,6 +41,7 @@
#include "virstring.h" #include "virstring.h"
#include "virtime.h" #include "virtime.h"
#include "virprocess.h" #include "virprocess.h"
#include "virsocket.h"
#define VIR_FROM_THIS VIR_FROM_STREAMS #define VIR_FROM_THIS VIR_FROM_STREAMS
@ -1163,7 +1159,7 @@ int virFDStreamOpen(virStreamPtr st,
} }
#if HAVE_SYS_UN_H #ifndef WIN32
int virFDStreamConnectUNIX(virStreamPtr st, int virFDStreamConnectUNIX(virStreamPtr st,
const char *path, const char *path,
bool abstract) bool abstract)

View File

@ -42,8 +42,6 @@
# include <libutil.h> # include <libutil.h>
#endif /* !HAVE_LIBUTIL_H */ #endif /* !HAVE_LIBUTIL_H */
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h> #include <sys/wait.h>
#if defined(HAVE_SYS_MOUNT_H) #if defined(HAVE_SYS_MOUNT_H)
# include <sys/mount.h> # include <sys/mount.h>
@ -90,6 +88,7 @@
#include "virprocess.h" #include "virprocess.h"
#include "virstring.h" #include "virstring.h"
#include "virutil.h" #include "virutil.h"
#include "virsocket.h"
#define VIR_FROM_THIS VIR_FROM_NONE #define VIR_FROM_THIS VIR_FROM_NONE

View File

@ -24,17 +24,12 @@
#include <stdarg.h> #include <stdarg.h>
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#if HAVE_SYSLOG_H #if HAVE_SYSLOG_H
# include <syslog.h> # include <syslog.h>
#endif #endif
#include <sys/socket.h>
#if HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#include "virerror.h" #include "virerror.h"
#include "virlog.h" #include "virlog.h"
@ -46,6 +41,7 @@
#include "virtime.h" #include "virtime.h"
#include "virstring.h" #include "virstring.h"
#include "configmake.h" #include "configmake.h"
#include "virsocket.h"
/* Journald output is only supported on Linux new enough to expose /* Journald output is only supported on Linux new enough to expose
* htole64. */ * htole64. */

View File

@ -26,15 +26,11 @@
#include "viralloc.h" #include "viralloc.h"
#include "virlog.h" #include "virlog.h"
#include "virstring.h" #include "virstring.h"
#include "virsocket.h"
#ifndef WIN32
# include <sys/ioctl.h>
#endif
#include <sys/socket.h>
#ifdef HAVE_NET_IF #ifdef HAVE_NET_IF
# include <net/if.h> # include <net/if.h>
#endif #endif
#include <netinet/in.h>
#ifdef __linux__ #ifdef __linux__
# if defined(HAVE_LIBNL) # if defined(HAVE_LIBNL)

View File

@ -42,8 +42,6 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode,
#if WITH_MACVTAP #if WITH_MACVTAP
# include <fcntl.h> # include <fcntl.h>
# include <sys/socket.h>
# include <sys/ioctl.h>
# include <net/if.h> # include <net/if.h>
# include <linux/if_tun.h> # include <linux/if_tun.h>
@ -61,6 +59,7 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode,
# include "virnetdev.h" # include "virnetdev.h"
# include "virpidfile.h" # include "virpidfile.h"
# include "virbitmap.h" # include "virbitmap.h"
# include "virsocket.h"
VIR_LOG_INIT("util.netdevmacvlan"); VIR_LOG_INIT("util.netdevmacvlan");

View File

@ -49,8 +49,6 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp,
#if WITH_VIRTUALPORT #if WITH_VIRTUALPORT
# include <fcntl.h> # include <fcntl.h>
# include <sys/socket.h>
# include <sys/ioctl.h>
# include <net/if.h> # include <net/if.h>
# include <linux/if_tun.h> # include <linux/if_tun.h>
@ -59,6 +57,7 @@ VIR_ENUM_IMPL(virNetDevVPortProfileOp,
# include "virfile.h" # include "virfile.h"
# include "virlog.h" # include "virlog.h"
# include "virnetdev.h" # include "virnetdev.h"
# include "virsocket.h"
VIR_LOG_INIT("util.netdevvportprofile"); VIR_LOG_INIT("util.netdevvportprofile");

View File

@ -24,8 +24,6 @@
#include <config.h> #include <config.h>
#include <unistd.h> #include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include "virnetlink.h" #include "virnetlink.h"
#include "virnetdev.h" #include "virnetdev.h"
@ -34,6 +32,7 @@
#include "virmacaddr.h" #include "virmacaddr.h"
#include "virerror.h" #include "virerror.h"
#include "viralloc.h" #include "viralloc.h"
#include "virsocket.h"
#define VIR_FROM_THIS VIR_FROM_NET #define VIR_FROM_THIS VIR_FROM_NET

View File

@ -79,13 +79,14 @@ int vir_socket(int domain, int type, int protocol);
#else #else
# include <sys/socket.h> # include <sys/socket.h>
# include <unistd.h>
# include <sys/ioctl.h> # include <sys/ioctl.h>
# include <arpa/inet.h> # include <arpa/inet.h>
# include <netinet/ip.h>
# include <netinet/in.h> # include <netinet/in.h>
# include <netinet/udp.h> # include <netinet/udp.h>
# include <netinet/tcp.h> # include <netinet/tcp.h>
# include <sys/un.h> # include <sys/un.h>
# include <netdb.h>
# define closesocket close # define closesocket close
# define ioctlsocket ioctl # define ioctlsocket ioctl

View File

@ -24,8 +24,6 @@
#include "virbuffer.h" #include "virbuffer.h"
#include "viralloc.h" #include "viralloc.h"
#include <netdb.h>
#define VIR_FROM_THIS VIR_FROM_NONE #define VIR_FROM_THIS VIR_FROM_NONE
/* /*

View File

@ -18,13 +18,7 @@
#pragma once #pragma once
#include <netinet/in.h> #include "virsocket.h"
#include <sys/socket.h>
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#include "internal.h"
#define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1" #define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1"
@ -34,7 +28,7 @@ typedef struct {
struct sockaddr_storage stor; struct sockaddr_storage stor;
struct sockaddr_in inet4; struct sockaddr_in inet4;
struct sockaddr_in6 inet6; struct sockaddr_in6 inet6;
#ifdef HAVE_SYS_UN_H #ifndef WIN32
struct sockaddr_un un; struct sockaddr_un un;
#endif #endif
} data; } data;

View File

@ -21,11 +21,6 @@
#include <config.h> #include <config.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#define LIBVIRT_VIRSYSTEMDPRIV_H_ALLOW #define LIBVIRT_VIRSYSTEMDPRIV_H_ALLOW
#include "virsystemdpriv.h" #include "virsystemdpriv.h"
@ -515,7 +510,7 @@ int virSystemdTerminateMachine(const char *name)
void void
virSystemdNotifyStartup(void) virSystemdNotifyStartup(void)
{ {
#ifdef HAVE_SYS_UN_H #ifndef WIN32
const char *path; const char *path;
const char *msg = "READY=1"; const char *msg = "READY=1";
int fd; int fd;
@ -559,7 +554,7 @@ virSystemdNotifyStartup(void)
VIR_WARN("Failed to notify systemd"); VIR_WARN("Failed to notify systemd");
VIR_FORCE_CLOSE(fd); VIR_FORCE_CLOSE(fd);
#endif /* HAVE_SYS_UN_H */ #endif /* !WIN32 */
} }
static int static int

View File

@ -44,7 +44,6 @@
# include <libdevmapper.h> # include <libdevmapper.h>
#endif #endif
#include <netdb.h>
#ifdef HAVE_GETPWUID_R #ifdef HAVE_GETPWUID_R
# include <pwd.h> # include <pwd.h>
# include <grp.h> # include <grp.h>
@ -54,18 +53,6 @@
# include <sys/prctl.h> # include <sys/prctl.h>
#endif #endif
#ifdef WIN32
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
# include <windows.h>
# include <shlobj.h>
#endif
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#include "virerror.h" #include "virerror.h"
#include "virlog.h" #include "virlog.h"
#include "virbuffer.h" #include "virbuffer.h"

View File

@ -22,11 +22,6 @@
#include <config.h> #include <config.h>
#ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
#endif
#include <windows.h>
#define nsCID CLSID #define nsCID CLSID
#include "internal.h" #include "internal.h"
@ -35,6 +30,7 @@
#include "virerror.h" #include "virerror.h"
#include "virstring.h" #include "virstring.h"
#include "virutil.h" #include "virutil.h"
#include "virsocket.h"
#include "vbox_MSCOMGlue.h" #include "vbox_MSCOMGlue.h"
#define VIR_FROM_THIS VIR_FROM_VBOX #define VIR_FROM_THIS VIR_FROM_VBOX

View File

@ -27,9 +27,9 @@
# include <libxl.h> # include <libxl.h>
# include <xenstore.h> # include <xenstore.h>
# include <xenctrl.h> # include <xenctrl.h>
# include <sys/socket.h>
# include "virfile.h" # include "virfile.h"
# include "virsocket.h"
VIR_MOCK_IMPL_RET_VOID(xs_daemon_open, VIR_MOCK_IMPL_RET_VOID(xs_daemon_open,
struct xs_handle *) struct xs_handle *)

View File

@ -22,9 +22,8 @@
#ifdef NSS #ifdef NSS
# include <arpa/inet.h>
# include "libvirt_nss.h" # include "libvirt_nss.h"
# include "virsocketaddr.h" # include "virsocket.h"
# define VIR_FROM_THIS VIR_FROM_NONE # define VIR_FROM_THIS VIR_FROM_NONE

View File

@ -22,7 +22,6 @@
#ifdef HAVE_IFADDRS_H #ifdef HAVE_IFADDRS_H
# include <ifaddrs.h> # include <ifaddrs.h>
#endif #endif
#include <netdb.h>
#include "testutils.h" #include "testutils.h"
#include "virutil.h" #include "virutil.h"

View File

@ -19,7 +19,6 @@
#include <config.h> #include <config.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/socket.h>
#include "testutils.h" #include "testutils.h"
#include "virnettlshelpers.h" #include "virnettlshelpers.h"
@ -29,7 +28,7 @@
#include "virlog.h" #include "virlog.h"
#include "virfile.h" #include "virfile.h"
#include "vircommand.h" #include "vircommand.h"
#include "virsocketaddr.h" #include "virsocket.h"
#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600 #if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600

View File

@ -19,7 +19,6 @@
#include <config.h> #include <config.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/socket.h>
#include "virnettlshelpers.h" #include "virnettlshelpers.h"
#include "viralloc.h" #include "viralloc.h"

View File

@ -19,7 +19,6 @@
#include <config.h> #include <config.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/socket.h>
#include "testutils.h" #include "testutils.h"
#include "virnettlshelpers.h" #include "virnettlshelpers.h"
@ -29,7 +28,7 @@
#include "virlog.h" #include "virlog.h"
#include "virfile.h" #include "virfile.h"
#include "vircommand.h" #include "vircommand.h"
#include "virsocketaddr.h" #include "virsocket.h"
#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600 #if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >= 0x020600

View File

@ -23,10 +23,7 @@
#endif #endif
#if defined(__linux__) && defined(RTLD_NEXT) #if defined(__linux__) && defined(RTLD_NEXT)
# include "internal.h" # include "virsocket.h"
# include <sys/socket.h>
# include <arpa/inet.h>
# include <netinet/in.h>
# include <unistd.h> # include <unistd.h>
static bool host_has_ipv6; static bool host_has_ipv6;

View File

@ -20,16 +20,11 @@
#include "virmock.h" #include "virmock.h"
#include <unistd.h> #include <unistd.h>
#include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/file.h> #include <sys/file.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#include "internal.h" #include "virsocket.h"
#include "configmake.h" #include "configmake.h"
#include "virstring.h" #include "virstring.h"
#include "viralloc.h" #include "viralloc.h"
@ -202,7 +197,7 @@ int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
{ {
init_syms(); init_syms();
#ifdef HAVE_SYS_UN_H #ifndef WIN32
if (addrlen == sizeof(struct sockaddr_un)) { if (addrlen == sizeof(struct sockaddr_un)) {
struct sockaddr_un *tmp = (struct sockaddr_un *) addr; struct sockaddr_un *tmp = (struct sockaddr_un *) addr;
if (tmp->sun_family == AF_UNIX) if (tmp->sun_family == AF_UNIX)