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
This commit is contained in:
Daniel P. Berrange 2009-07-30 16:40:29 +01:00
parent 651153216b
commit 84e96866ac
5 changed files with 13 additions and 17 deletions

View File

@ -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

View File

@ -54,7 +54,6 @@ MinGW Windows libvirt virtualization library.
--without-openvz \
--without-one \
--without-phyp \
--without-esx \
--without-netcf \
--without-libvirtd
make

View 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;
}

View File

@ -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 "

View 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 */