提交 f1f94721 编写于 作者: R Richard W.M. Jones

Fri Dec 7 14:36:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>

	* src/.cvsignore: Ignore *.loT files (generated under Windows).
	* proxy/libvirt_proxy.c: Bail out earlier --without-xen.
	* src/proxy_internal.c: Don't build proxy client side if
	  configured --without-xen.
	* src/iptables.c, src/iptables.h: Disable this code if
	  configured --without-qemu.
	* src/nodeinfo.c: If no 'uname' function, set model name to
	  empty string (for Windows).
	* src/xen_unified.h, src/util.c, src/test.c: Include <winsock2.h>
	  on Windows.
	* src/util.c: Disable virExec* and virFileLinkPointsTo on
	  MinGW.
上级 36f0ce04
Fri Dec 7 14:36:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/.cvsignore: Ignore *.loT files (generated under Windows).
* proxy/libvirt_proxy.c: Bail out earlier --without-xen.
* src/proxy_internal.c: Don't build proxy client side if
configured --without-xen.
* src/iptables.c, src/iptables.h: Disable this code if
configured --without-qemu.
* src/nodeinfo.c: If no 'uname' function, set model name to
empty string (for Windows).
Fri Dec 7 14:34:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
* src/sexpr.c: Cosmetic rearrangement of headers.
......
......@@ -11,6 +11,8 @@
#include "config.h"
#ifdef WITH_XEN
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
......@@ -20,9 +22,9 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <locale.h>
#include "internal.h"
#ifdef WITH_XEN
#include "proxy_internal.h"
#include "xen_internal.h"
#include "xend_internal.h"
......@@ -839,10 +841,12 @@ int main(int argc, char **argv) {
}
#else /* WITHOUT_XEN */
int main(void) {
fprintf(stderr, "libvirt was compiled without Xen support\n");
exit(1);
}
#endif /* WITH_XEN */
/*
......
......@@ -3,6 +3,7 @@ Makefile.in
.deps
.libs
*.lo
*.loT
*.la
virsh
*.gcda
......
......@@ -19,9 +19,9 @@
* Mark McLoughlin <markmc@redhat.com>
*/
#include <config.h>
#include "config.h"
#include "iptables.h"
#if WITH_QEMU
#include <stdio.h>
#include <stdlib.h>
......@@ -31,12 +31,19 @@
#include <limits.h>
#include <unistd.h>
#include <fcntl.h>
#include <paths.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
#include "internal.h"
#include "iptables.h"
#define qemudLog(level, msg...) fprintf(stderr, msg)
......@@ -1092,6 +1099,8 @@ iptablesRemoveForwardMasquerade(iptablesContext *ctx,
return iptablesForwardMasquerade(ctx, network, physdev, REMOVE);
}
#endif /* WITH_QEMU */
/*
* Local variables:
* indent-tabs-mode: nil
......
......@@ -22,6 +22,8 @@
#ifndef __QEMUD_IPTABLES_H__
#define __QEMUD_IPTABLES_H__
#if WITH_QEMU
typedef struct _iptablesContext iptablesContext;
iptablesContext *iptablesContextNew (void);
......@@ -83,6 +85,8 @@ int iptablesRemoveForwardMasquerade (iptablesContext *ctx,
const char *network,
const char *physdev);
#endif /* WITH_QEMU */
#endif /* __QEMUD_IPTABLES_H__ */
/*
......
......@@ -26,10 +26,13 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/utsname.h>
#include <errno.h>
#include <ctype.h>
#ifdef HAVE_SYS_UTSNAME_H
#include <sys/utsname.h>
#endif
#include "nodeinfo.h"
#include "physmem.h"
......@@ -120,6 +123,7 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr n
int virNodeInfoPopulate(virConnectPtr conn,
virNodeInfoPtr nodeinfo) {
#ifdef HAVE_UNAME
struct utsname info;
if (uname(&info) < 0) {
......@@ -128,10 +132,15 @@ int virNodeInfoPopulate(virConnectPtr conn,
"cannot extract machine type %s", strerror(errno));
return -1;
}
strncpy(nodeinfo->model, info.machine, sizeof(nodeinfo->model)-1);
nodeinfo->model[sizeof(nodeinfo->model)-1] = '\0';
#else /* !HAVE_UNAME */
nodeinfo->model[0] = '\0';
#endif /* !HAVE_UNAME */
#ifdef __linux__
{
int ret;
......
......@@ -8,6 +8,8 @@
* Daniel Veillard <veillard@redhat.com>
*/
#ifdef WITH_XEN
#include "config.h"
#include <stdio.h>
......@@ -1111,6 +1113,8 @@ xenProxyDomainGetOSType(virDomainPtr domain)
return(ostype);
}
#endif /* WITH_XEN */
/*
* vim: set tabstop=4:
* vim: set shiftwidth=4:
......
......@@ -35,8 +35,14 @@
#include <libxml/uri.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#ifndef HAVE_WINSOCK2_H
#include <net/if.h>
#include <netinet/in.h>
#else
#include <winsock2.h>
#endif
#include "internal.h"
#include "test.h"
......
......@@ -30,12 +30,15 @@
#include <stdarg.h>
#include <unistd.h>
#include <fcntl.h>
#include <paths.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
#include "libvirt/virterror.h"
#include "internal.h"
#include "event.h"
......@@ -65,6 +68,8 @@ ReportError(virConnectPtr conn,
NULL, NULL, NULL, -1, -1, "%s", errorMessage);
}
#ifndef __MINGW32__
static int virSetCloseExec(int fd) {
int flags;
if ((flags = fcntl(fd, F_GETFD)) < 0)
......@@ -198,6 +203,34 @@ virExecNonBlock(virConnectPtr conn,
return(_virExec(conn, argv, retpid, infd, outfd, errfd, 1));
}
#else /* __MINGW32__ */
int
virExec(virConnectPtr conn,
char **argv ATTRIBUTE_UNUSED,
int *retpid ATTRIBUTE_UNUSED,
int infd ATTRIBUTE_UNUSED,
int *outfd ATTRIBUTE_UNUSED,
int *errfd ATTRIBUTE_UNUSED)
{
ReportError (conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
return -1;
}
int
virExecNonBlock(virConnectPtr conn,
char **argv ATTRIBUTE_UNUSED,
int *retpid ATTRIBUTE_UNUSED,
int infd ATTRIBUTE_UNUSED,
int *outfd ATTRIBUTE_UNUSED,
int *errfd ATTRIBUTE_UNUSED)
{
ReportError (conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
return -1;
}
#endif /* __MINGW32__ */
/* Like read(), but restarts after EINTR */
int saferead(int fd, void *buf, size_t count)
{
......@@ -313,6 +346,7 @@ int virFileHasSuffix(const char *str,
return strcmp(str + len - suffixlen, suffix) == 0;
}
#ifndef __MINGW32__
int virFileLinkPointsTo(const char *checkLink,
const char *checkDest)
......@@ -397,6 +431,22 @@ int virFileLinkPointsTo(const char *checkLink,
return 1;
}
#else /* !__MINGW32__ */
/* Gnulib has an implementation of readlink which could be used
* to implement this, but it requires LGPLv3.
*/
int
virFileLinkPointsTo (const char *checkLink ATTRIBUTE_UNUSED,
const char *checkDest ATTRIBUTE_UNUSED)
{
virLog ("%s: not implemented", __FUNCTION__);
return 0;
}
#endif /*! __MINGW32__ */
int virFileMakePath(const char *path)
{
struct stat st;
......
......@@ -13,8 +13,12 @@
#include "internal.h"
#ifndef HAVE_WINSOCK2_H
#include <sys/un.h>
#include <netinet/in.h>
#else
#include <winsock2.h>
#endif
#ifdef __cplusplus
extern "C" {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册