]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Enable ESX driver build on Mingw32
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 30 Jul 2009 15:40:29 +0000 (16:40 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 31 Jul 2009 15:15:51 +0000 (16:15 +0100)
* autobuild.sh, mingw32-libvirt.spec.in: Enable esx on mingw32
* src/esx/esx_driver.c: Define AI_ADDRCONFIG if not set
* src/esx/esx_util.c, src/esx/esx_vi_types.c: Always use
  %lld & friends, since gnulib guarentees we have these
  and not the target's own variants

autobuild.sh
mingw32-libvirt.spec.in
src/esx/esx_driver.c
src/esx/esx_util.c
src/esx/esx_vi_types.c

index 239372c558c5b96afdc5311f008957d3e50388f3..d3934ead1c2e6c16656d2e7d5183976e0e121b47 100755 (executable)
@@ -78,7 +78,6 @@ if [ -x /usr/bin/i686-pc-mingw32-gcc ]; then
     --without-openvz \
     --without-one \
     --without-phyp \
-    --without-esx \
     --without-netcf \
     --without-libvirtd
 
index 8fd08a6b3ad88fc833dca2fa25ce11889713115a..40a8124df114f4c65832c81b6057a2866595cadf 100644 (file)
@@ -54,7 +54,6 @@ MinGW Windows libvirt virtualization library.
   --without-openvz \
   --without-one \
   --without-phyp \
-  --without-esx \
   --without-netcf \
   --without-libvirtd
 make
index e3d60a5eeaa994f669e9746b0f9cae5cf11f50c5..e6ac00598f33952313581dfebf3563790ce1ee5c 100644 (file)
@@ -31,9 +31,6 @@
 
 #include <config.h>
 
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
-
 #include <netdb.h>
 
 #include "internal.h"
@@ -1769,7 +1766,7 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
                 for (value = perfMetricIntSeries->value;
                      value != NULL;
                      value = value->_next) {
-                    VIR_DEBUG("value %"PRIi64, value->value);
+                    VIR_DEBUG("value %lld", (long long int)value->value);
                 }
             }
         }
@@ -2399,8 +2396,8 @@ esxDomainGetSchedulerParameters(virDomainPtr domain,
 
               default:
                 ESX_ERROR(domain->conn, VIR_ERR_INTERNAL_ERROR,
-                          "Shares level has unknown value %"PRIi32,
-                          sharesInfo->level);
+                          "Shares level has unknown value %d",
+                          (int)sharesInfo->level);
                 goto failure;
             }
 
index 5c87ea33ee1a3e7c42dc0a41f312ecccab63bc1e..a113fdef7d2291e6364cc1a52e416f774aa6cc2a 100644 (file)
     virReportErrorHelper (conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,   \
                           __LINE__, fmt)
 
+/* AI_ADDRCONFIG is missing on some systems. */
+#ifndef AI_ADDRCONFIG
+# define AI_ADDRCONFIG 0
+#endif
 
 
 char *
@@ -435,12 +439,12 @@ esxUtil_GetConfigLong(virConnectPtr conn, virConfPtr conf, const char *name,
 
 int
 esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
-                         const char *name, int *boolean, int default_,
+                         const char *name, int *boolval, int default_,
                          int optional)
 {
     virConfValuePtr value;
 
-    *boolean = default_;
+    *boolval = default_;
     value = virConfGetValue(conf, name);
 
     if (value == NULL) {
@@ -465,9 +469,9 @@ esxUtil_GetConfigBoolean(virConnectPtr conn, virConfPtr conf,
         }
 
         if (STRCASEEQ(value->str, "true")) {
-            *boolean = 1;
+            *boolval = 1;
         } else if (STRCASEEQ(value->str, "false")) {
-            *boolean = 0;
+            *boolval = 0;
         } else {
             ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR,
                       "Config entry '%s' must represent a boolean value "
index 684b8c7201f711b1f0b4ff965f064b65bb8ca031..e1eabcc33a1b1fb7265d6f25039409f0cd8a6b3a 100644 (file)
@@ -22,9 +22,6 @@
 
 #include <config.h>
 
-#define __STDC_FORMAT_MACROS
-#include <inttypes.h>
-
 #include <libxml/parser.h>
 #include <libxml/xpathInternals.h>
 
@@ -962,7 +959,7 @@ esxVI_Int_DeepCopy(virConnectPtr conn, esxVI_Int **dest, esxVI_Int *src)
 /* esxVI_Int_Serialize */
 ESX_VI__TEMPLATE__SERIALIZE_EXTRA(Int, "xsd:int",
 {
-    virBufferVSprintf(output, "%"PRIi32, item->value);
+    virBufferVSprintf(output, "%d", (int)item->value);
 });
 
 /* esxVI_Int_SerializeList */
@@ -992,7 +989,7 @@ ESX_VI__TEMPLATE__LIST__APPEND(Long);
 /* esxVI_Long_Serialize */
 ESX_VI__TEMPLATE__SERIALIZE_EXTRA(Long, "xsd:long",
 {
-    virBufferVSprintf(output, "%"PRIi64, item->value);
+    virBufferVSprintf(output, "%lld", (long long int)item->value);
 });
 
 /* esxVI_Long_SerializeList */