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