]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fri Dec 7 14:36:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 7 Dec 2007 14:45:39 +0000 (14:45 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 7 Dec 2007 14:45:39 +0000 (14:45 +0000)
* 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.

ChangeLog
proxy/libvirt_proxy.c
src/.cvsignore
src/iptables.c
src/iptables.h
src/nodeinfo.c
src/proxy_internal.c
src/test.c
src/util.c
src/xen_unified.h

index 28e44b35c3dd5c1ecbede61e86d3d457fa628663..f8b13e3d1474ab7d1f2275cfddac2f969cd3728b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+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.
index 152df562f7726ec0efc606453f4ff408a03a603c..d8f2e645510a1ddd0909745e6bb7655cdcd5a4b4 100644 (file)
@@ -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 */
 
 /*
index c4aa3061f0f18c93cf7f7d0968e2e2cd95b5a47f..81e1d6296c64e4d5010dcbf2c44d95cc7802a0b8 100644 (file)
@@ -3,6 +3,7 @@ Makefile.in
 .deps
 .libs
 *.lo
+*.loT
 *.la
 virsh
 *.gcda
index 6de6008bb533450258b15095e12a135349bd82f2..ee9279658f47246894efb8c41d84693a1514d374 100644 (file)
@@ -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>
 #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
index c68fef0ea17ff953d2389db754f7322098ca12ab..a5bb8dd46937e3c978c01e9f42dba8730acd464c 100644 (file)
@@ -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__ */
 
 /*
index 98e72e83abeecf0f2f87d32114e3b34da21b5f41..1b0191b402a918a811fc6cbd2c55f8cf65ebd1f5 100644 (file)
 #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;
index 2b98c6114e0fe41a55594a834333efbc88f954f8..7f902c5cf9f2a0ae9b2f801c17283f3aff9a2dc6 100644 (file)
@@ -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:
index 9926ac17358e80acc1f32ff30d0437c1d5c6b04b..0e85f73236cb12351e234f6771f9e5ca5b9347f6 100644 (file)
 #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"
index 8472eb85bcd356ceb7818863599131b1d39189be..dff34400f20a4f4909b6fb1966b48543386faa2e 100644 (file)
 #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;
index a1249aa747625d3f0d875d36b04a7a3365909012..dda26795059f0131b18b7f59952adc4f29267371 100644 (file)
 
 #include "internal.h"
 
+#ifndef HAVE_WINSOCK2_H
 #include <sys/un.h>
 #include <netinet/in.h>
+#else
+#include <winsock2.h>
+#endif
 
 #ifdef __cplusplus
 extern "C" {