+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.
#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"
int virNodeInfoPopulate(virConnectPtr conn,
virNodeInfoPtr nodeinfo) {
+#ifdef HAVE_UNAME
struct utsname info;
if (uname(&info) < 0) {
"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;
#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"
NULL, NULL, NULL, -1, -1, "%s", errorMessage);
}
+#ifndef __MINGW32__
+
static int virSetCloseExec(int fd) {
int flags;
if ((flags = fcntl(fd, F_GETFD)) < 0)
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)
{
return strcmp(str + len - suffixlen, suffix) == 0;
}
+#ifndef __MINGW32__
int virFileLinkPointsTo(const char *checkLink,
const char *checkDest)
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;