]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Remove network constants out of internal.h
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 5 Jul 2017 10:19:43 +0000 (11:19 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 11 Jul 2017 12:57:11 +0000 (13:57 +0100)
The HOST_NAME_MAX, INET_ADDRSTRLEN and VIR_LOOPBACK_IPV4_ADDR
constants are only used by a handful of files, so are better
kept in virsocketaddr.h or the source file that uses them.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/internal.h
src/libxl/libxl_conf.c
src/nwfilter/nwfilter_dhcpsnoop.c
src/nwfilter/nwfilter_gentech_driver.c
src/qemu/qemu_conf.c
src/util/virsocketaddr.h
src/util/virutil.c
src/vz/vz_sdk.c

index 69dff41f2788b0883b383c1890f8e17b24c6b657..2b8cc0922a5db43af75bed2d8e4a09419c176281 100644 (file)
 # include "ignore-value.h"
 # include "count-leading-zeros.h"
 
-/* On architectures which lack these limits, define them (ie. Cygwin).
- * Note that the libvirt code should be robust enough to handle the
- * case where actual value is longer than these limits (eg. by setting
- * length correctly in second argument to gethostname and by always
- * using strncpy instead of strcpy).
- */
-# ifndef HOST_NAME_MAX
-#  define HOST_NAME_MAX 256
-# endif
-
-# ifndef INET_ADDRSTRLEN
-#  define INET_ADDRSTRLEN 16
-# endif
-
-# define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1"
-
 /* String equality tests, suggested by Jim Meyering. */
 # define STREQ(a, b) (strcmp(a, b) == 0)
 # define STRCASEEQ(a, b) (c_strcasecmp(a, b) == 0)
index 938e09d9c358a55c04afb2c2eae9241c82d0af2f..a85bc71d2f00d259775acc6d047e97704ad9e41e 100644 (file)
@@ -42,6 +42,7 @@
 #include "viralloc.h"
 #include "viruuid.h"
 #include "vircommand.h"
+#include "virsocketaddr.h"
 #include "libxl_domain.h"
 #include "libxl_conf.h"
 #include "libxl_utils.h"
index 702abe18d122f7531df3aef063506a49445c706a..4436e396ff972c51260b342aad5a1444666e48ef 100644 (file)
@@ -65,6 +65,7 @@
 #include "virnetdev.h"
 #include "virfile.h"
 #include "viratomic.h"
+#include "virsocketaddr.h"
 #include "virthreadpool.h"
 #include "configmake.h"
 #include "virtime.h"
index 82e20de381e8a6005ee8d0deb3fe62eeaf9165cc..3d809fb07585f2d54f3e3c9e0d50b67eb58d4fc9 100644 (file)
@@ -37,6 +37,7 @@
 #include "nwfilter_learnipaddr.h"
 #include "virnetdev.h"
 #include "datatypes.h"
+#include "virsocketaddr.h"
 #include "virstring.h"
 
 #define VIR_FROM_THIS VIR_FROM_NWFILTER
index 73c33d67884cd7c141aba8ef787b158b25126ffa..a65c92a262e8894a40329a28a7b4a4e0e10a58a9 100644 (file)
@@ -49,6 +49,7 @@
 #include "cpu/cpu.h"
 #include "domain_nwfilter.h"
 #include "virfile.h"
+#include "virsocketaddr.h"
 #include "virstring.h"
 #include "viratomic.h"
 #include "storage_conf.h"
index 43a370620e71570c9e2dfeb1c62cd7612754b5b7..a0425864d50e3b34a7f3df78f23d3872946dfa2c 100644 (file)
 #  include <sys/un.h>
 # endif
 
+/* On architectures which lack these limits, define them (ie. Cygwin).
+ * Note that the libvirt code should be robust enough to handle the
+ * case where actual value is longer than these limits (eg. by setting
+ * length correctly in second argument to gethostname and by always
+ * using strncpy instead of strcpy).
+ */
+# ifndef INET_ADDRSTRLEN
+#  define INET_ADDRSTRLEN 16
+# endif
+
+# define VIR_LOOPBACK_IPV4_ADDR "127.0.0.1"
+
 typedef struct {
     union {
         struct sockaddr sa;
index e4de4caec91da3ad26cdf868f1c6f8addc582835..e08f9fa4ad1b4eeb6d1f55cc146e8c875eef279a 100644 (file)
@@ -581,6 +581,10 @@ char *virIndexToDiskName(int idx, const char *prefix)
 # define AI_CANONIDN 0
 #endif
 
+#ifndef HOST_NAME_MAX
+# define HOST_NAME_MAX 256
+#endif
+
 /* Who knew getting a hostname could be so delicate.  In Linux (and Unices
  * in general), many things depend on "hostname" returning a value that will
  * resolve one way or another.  In the modern world where networks frequently
index 0aa1a305ddbe41e3ca92252d3f806a0667b69ad4..c5f11a4fcdee338e98ddbbefe6f605fca3b2c53c 100644 (file)
@@ -31,6 +31,7 @@
 #include "domain_conf.h"
 #include "virtime.h"
 #include "virhostcpu.h"
+#include "virsocketaddr.h"
 
 #include "storage/storage_driver.h"
 #include "vz_sdk.h"