From 84e96866ac70da4432a38972db2d82566c2d168c Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Thu, 30 Jul 2009 16:40:29 +0100 Subject: [PATCH] Enable ESX driver build on Mingw32 * 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 | 1 - mingw32-libvirt.spec.in | 1 - src/esx/esx_driver.c | 9 +++------ src/esx/esx_util.c | 12 ++++++++---- src/esx/esx_vi_types.c | 7 ++----- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index 239372c558..d3934ead1c 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -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 diff --git a/mingw32-libvirt.spec.in b/mingw32-libvirt.spec.in index 8fd08a6b3a..40a8124df1 100644 --- a/mingw32-libvirt.spec.in +++ b/mingw32-libvirt.spec.in @@ -54,7 +54,6 @@ MinGW Windows libvirt virtualization library. --without-openvz \ --without-one \ --without-phyp \ - --without-esx \ --without-netcf \ --without-libvirtd make diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index e3d60a5eea..e6ac00598f 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -31,9 +31,6 @@ #include -#define __STDC_FORMAT_MACROS -#include - #include #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; } diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c index 5c87ea33ee..a113fdef7d 100644 --- a/src/esx/esx_util.c +++ b/src/esx/esx_util.c @@ -41,6 +41,10 @@ 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 " diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c index 684b8c7201..e1eabcc33a 100644 --- a/src/esx/esx_vi_types.c +++ b/src/esx/esx_vi_types.c @@ -22,9 +22,6 @@ #include -#define __STDC_FORMAT_MACROS -#include - #include #include @@ -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 */ -- GitLab