? gnulib/lib/.deps
? gnulib/lib/.libs
? gnulib/lib/Makefile
? gnulib/lib/Makefile.in
? gnulib/lib/asnprintf.lo
? gnulib/lib/dummy.lo
? gnulib/lib/libgnu.la
? gnulib/lib/physmem.lo
? gnulib/lib/printf-args.lo
? gnulib/lib/printf-parse.lo
? gnulib/lib/sys
? gnulib/lib/vasnprintf.lo
? gnulib/tests/Makefile
? gnulib/tests/Makefile.in
Index: bootstrap
===================================================================
RCS file: /data/cvs/libvirt/bootstrap,v
retrieving revision 1.1
diff -u -r1.1 bootstrap
--- bootstrap	5 Dec 2007 21:31:07 -0000	1.1
+++ bootstrap	6 Dec 2007 11:27:48 -0000
@@ -95,6 +95,7 @@
   --avoid=snprintf-tests
   --avoid=vasnprintf-tests
   --avoid=alloca-opt-tests
+  --avoid=vasprintf-tests
 '
 
 $gnulib_tool			\
@@ -104,7 +105,8 @@
   --m4-base=gnulib/m4		\
   --source-base=gnulib/lib	\
   --tests-base=gnulib/tests	\
-  --import physmem getaddrinfo
+  --import physmem getaddrinfo  \
+    sys_stat vasprintf strndup strsep poll
 
 rm -f				\
     .gitignore			\
Index: configure.in
===================================================================
RCS file: /data/cvs/libvirt/configure.in,v
retrieving revision 1.109
diff -u -r1.109 configure.in
--- configure.in	6 Dec 2007 10:24:52 -0000	1.109
+++ configure.in	6 Dec 2007 11:27:48 -0000
@@ -60,10 +60,10 @@
 LIBVIRT_COMPILE_WARNINGS(maximum)
 
 dnl Availability of various common functions (non-fatal if missing).
-AC_CHECK_FUNCS([regexec cfmakeraw])
+AC_CHECK_FUNCS([cfmakeraw regexec uname])
 
 dnl Availability of various common headers (non-fatal if missing).
-AC_CHECK_HEADERS([paths.h sys/syslimits.h])
+AC_CHECK_HEADERS(libintl.h pwd.h paths.h sys/syslimits.h sys/utsname.h sys/wait.h winsock.h)
 
 dnl Need -lrpc? (Cygwin needs this)
 AC_SEARCH_LIBS(xdrmem_create,rpc)
Index: docs/examples/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/docs/examples/Makefile.am,v
retrieving revision 1.12
diff -u -r1.12 Makefile.am
--- docs/examples/Makefile.am	15 Nov 2007 13:04:28 -0000	1.12
+++ docs/examples/Makefile.am	6 Dec 2007 11:27:48 -0000
@@ -3,7 +3,8 @@
 SUBDIRS=python
 INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include
 DEPS = $(top_builddir)/src/libvirt.la
-LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la
+LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la \
+	$(top_builddir)/gnulib/lib/libgnu.la
 
 rebuild: examples.xml index.html
 
Index: docs/examples/index.py
===================================================================
RCS file: /data/cvs/libvirt/docs/examples/index.py,v
retrieving revision 1.6
diff -u -r1.6 index.py
--- docs/examples/index.py	15 Nov 2007 13:04:28 -0000	1.6
+++ docs/examples/index.py	6 Dec 2007 11:27:49 -0000
@@ -225,7 +225,8 @@
 SUBDIRS=python
 INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include
 DEPS = $(top_builddir)/src/libvirt.la
-LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la
+LDADDS = @STATIC_BINARIES@ $(WARN_CFLAGS) $(top_builddir)/src/libvirt.la \\
+	$(top_builddir)/gnulib/lib/libgnu.la
 
 rebuild: examples.xml index.html
 
Index: gnulib/lib/.cvsignore
===================================================================
RCS file: /data/cvs/libvirt/gnulib/lib/.cvsignore,v
retrieving revision 1.1
diff -u -r1.1 .cvsignore
--- gnulib/lib/.cvsignore	5 Dec 2007 21:35:32 -0000	1.1
+++ gnulib/lib/.cvsignore	6 Dec 2007 11:27:49 -0000
@@ -1,11 +1,26 @@
 alloca.h
+asprintf.c
 float.h
 netinet_in.h
+poll.c
+poll.h
+poll.in.h
 stdbool.h
 stdint.h
 stdio.h
 stdlib.h
 string.h
+strndup.c
+strnlen.c
+strpbrk.c
+strsep.c
+sys_select.h
+sys_select.in.h
 sys_socket.h
+sys_stat.h
+sys_stat.in.h
+sys_time.h
+sys_time.in.h
 unistd.h
+vasprintf.c
 wchar.h
Index: gnulib/lib/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/gnulib/lib/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- gnulib/lib/Makefile.am	5 Dec 2007 21:35:32 -0000	1.1
+++ gnulib/lib/Makefile.am	6 Dec 2007 11:27:49 -0000
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --with-tests --avoid=alloca-opt-tests --avoid=snprintf-tests --avoid=vasnprintf-tests --lgpl --libtool --macro-prefix=gl getaddrinfo physmem
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --with-tests --avoid=alloca-opt-tests --avoid=snprintf-tests --avoid=vasnprintf-tests --avoid=vasprintf-tests --lgpl --libtool --macro-prefix=gl getaddrinfo physmem poll strndup strsep sys_stat vasprintf
 
 AUTOMAKE_OPTIONS = 1.5 gnits
 
@@ -179,6 +179,25 @@
 
 ## end   gnulib module physmem
 
+## begin gnulib module poll
+
+BUILT_SOURCES += $(POLL_H)
+
+# We need the following in order to create <poll.h> when the system
+# doesn't have one.
+poll.h: poll.in.h
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+	  cat $(srcdir)/poll.in.h; \
+	} > $@-t
+	mv -f $@-t $@
+MOSTLYCLEANFILES += poll.h poll.h-t
+
+EXTRA_DIST += poll.c poll.in.h
+
+EXTRA_libgnu_la_SOURCES += poll.c
+
+## end   gnulib module poll
+
 ## begin gnulib module size_max
 
 libgnu_la_SOURCES += size_max.h
@@ -422,6 +441,65 @@
 
 ## end   gnulib module string
 
+## begin gnulib module strndup
+
+
+EXTRA_DIST += strndup.c
+
+EXTRA_libgnu_la_SOURCES += strndup.c
+
+## end   gnulib module strndup
+
+## begin gnulib module strnlen
+
+
+EXTRA_DIST += strnlen.c
+
+EXTRA_libgnu_la_SOURCES += strnlen.c
+
+## end   gnulib module strnlen
+
+## begin gnulib module strpbrk
+
+
+EXTRA_DIST += strpbrk.c
+
+EXTRA_libgnu_la_SOURCES += strpbrk.c
+
+## end   gnulib module strpbrk
+
+## begin gnulib module strsep
+
+
+EXTRA_DIST += strsep.c
+
+EXTRA_libgnu_la_SOURCES += strsep.c
+
+## end   gnulib module strsep
+
+## begin gnulib module sys_select
+
+BUILT_SOURCES += $(SYS_SELECT_H)
+
+# We need the following in order to create <sys/select.h> when the system
+# doesn't have one that works with the given compiler.
+sys/select.h: sys_select.in.h
+	@MKDIR_P@ sys
+	rm -f $@-t $@
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+	  sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+	      -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \
+	      -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \
+	      < $(srcdir)/sys_select.in.h; \
+	} > $@-t
+	mv $@-t $@
+MOSTLYCLEANFILES += sys/select.h sys/select.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_select.in.h
+
+## end   gnulib module sys_select
+
 ## begin gnulib module sys_socket
 
 BUILT_SOURCES += $(SYS_SOCKET_H)
@@ -446,6 +524,55 @@
 
 ## end   gnulib module sys_socket
 
+## begin gnulib module sys_stat
+
+BUILT_SOURCES += $(SYS_STAT_H)
+
+# We need the following in order to create <sys/stat.h> when the system
+# has one that is incomplete.
+sys/stat.h: sys_stat.in.h
+	@MKDIR_P@ sys
+	rm -f $@-t $@
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+	  sed -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+	      -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+	      -e 's|@''HAVE_IO_H''@|$(HAVE_IO_H)|g' \
+	      -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
+	      -e 's|@''HAVE_DECL_MKDIR''@|$(HAVE_DECL_MKDIR)|g' \
+	      < $(srcdir)/sys_stat.in.h; \
+	} > $@-t
+	mv $@-t $@
+MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_stat.in.h
+
+## end   gnulib module sys_stat
+
+## begin gnulib module sys_time
+
+BUILT_SOURCES += $(SYS_TIME_H)
+
+# We need the following in order to create <sys/time.h> when the system
+# doesn't have one that works with the given compiler.
+sys/time.h: sys_time.in.h
+	@MKDIR_P@ sys
+	rm -f $@-t $@
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+	  sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
+	      -e 's/@''INCLUDE_NEXT''@/$(INCLUDE_NEXT)/g' \
+	      -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
+	      -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+	      -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+	      < $(srcdir)/sys_time.in.h; \
+	} > $@-t
+	mv $@-t $@
+MOSTLYCLEANFILES += sys/time.h sys/time.h-t
+
+EXTRA_DIST += sys_time.in.h
+
+## end   gnulib module sys_time
+
 ## begin gnulib module unistd
 
 BUILT_SOURCES += unistd.h
@@ -500,6 +627,15 @@
 
 ## end   gnulib module vasnprintf
 
+## begin gnulib module vasprintf
+
+
+EXTRA_DIST += asprintf.c vasprintf.c
+
+EXTRA_libgnu_la_SOURCES += asprintf.c vasprintf.c
+
+## end   gnulib module vasprintf
+
 ## begin gnulib module verify
 
 libgnu_la_SOURCES += verify.h
Index: gnulib/m4/.cvsignore
===================================================================
RCS file: gnulib/m4/.cvsignore
diff -N gnulib/m4/.cvsignore
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnulib/m4/.cvsignore	6 Dec 2007 11:27:49 -0000
@@ -0,0 +1,11 @@
+.deps
+.dirstamp
+poll.m4
+strndup.m4
+strnlen.m4
+strpbrk.m4
+strsep.m4
+sys_select_h.m4
+sys_stat_h.m4
+sys_time_h.m4
+vasprintf.m4
Index: gnulib/m4/gnulib-cache.m4
===================================================================
RCS file: /data/cvs/libvirt/gnulib/m4/gnulib-cache.m4,v
retrieving revision 1.1
diff -u -r1.1 gnulib-cache.m4
--- gnulib/m4/gnulib-cache.m4	5 Dec 2007 21:35:32 -0000	1.1
+++ gnulib/m4/gnulib-cache.m4	6 Dec 2007 11:27:49 -0000
@@ -15,12 +15,12 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --with-tests --avoid=alloca-opt-tests --avoid=snprintf-tests --avoid=vasnprintf-tests --lgpl --libtool --macro-prefix=gl getaddrinfo physmem
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --with-tests --avoid=alloca-opt-tests --avoid=snprintf-tests --avoid=vasnprintf-tests --avoid=vasprintf-tests --lgpl --libtool --macro-prefix=gl getaddrinfo physmem poll strndup strsep sys_stat vasprintf
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
-gl_MODULES([getaddrinfo physmem])
-gl_AVOID([alloca-opt-tests snprintf-tests vasnprintf-tests])
+gl_MODULES([getaddrinfo physmem poll strndup strsep sys_stat vasprintf])
+gl_AVOID([alloca-opt-tests snprintf-tests vasnprintf-tests vasprintf-tests])
 gl_SOURCE_BASE([gnulib/lib])
 gl_M4_BASE([gnulib/m4])
 gl_PO_BASE([])
Index: gnulib/m4/gnulib-comp.m4
===================================================================
RCS file: /data/cvs/libvirt/gnulib/m4/gnulib-comp.m4,v
retrieving revision 1.1
diff -u -r1.1 gnulib-comp.m4
--- gnulib/m4/gnulib-comp.m4	5 Dec 2007 21:35:32 -0000	1.1
+++ gnulib/m4/gnulib-comp.m4	6 Dec 2007 11:27:49 -0000
@@ -51,6 +51,7 @@
   gl_HEADER_NETINET_IN
   AC_PROG_MKDIR_P
   gl_PHYSMEM
+  gl_FUNC_POLL
   gl_SIZE_MAX
   gl_FUNC_SNPRINTF
   gl_STDIO_MODULE_INDICATOR([snprintf])
@@ -64,11 +65,30 @@
   gl_FUNC_STRDUP
   gl_STRING_MODULE_INDICATOR([strdup])
   gl_HEADER_STRING_H
+  gl_FUNC_STRNDUP
+  gl_STRING_MODULE_INDICATOR([strndup])
+  gl_FUNC_STRNLEN
+  gl_STRING_MODULE_INDICATOR([strnlen])
+  gl_FUNC_STRPBRK
+  gl_STRING_MODULE_INDICATOR([strpbrk])
+  gl_FUNC_STRSEP
+  gl_STRING_MODULE_INDICATOR([strsep])
+  gl_HEADER_SYS_SELECT
+  AC_PROG_MKDIR_P
   gl_HEADER_SYS_SOCKET
   AC_PROG_MKDIR_P
   AC_CHECK_FUNCS([shutdown])
+  gl_HEADER_SYS_STAT_H
+  AC_PROG_MKDIR_P
+  gl_HEADER_SYS_TIME_H
+  AC_PROG_MKDIR_P
   gl_UNISTD_H
   gl_FUNC_VASNPRINTF
+  gl_FUNC_VASPRINTF
+  gl_STDIO_MODULE_INDICATOR([vasprintf])
+  m4_ifdef([AM_XGETTEXT_OPTION],
+    [AM_XGETTEXT_OPTION([--flag=asprintf:2:c-format])
+     AM_XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
   gl_WCHAR_H
   gl_XSIZE
   m4_popdef([AC_LIBSOURCES])
@@ -124,6 +144,7 @@
   build-aux/link-warning.h
   lib/alloca.in.h
   lib/asnprintf.c
+  lib/asprintf.c
   lib/dummy.c
   lib/float+.h
   lib/float.in.h
@@ -138,6 +159,8 @@
   lib/netinet_in.in.h
   lib/physmem.c
   lib/physmem.h
+  lib/poll.c
+  lib/poll.in.h
   lib/printf-args.c
   lib/printf-args.h
   lib/printf-parse.c
@@ -150,10 +173,18 @@
   lib/stdlib.in.h
   lib/strdup.c
   lib/string.in.h
+  lib/strndup.c
+  lib/strnlen.c
+  lib/strpbrk.c
+  lib/strsep.c
+  lib/sys_select.in.h
   lib/sys_socket.in.h
+  lib/sys_stat.in.h
+  lib/sys_time.in.h
   lib/unistd.in.h
   lib/vasnprintf.c
   lib/vasnprintf.h
+  lib/vasprintf.c
   lib/verify.h
   lib/wchar.in.h
   lib/xsize.h
@@ -174,6 +205,7 @@
   m4/netinet_in_h.m4
   m4/onceonly_2_57.m4
   m4/physmem.m4
+  m4/poll.m4
   m4/size_max.m4
   m4/snprintf.m4
   m4/socklen.m4
@@ -185,9 +217,17 @@
   m4/stdlib_h.m4
   m4/strdup.m4
   m4/string_h.m4
+  m4/strndup.m4
+  m4/strnlen.m4
+  m4/strpbrk.m4
+  m4/strsep.m4
+  m4/sys_select_h.m4
   m4/sys_socket_h.m4
+  m4/sys_stat_h.m4
+  m4/sys_time_h.m4
   m4/unistd_h.m4
   m4/vasnprintf.m4
+  m4/vasprintf.m4
   m4/wchar.m4
   m4/wchar_t.m4
   m4/wint_t.m4
@@ -200,7 +240,10 @@
   tests/test-stdio.c
   tests/test-stdlib.c
   tests/test-string.c
+  tests/test-sys_select.c
   tests/test-sys_socket.c
+  tests/test-sys_stat.c
+  tests/test-sys_time.c
   tests/test-unistd.c
   tests/test-wchar.c
 ])
Index: gnulib/m4/stdio_h.m4
===================================================================
RCS file: /data/cvs/libvirt/gnulib/m4/stdio_h.m4,v
retrieving revision 1.1
diff -u -r1.1 stdio_h.m4
--- gnulib/m4/stdio_h.m4	5 Dec 2007 21:35:32 -0000	1.1
+++ gnulib/m4/stdio_h.m4	6 Dec 2007 11:27:49 -0000
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 8
+# stdio_h.m4 serial 9
 dnl Copyright (C) 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -73,13 +73,10 @@
       [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>],
 [#if defined __SL64 && defined __SCLE /* cygwin */
   /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
-     fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, at the
-     same time that cygwin fixed the declaration of "long timezone" to no
-     longer be a macro, so we use that as a compile-time test for
-     cross-compiles rather than building a runtime test.  */
-# define timezonevar
-# include <sys/time.h>
-# ifdef timezone
+     fseeko/ftello needlessly fail.  This bug was fixed in 1.5.25, and
+     it is easier to do a version check than building a runtime test.  */
+# include <cygwin/version.h>
+# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
   choke me
 # endif
 #endif])],
Index: gnulib/tests/.cvsignore
===================================================================
RCS file: gnulib/tests/.cvsignore
diff -N gnulib/tests/.cvsignore
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gnulib/tests/.cvsignore	6 Dec 2007 11:27:49 -0000
@@ -0,0 +1,5 @@
+.deps
+.dirstamp
+test-sys_select.c
+test-sys_stat.c
+test-sys_time.c
Index: gnulib/tests/Makefile.am
===================================================================
RCS file: /data/cvs/libvirt/gnulib/tests/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- gnulib/tests/Makefile.am	5 Dec 2007 21:35:32 -0000	1.1
+++ gnulib/tests/Makefile.am	6 Dec 2007 11:27:50 -0000
@@ -108,6 +108,15 @@
 
 ## end   gnulib module string-tests
 
+## begin gnulib module sys_select-tests
+
+TESTS += test-sys_select
+check_PROGRAMS += test-sys_select
+
+EXTRA_DIST += test-sys_select.c
+
+## end   gnulib module sys_select-tests
+
 ## begin gnulib module sys_socket-tests
 
 TESTS += test-sys_socket
@@ -117,6 +126,24 @@
 
 ## end   gnulib module sys_socket-tests
 
+## begin gnulib module sys_stat-tests
+
+TESTS += test-sys_stat
+check_PROGRAMS += test-sys_stat
+
+EXTRA_DIST += test-sys_stat.c
+
+## end   gnulib module sys_stat-tests
+
+## begin gnulib module sys_time-tests
+
+TESTS += test-sys_time
+check_PROGRAMS += test-sys_time
+
+EXTRA_DIST += test-sys_time.c
+
+## end   gnulib module sys_time-tests
+
 ## begin gnulib module unistd-tests
 
 TESTS += test-unistd
Index: proxy/libvirt_proxy.c
===================================================================
RCS file: /data/cvs/libvirt/proxy/libvirt_proxy.c,v
retrieving revision 1.21
diff -u -r1.21 libvirt_proxy.c
--- proxy/libvirt_proxy.c	5 Dec 2007 18:28:05 -0000	1.21
+++ proxy/libvirt_proxy.c	6 Dec 2007 11:27:50 -0000
@@ -9,6 +9,10 @@
  * Daniel Veillard <veillard@redhat.com>
  */
 
+#include "config.h"
+
+#ifdef WITH_XEN
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -18,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"
Index: src/.cvsignore
===================================================================
RCS file: /data/cvs/libvirt/src/.cvsignore,v
retrieving revision 1.3
diff -u -r1.3 .cvsignore
--- src/.cvsignore	23 Feb 2007 17:15:42 -0000	1.3
+++ src/.cvsignore	6 Dec 2007 11:27:50 -0000
@@ -3,6 +3,7 @@
 .deps
 .libs
 *.lo
+*.loT
 *.la
 virsh
 *.gcda
Index: src/console.c
===================================================================
RCS file: /data/cvs/libvirt/src/console.c,v
retrieving revision 1.3
diff -u -r1.3 console.c
--- src/console.c	26 Nov 2007 12:14:32 -0000	1.3
+++ src/console.c	6 Dec 2007 11:27:50 -0000
@@ -22,6 +22,8 @@
 
 #include "config.h"
 
+#ifndef __MINGW32__
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -193,6 +195,8 @@
     return ret;
 }
 
+#endif /* !__MINGW32__ */
+
 /*
  * Local variables:
  *  indent-tabs-mode: nil
Index: src/console.h
===================================================================
RCS file: /data/cvs/libvirt/src/console.h,v
retrieving revision 1.2
diff -u -r1.2 console.h
--- src/console.h	28 Jan 2007 19:47:36 -0000	1.2
+++ src/console.h	6 Dec 2007 11:27:50 -0000
@@ -23,6 +23,8 @@
 #ifndef __VIR_CONSOLE_H__
 #define __VIR_CONSOLE_H__
 
+#ifndef __MINGW32__
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -33,6 +35,8 @@
 }
 #endif
 
+#endif /* !__MINGW32__ */
+
 #endif /* __VIR_CONSOLE_H__ */
 
 /*
Index: src/internal.h
===================================================================
RCS file: /data/cvs/libvirt/src/internal.h,v
retrieving revision 1.57
diff -u -r1.57 internal.h
--- src/internal.h	5 Dec 2007 18:55:04 -0000	1.57
+++ src/internal.h	6 Dec 2007 11:27:50 -0000
@@ -12,11 +12,14 @@
 #include <sys/syslimits.h>
 #endif
 
+#ifdef HAVE_LIBINTL_H
+#include <libintl.h>
+#endif
+
 #include "hash.h"
 #include "libvirt/libvirt.h"
 #include "libvirt/virterror.h"
 #include "driver.h"
-#include <libintl.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -36,8 +39,17 @@
 #define IF_NAMESIZE 16
 #endif
 
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
+#endif
+
+#ifdef HAVE_LIBINTL_H
 #define _(str) dgettext(GETTEXT_PACKAGE, (str))
 #define N_(str) dgettext(GETTEXT_PACKAGE, (str))
+#else
+#define _(str) (str)
+#define N_(str) (str)
+#endif
 #define gettext_noop(str) (str)
 
 /* String equality tests, suggested by Jim Meyering. */
Index: src/iptables.c
===================================================================
RCS file: /data/cvs/libvirt/src/iptables.c,v
retrieving revision 1.3
diff -u -r1.3 iptables.c
--- src/iptables.c	1 Dec 2007 15:45:25 -0000	1.3
+++ src/iptables.c	6 Dec 2007 11:27:51 -0000
@@ -31,10 +31,16 @@
 #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"
 
Index: src/libvirt.c
===================================================================
RCS file: /data/cvs/libvirt/src/libvirt.c,v
retrieving revision 1.108
diff -u -r1.108 libvirt.c
--- src/libvirt.c	5 Dec 2007 18:55:04 -0000	1.108
+++ src/libvirt.c	6 Dec 2007 11:27:53 -0000
@@ -161,8 +161,10 @@
         return(0);
     initialized = 1;
 
+#ifdef HAVE_LIBINTL_H
     if (!bindtextdomain(GETTEXT_PACKAGE, LOCALEBASEDIR))
         return (-1);
+#endif
 
     /*
      * Note that the order is important: the first ones have a higher
Index: src/nodeinfo.c
===================================================================
RCS file: /data/cvs/libvirt/src/nodeinfo.c,v
retrieving revision 1.4
diff -u -r1.4 nodeinfo.c
--- src/nodeinfo.c	5 Dec 2007 21:40:15 -0000	1.4
+++ src/nodeinfo.c	6 Dec 2007 11:27:53 -0000
@@ -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 virNodeInfoPopulate(virConnectPtr conn,
                         virNodeInfoPtr nodeinfo) {
+#ifdef HAVE_UNAME
     struct utsname info;
 
     if (uname(&info) < 0) {
@@ -128,10 +132,15 @@
                         "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: src/proxy_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/proxy_internal.c,v
retrieving revision 1.39
diff -u -r1.39 proxy_internal.c
--- src/proxy_internal.c	5 Dec 2007 21:40:15 -0000	1.39
+++ src/proxy_internal.c	6 Dec 2007 11:27:54 -0000
@@ -8,6 +8,8 @@
  * Daniel Veillard <veillard@redhat.com>
  */
 
+#ifdef WITH_XEN
+
 #include "config.h"
 
 #include <stdio.h>
@@ -1111,6 +1113,8 @@
     return(ostype);
 }
 
+#endif /* WITH_XEN */
+
 /*
  * vim: set tabstop=4:
  * vim: set shiftwidth=4:
Index: src/qemu_driver.c
===================================================================
RCS file: /data/cvs/libvirt/src/qemu_driver.c,v
retrieving revision 1.42
diff -u -r1.42 qemu_driver.c
--- src/qemu_driver.c	5 Dec 2007 21:31:07 -0000	1.42
+++ src/qemu_driver.c	6 Dec 2007 11:27:56 -0000
@@ -47,6 +47,10 @@
 #include <sys/wait.h>
 #include <libxml/uri.h>
 
+#ifdef __MINGW32__
+#include <basetyps.h>
+#endif
+
 #include "libvirt/virterror.h"
 
 #include "event.h"
Index: src/remote_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/remote_internal.c,v
retrieving revision 1.43
diff -u -r1.43 remote_internal.c
--- src/remote_internal.c	5 Dec 2007 21:31:07 -0000	1.43
+++ src/remote_internal.c	6 Dec 2007 11:27:59 -0000
@@ -31,15 +31,29 @@
 #include <errno.h>
 #include <signal.h>
 #include <sys/types.h>
-#include <sys/socket.h>
 #include <sys/stat.h>
-#include <sys/wait.h>
 #include <fcntl.h>
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+
+#ifdef HAVE_PATHS_H
 #include <paths.h>
+#endif
+
+#ifndef HAVE_WINSOCK_H
+#include <sys/socket.h>
 #include <netdb.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
-#include <pwd.h>
+#else
+#include <winsock.h>
+#endif
 
 #include <rpc/types.h>
 #include <rpc/xdr.h>
@@ -51,6 +65,10 @@
 #endif
 #include <libxml/uri.h>
 
+#ifdef __MINGW32__
+#include <basetyps.h>
+#endif
+
 #include "internal.h"
 #include "driver.h"
 #include "getaddrinfo.h"
@@ -2841,7 +2859,12 @@
 
 static int
 remoteAuthenticate (virConnectPtr conn, struct private_data *priv, int in_open,
-                    virConnectAuthPtr auth, const char *authtype)
+                    virConnectAuthPtr auth
+#if !HAVE_SASL && !HAVE_POLKIT
+                    ATTRIBUTE_UNUSED
+#endif
+                    ,
+                    const char *authtype)
 {
     struct remote_auth_list_ret ret;
     int err, type = REMOTE_AUTH_NONE;
Index: src/sexpr.c
===================================================================
RCS file: /data/cvs/libvirt/src/sexpr.c,v
retrieving revision 1.10
diff -u -r1.10 sexpr.c
--- src/sexpr.c	5 Dec 2007 21:31:07 -0000	1.10
+++ src/sexpr.c	6 Dec 2007 11:27:59 -0000
@@ -12,15 +12,15 @@
 
 #include "config.h"
 
-#include "sexpr.h"
-#include "internal.h"
-
+#include <stdio.h>
 #include <malloc.h>
 #include <string.h>
-#include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
 
+#include "internal.h"
+#include "sexpr.h"
+
 /**
  * virSexprError:
  * @conn: the connection if available
Index: src/test.c
===================================================================
RCS file: /data/cvs/libvirt/src/test.c,v
retrieving revision 1.54
diff -u -r1.54 test.c
--- src/test.c	5 Dec 2007 21:31:07 -0000	1.54
+++ src/test.c	6 Dec 2007 11:28:00 -0000
@@ -35,8 +35,14 @@
 #include <libxml/uri.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <sys/stat.h>
+
+#ifndef HAVE_WINSOCK_H
 #include <net/if.h>
 #include <netinet/in.h>
+#else
+#include <winsock.h>
+#endif
 
 #include "internal.h"
 #include "test.h"
Index: src/util.c
===================================================================
RCS file: /data/cvs/libvirt/src/util.c,v
retrieving revision 1.9
diff -u -r1.9 util.c
--- src/util.c	5 Dec 2007 13:56:22 -0000	1.9
+++ src/util.c	6 Dec 2007 11:28:00 -0000
@@ -46,6 +46,8 @@
 
 #define virLog(msg...) fprintf(stderr, msg)
 
+#ifndef __MINGW32__
+
 static void 
 ReportError(virConnectPtr conn,
                       virDomainPtr dom,
@@ -198,6 +200,34 @@
     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 +343,7 @@
     return strcmp(str + len - suffixlen, suffix) == 0;
 }
 
+#ifndef __MINGW32__
 
 int virFileLinkPointsTo(const char *checkLink,
                         const char *checkDest)
@@ -397,6 +428,22 @@
     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: src/uuid.c
===================================================================
RCS file: /data/cvs/libvirt/src/uuid.c,v
retrieving revision 1.3
diff -u -r1.3 uuid.c
--- src/uuid.c	9 Aug 2007 20:19:12 -0000	1.3
+++ src/uuid.c	6 Dec 2007 11:28:00 -0000
@@ -36,6 +36,10 @@
 
 #define qemudLog(level, msg...) fprintf(stderr, msg)
 
+#ifndef ENODATA
+#define ENODATA EIO
+#endif
+
 static int
 virUUIDGenerateRandomBytes(unsigned char *buf,
                            int buflen)
Index: src/virsh.c
===================================================================
RCS file: /data/cvs/libvirt/src/virsh.c,v
retrieving revision 1.117
diff -u -r1.117 virsh.c
--- src/virsh.c	6 Dec 2007 10:24:52 -0000	1.117
+++ src/virsh.c	6 Dec 2007 11:28:03 -0000
@@ -37,6 +37,10 @@
 #include <inttypes.h>
 #include <test.h>
 
+#ifdef __MINGW32__
+#include <basetyps.h>
+#endif
+
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 #include <libxml/xpath.h>
@@ -441,6 +445,8 @@
     return ctl->conn ? TRUE : FALSE;
 }
 
+#ifndef __MINGW32__
+
 /*
  * "console" command
  */
@@ -506,6 +512,8 @@
     return ret;
 }
 
+#endif /* !__MINGW32__ */
+
 /*
  * "list" command
  */
@@ -3705,7 +3713,9 @@
     {"autostart", cmdAutostart, opts_autostart, info_autostart},
     {"capabilities", cmdCapabilities, NULL, info_capabilities},
     {"connect", cmdConnect, opts_connect, info_connect},
+#ifndef __MINGW32__
     {"console", cmdConsole, opts_console, info_console},
+#endif /* !__MINGW32__ */
     {"create", cmdCreate, opts_create, info_create},
     {"start", cmdStart, opts_start, info_start},
     {"destroy", cmdDestroy, opts_destroy, info_destroy},
Index: src/xen_unified.h
===================================================================
RCS file: /data/cvs/libvirt/src/xen_unified.h,v
retrieving revision 1.10
diff -u -r1.10 xen_unified.h
--- src/xen_unified.h	5 Dec 2007 13:56:22 -0000	1.10
+++ src/xen_unified.h	6 Dec 2007 11:28:03 -0000
@@ -13,8 +13,12 @@
 
 #include "internal.h"
 
+#ifndef HAVE_WINSOCK_H
 #include <sys/un.h>
 #include <netinet/in.h>
+#else
+#include <winsock.h>
+#endif
 
 #ifdef __cplusplus
 extern "C" {
