mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 04:25:19 +00:00
Compilation fixes for MinGW
This commit is contained in:
parent
9c593643ff
commit
fbb5d771a0
@ -1,3 +1,12 @@
|
|||||||
|
Thu Jun 26 18:25:25 JST 2008 Atsushi SAKAI <sakaia@jp.fujitsu.com>
|
||||||
|
|
||||||
|
Compilation fix for MinGW
|
||||||
|
* src/driver.h src/internal.h src/libvirt.c src/qemu_driver.c
|
||||||
|
src/remote_internal.c: add WITH_LIBVIRTD flag consideration
|
||||||
|
* tests/Makefile.am tests/testutils.c tests/testutilsqemu.c
|
||||||
|
tests/virshtest.c: add WITH_LIBVIRTD flag consideration
|
||||||
|
* qemud/Makefile.am: Pass $(LIBVIRT_FEATURES) to consider WITH_LIBVIRTD
|
||||||
|
|
||||||
Wed Jun 25 16:21:12 CEST 2008 Jim Meyering <meyering@redhat.com>
|
Wed Jun 25 16:21:12 CEST 2008 Jim Meyering <meyering@redhat.com>
|
||||||
|
|
||||||
quiet "make syntax-check"
|
quiet "make syntax-check"
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
## Process this file with automake to produce Makefile.in
|
## Process this file with automake to produce Makefile.in
|
||||||
|
|
||||||
|
INCLUDES = $(LIBVIRT_FEATURES)
|
||||||
|
|
||||||
# Distribute the generated files so that rpcgen isn't required on the
|
# Distribute the generated files so that rpcgen isn't required on the
|
||||||
# target machine (although almost any Unix machine will have it).
|
# target machine (although almost any Unix machine will have it).
|
||||||
EXTRA_DIST = libvirtd.init.in libvirtd.sysconf default-network.xml \
|
EXTRA_DIST = libvirtd.init.in libvirtd.sysconf default-network.xml \
|
||||||
|
@ -584,6 +584,7 @@ typedef int (*virDrvStateInitialize) (void);
|
|||||||
typedef int (*virDrvStateCleanup) (void);
|
typedef int (*virDrvStateCleanup) (void);
|
||||||
typedef int (*virDrvStateReload) (void);
|
typedef int (*virDrvStateReload) (void);
|
||||||
typedef int (*virDrvStateActive) (void);
|
typedef int (*virDrvStateActive) (void);
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
typedef int (*virDrvSigHandler) (siginfo_t *siginfo);
|
typedef int (*virDrvSigHandler) (siginfo_t *siginfo);
|
||||||
|
|
||||||
typedef struct _virStateDriver virStateDriver;
|
typedef struct _virStateDriver virStateDriver;
|
||||||
@ -596,6 +597,7 @@ struct _virStateDriver {
|
|||||||
virDrvStateActive active;
|
virDrvStateActive active;
|
||||||
virDrvSigHandler sigHandler;
|
virDrvSigHandler sigHandler;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Registration
|
* Registration
|
||||||
@ -605,7 +607,9 @@ struct _virStateDriver {
|
|||||||
int virRegisterDriver(virDriverPtr);
|
int virRegisterDriver(virDriverPtr);
|
||||||
int virRegisterNetworkDriver(virNetworkDriverPtr);
|
int virRegisterNetworkDriver(virNetworkDriverPtr);
|
||||||
int virRegisterStorageDriver(virStorageDriverPtr);
|
int virRegisterStorageDriver(virStorageDriverPtr);
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
int virRegisterStateDriver(virStateDriverPtr);
|
int virRegisterStateDriver(virStateDriverPtr);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -346,6 +346,7 @@ int virUnrefStorageVol (virStorageVolPtr vol);
|
|||||||
#define virGetStoragePool(c,n,u) __virGetStoragePool((c),(n),(u))
|
#define virGetStoragePool(c,n,u) __virGetStoragePool((c),(n),(u))
|
||||||
#define virGetStorageVol(c,p,n,u) __virGetStorageVol((c),(p),(n),(u))
|
#define virGetStorageVol(c,p,n,u) __virGetStorageVol((c),(p),(n),(u))
|
||||||
|
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
int __virStateInitialize(void);
|
int __virStateInitialize(void);
|
||||||
int __virStateCleanup(void);
|
int __virStateCleanup(void);
|
||||||
int __virStateReload(void);
|
int __virStateReload(void);
|
||||||
@ -356,6 +357,7 @@ int __virStateSigDispatcher(siginfo_t *siginfo);
|
|||||||
#define virStateReload() __virStateReload()
|
#define virStateReload() __virStateReload()
|
||||||
#define virStateActive() __virStateActive()
|
#define virStateActive() __virStateActive()
|
||||||
#define virStateSigDispatcher(s) __virStateSigDispatcher(s)
|
#define virStateSigDispatcher(s) __virStateSigDispatcher(s)
|
||||||
|
#endif
|
||||||
|
|
||||||
int __virDrvSupportsFeature (virConnectPtr conn, int feature);
|
int __virDrvSupportsFeature (virConnectPtr conn, int feature);
|
||||||
|
|
||||||
|
@ -60,8 +60,10 @@ static virNetworkDriverPtr virNetworkDriverTab[MAX_DRIVERS];
|
|||||||
static int virNetworkDriverTabCount = 0;
|
static int virNetworkDriverTabCount = 0;
|
||||||
static virStorageDriverPtr virStorageDriverTab[MAX_DRIVERS];
|
static virStorageDriverPtr virStorageDriverTab[MAX_DRIVERS];
|
||||||
static int virStorageDriverTabCount = 0;
|
static int virStorageDriverTabCount = 0;
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
static virStateDriverPtr virStateDriverTab[MAX_DRIVERS];
|
static virStateDriverPtr virStateDriverTab[MAX_DRIVERS];
|
||||||
static int virStateDriverTabCount = 0;
|
static int virStateDriverTabCount = 0;
|
||||||
|
#endif
|
||||||
static int initialized = 0;
|
static int initialized = 0;
|
||||||
|
|
||||||
#define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt, __VA_ARGS__)
|
#define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt, __VA_ARGS__)
|
||||||
@ -532,6 +534,7 @@ virRegisterDriver(virDriverPtr driver)
|
|||||||
return virDriverTabCount++;
|
return virDriverTabCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
/**
|
/**
|
||||||
* virRegisterStateDriver:
|
* virRegisterStateDriver:
|
||||||
* @driver: pointer to a driver block
|
* @driver: pointer to a driver block
|
||||||
@ -620,6 +623,7 @@ int __virStateSigDispatcher(siginfo_t *siginfo) {
|
|||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,7 +69,9 @@
|
|||||||
/* For storing short-lived temporary files. */
|
/* For storing short-lived temporary files. */
|
||||||
#define TEMPDIR LOCAL_STATE_DIR "/cache/libvirt"
|
#define TEMPDIR LOCAL_STATE_DIR "/cache/libvirt"
|
||||||
|
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
static int qemudShutdown(void);
|
static int qemudShutdown(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* qemudDebug statements should be changed to use this macro instead. */
|
/* qemudDebug statements should be changed to use this macro instead. */
|
||||||
#define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt, __VA_ARGS__)
|
#define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt, __VA_ARGS__)
|
||||||
@ -169,6 +171,7 @@ void qemudAutostartConfigs(struct qemud_driver *driver) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
/**
|
/**
|
||||||
* qemudStartup:
|
* qemudStartup:
|
||||||
*
|
*
|
||||||
@ -375,6 +378,7 @@ qemudShutdown(void) {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Return -1 for error, 1 to continue reading and 0 for success */
|
/* Return -1 for error, 1 to continue reading and 0 for success */
|
||||||
typedef int qemudHandlerMonitorOutput(virConnectPtr conn,
|
typedef int qemudHandlerMonitorOutput(virConnectPtr conn,
|
||||||
@ -3675,6 +3679,7 @@ static virNetworkDriver qemuNetworkDriver = {
|
|||||||
qemudNetworkSetAutostart, /* networkSetAutostart */
|
qemudNetworkSetAutostart, /* networkSetAutostart */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
static virStateDriver qemuStateDriver = {
|
static virStateDriver qemuStateDriver = {
|
||||||
qemudStartup,
|
qemudStartup,
|
||||||
qemudShutdown,
|
qemudShutdown,
|
||||||
@ -3682,11 +3687,14 @@ static virStateDriver qemuStateDriver = {
|
|||||||
qemudActive,
|
qemudActive,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
int qemudRegister(void) {
|
int qemudRegister(void) {
|
||||||
virRegisterDriver(&qemuDriver);
|
virRegisterDriver(&qemuDriver);
|
||||||
virRegisterNetworkDriver(&qemuNetworkDriver);
|
virRegisterNetworkDriver(&qemuNetworkDriver);
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
virRegisterStateDriver(&qemuStateDriver);
|
virRegisterStateDriver(&qemuStateDriver);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,6 +168,7 @@ static char *get_transport_from_scheme (char *scheme);
|
|||||||
static int initialise_gnutls (virConnectPtr conn);
|
static int initialise_gnutls (virConnectPtr conn);
|
||||||
static gnutls_session_t negotiate_gnutls_on_connection (virConnectPtr conn, struct private_data *priv, int no_verify);
|
static gnutls_session_t negotiate_gnutls_on_connection (virConnectPtr conn, struct private_data *priv, int no_verify);
|
||||||
|
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
static int
|
static int
|
||||||
remoteStartup(void)
|
remoteStartup(void)
|
||||||
{
|
{
|
||||||
@ -177,6 +178,7 @@ remoteStartup(void)
|
|||||||
inside_daemon = 1;
|
inside_daemon = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* remoteFindServerPath:
|
* remoteFindServerPath:
|
||||||
@ -4930,6 +4932,7 @@ static virStorageDriver storage_driver = {
|
|||||||
.volGetPath = remoteStorageVolGetPath,
|
.volGetPath = remoteStorageVolGetPath,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
static virStateDriver state_driver = {
|
static virStateDriver state_driver = {
|
||||||
remoteStartup,
|
remoteStartup,
|
||||||
NULL,
|
NULL,
|
||||||
@ -4937,6 +4940,7 @@ static virStateDriver state_driver = {
|
|||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/** remoteRegister:
|
/** remoteRegister:
|
||||||
@ -4951,7 +4955,9 @@ remoteRegister (void)
|
|||||||
if (virRegisterDriver (&driver) == -1) return -1;
|
if (virRegisterDriver (&driver) == -1) return -1;
|
||||||
if (virRegisterNetworkDriver (&network_driver) == -1) return -1;
|
if (virRegisterNetworkDriver (&network_driver) == -1) return -1;
|
||||||
if (virRegisterStorageDriver (&storage_driver) == -1) return -1;
|
if (virRegisterStorageDriver (&storage_driver) == -1) return -1;
|
||||||
|
#ifdef WITH_LIBVIRTD
|
||||||
if (virRegisterStateDriver (&state_driver) == -1) return -1;
|
if (virRegisterStateDriver (&state_driver) == -1) return -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,6 @@ EXTRA_DIST = \
|
|||||||
oomtrace.pl \
|
oomtrace.pl \
|
||||||
test-lib.sh \
|
test-lib.sh \
|
||||||
xmlrpcserver.py \
|
xmlrpcserver.py \
|
||||||
test_conf.sh \
|
|
||||||
qemuxml2argvdata \
|
qemuxml2argvdata \
|
||||||
nodeinfodata
|
nodeinfodata
|
||||||
|
|
||||||
@ -44,16 +43,20 @@ noinst_PROGRAMS = xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest \
|
|||||||
reconnect xmconfigtest xencapstest qemuxml2argvtest qemuxml2xmltest \
|
reconnect xmconfigtest xencapstest qemuxml2argvtest qemuxml2xmltest \
|
||||||
nodeinfotest statstest qparamtest
|
nodeinfotest statstest qparamtest
|
||||||
|
|
||||||
test_scripts = \
|
test_scripts =
|
||||||
|
if WITH_LIBVIRTD
|
||||||
|
test_scripts += \
|
||||||
|
test_conf.sh \
|
||||||
daemon-conf \
|
daemon-conf \
|
||||||
int-overflow \
|
int-overflow \
|
||||||
read-bufsiz \
|
read-bufsiz \
|
||||||
read-non-seekable \
|
read-non-seekable \
|
||||||
vcpupin
|
vcpupin
|
||||||
|
endif
|
||||||
|
|
||||||
EXTRA_DIST += $(test_scripts)
|
EXTRA_DIST += $(test_scripts)
|
||||||
|
|
||||||
TESTS = xml2sexprtest sexpr2xmltest virshtest test_conf.sh xmconfigtest \
|
TESTS = xml2sexprtest sexpr2xmltest virshtest xmconfigtest \
|
||||||
xencapstest qemuxml2argvtest qemuxml2xmltest nodeinfotest \
|
xencapstest qemuxml2argvtest qemuxml2xmltest nodeinfotest \
|
||||||
statstest qparamtest $(test_scripts)
|
statstest qparamtest $(test_scripts)
|
||||||
if ENABLE_XEN_TESTS
|
if ENABLE_XEN_TESTS
|
||||||
|
@ -17,7 +17,9 @@
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#ifndef WIN32
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#endif
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -139,6 +141,7 @@ int virtTestLoadFile(const char *name,
|
|||||||
return st.st_size;
|
return st.st_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
static
|
static
|
||||||
void virtTestCaptureProgramExecChild(const char *const argv[],
|
void virtTestCaptureProgramExecChild(const char *const argv[],
|
||||||
int pipefd) {
|
int pipefd) {
|
||||||
@ -181,7 +184,6 @@ void virtTestCaptureProgramExecChild(const char *const argv[],
|
|||||||
close(stderrfd);
|
close(stderrfd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int virtTestCaptureProgramOutput(const char *const argv[],
|
int virtTestCaptureProgramOutput(const char *const argv[],
|
||||||
char **buf,
|
char **buf,
|
||||||
int buflen) {
|
int buflen) {
|
||||||
@ -227,6 +229,7 @@ int virtTestCaptureProgramOutput(const char *const argv[],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* !WIN32 */
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#ifdef WITH_QEMU
|
||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@ -70,3 +70,4 @@ cleanup:
|
|||||||
virCapabilitiesFree(caps);
|
virCapabilitiesFree(caps);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -270,7 +270,7 @@ static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
static int
|
static int
|
||||||
mymain(int argc, char **argv)
|
mymain(int argc, char **argv)
|
||||||
{
|
{
|
||||||
@ -358,5 +358,10 @@ mymain(int argc, char **argv)
|
|||||||
|
|
||||||
return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
return(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
#else /* ! WIN32 */
|
||||||
|
|
||||||
|
static int mymain (void) { exit (77); /* means 'test skipped' for automake */ }
|
||||||
|
|
||||||
|
#endif /* WIN32 */
|
||||||
|
|
||||||
VIRT_TEST_MAIN(mymain)
|
VIRT_TEST_MAIN(mymain)
|
||||||
|
Loading…
Reference in New Issue
Block a user