[Pkg-libvirt-commits] [SCM] Libguestfs Debian packaging branch, master, updated. debian/1.0.61-1

Guido Günther agx at sigxcpu.org
Sat Jul 18 11:21:15 UTC 2009


The following commit has been merged in the master branch:
commit 831bc5f66d22681360f17b89cc106fdd914a8234
Author: Guido Günther <agx at sigxcpu.org>
Date:   Fri Jul 17 09:46:46 2009 +0200

    Imported Upstream version 1.0.61

diff --git a/ChangeLog b/ChangeLog
index 0233300..1103e3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,287 @@
+2009-07-15  Richard Jones  <rjones at trick.home.annexia.org>
+
+	New tool virt-cat: display a file in a virtual machine.
+	This script is just a simpler way to cat a file from a VM.  It
+	is otherwise equivalent to using guestfish.
+
+	 virt-cat someguest /etc/fstab
+
+	 virt-cat someguest /var/log/messages | tail
+
+	Make Perl strings translatable using perl-libintl.
+	All Perl strings are now marked as translatable using __"string"
+	or __x("string {placeholder}", placeholder => $_).  Perl strings
+	now get copied to the PO files.
+
+	The po/POTFILES.in file is now updated automagically whenever we
+	add new *.c, *.pl or *.pm files into the repository.
+
+	guestfish: Add tilde expansion for paths (RHBZ#511372).
+	This commit adds tilde expansion for local users in guestfish:
+
+	  ><fs> echo "~"
+	  ~
+	  ><fs> echo ~
+	  /home/rjones
+	  ><fs> echo ~foo
+	  ~foo
+	  ><fs> echo ~rjones/bar
+	  /home/rjones/bar
+	  ><fs> echo ~roo
+	  ~roo
+	  ><fs> echo ~root/foo
+	  /root/foo
+	  ><fs> echo ~root
+	  /root
+
+2009-07-14  Richard W.M. Jones  <rjones at redhat.com>
+
+	Version 1.0.60.
+
+	java/Makefile.inc: Include this generated file.
+	We have to include this generated file because it is part of
+	the build system, thus required to exist before the generator
+	runs.
+
+	File missing from tarball: rc_protocol.x
+
+	Version 1.0.59.
+
+	RHEL 5: header was called <sys/xattr.h>
+
+	Fix: daemon/xattr.c can now compile even when no xattr support.
+
+2009-07-14  Richard Jones  <rjones at trick.home.annexia.org>
+
+	Guestfish feature: remote control of guestfish over a pipe.
+	The use case is to have a long-running guestfish process in
+	a shell script, and thus to avoid the overhead of starting
+	guestfish each time.  Do:
+
+	 eval `guestfish --listen`
+
+	 guestfish --remote somecmd
+	 guestfish --remote someothercmd
+	 guestfish --remote exit
+
+	This patch also supports having multiple guestfish processes
+	at the same time.
+
+	The protocol is simple XDR messages over a Unix domain socket.
+
+2009-07-14  Richard W.M. Jones  <rjones at redhat.com>
+
+	Removed getfattr/setfattr from TODO list, since now implemented.
+
+	Support for Linux extended attributes.
+	This commit adds six calls to support Linux extended attributes.
+	They are:
+	  getxattrs     list all extended attributes for a file or directory
+	  setxattr      add/replace an extended attribute
+	  removexattr   remove an extended attribute
+	  lgetxattrs    \
+	  lsetxattr     (same as above, but operate on symbolic links)
+	  lremovexattr  /
+
+	See attr(5) for more information.
+
+	This also adds support for the FBuffer field type, which maps to
+	an XDR opaque<> or a C (int, char *) pair.
+
+2009-07-14  Richard Jones  <rjones at trick.home.annexia.org>
+
+	virt-inspector: Ignore swap partitions marked as "none".
+
+	Improve launch error message.
+	The previous error message was confusing for new users:
+
+	  libguestfs: error: guestfs_mount: call launch() before using this function
+
+	The new error message explains the action that the user must take,
+	especially if they are using guestfish:
+
+	  ><fs> mount /dev/sda1 /
+	  libguestfs: error: guestfs_mount: call launch before using this function
+	  (in guestfish, don't forget to use the 'run' command)
+
+	Add reiserfs module to kernel whitelist.
+
+2009-07-13  Richard Jones  <rjones at trick.home.annexia.org>
+
+	Only allow virt-v2v to be run on single root guests (ie. no multi-boot).
+
+	Ignore old-style initrd which is a compressed ext2 filesystem.
+	'cpio' chokes on these, taking ages to decide that they are
+	not cpio files, and producing masses of messages.  This was
+	causing virt-inspector to be very slow (many minutes) on
+	RHEL 3 guests.  With this fix, speed is back to normal.
+
+	Implement new 'zfile' command, to show file type inside compressed files.
+
+	Ignore java/Makefile.inc (generated file).
+
+2009-07-13  Matthew Booth  <mbooth at redhat.com>
+
+	Automatically generate list of built java sources
+
+	Revert "Fix checking of generator being run from the right directory."
+	This reverts commit 35c646965a21d452cf74ef3683612210a653c36d.
+
+	As well as reverting this change, add a comment explaining that
+	configure must run first.
+
+2009-07-13  Richard Jones  <rjones at trick.home.annexia.org>
+
+	Move BUILT_SOURCES so the comment is back in the right place.
+
+	Order alphabetically the options in guestfish.1 manpage.
+
+2009-07-11  Richard W.M. Jones  <rjones at redhat.com>
+
+	Guestfish: implement -x option, echo commands before executing them.
+
+	Fix: '-D' was not recognized as a parameter to guestfish.
+
+	Regression test: Test reopening the handle in the same process.
+
+	Guestfish: Add 'reopen' command to reopen the libguestfs handle.
+
+	Add missing documentation for "more" command in guestfish help output.
+
+	Add tests to many non-daemon functions.
+	Tests are added to the following functions:
+	  get_qemu get_path get_append get_autosync
+	  is_ready is_config is_launching is_busy
+	  set_memsize get_memsize get_pid
+
+	Add TestOutputIntOp, CompareWithIntOp.
+	These constructors allow enhanced tests where we compare
+	the result of a test against some operator, eg. >= 1 or < 5
+
+	Test for "version" command should be InitNone.
+
+	Add comment to the code about InitNone and InitEmpty.
+	These two constructors are treated as identical, but they
+	should be distinct concepts.
+
+	Fix UPDATES and host_cpu in configure.ac.
+	UPDATES does not need to be propagated into config.h.
+
+	host_cpu was AC_DEFINE'd twice.
+
+2009-07-11  Richard Jones  <rjones at trick.home.annexia.org>
+
+	Documentation for virt-v2v.
+
+	V2V outline program.
+
+2009-07-10  Richard W.M. Jones  <rjones at redhat.com>
+
+	Don't list Java files explicitly, since these files are auto-generated.
+
+	Version 1.0.58.
+
+	Proposal to add BufferIn and RBufferOut types (not implemented).
+
+	Sys::Guestfs::Lib: Exit with error if a libvirt domain appears to have no disks.
+
+	virt-df: Recognise libvirt domains with file-backed disks.
+	File-backed disks (<source file="...">) didn't get recognised
+	before.  This patch fixes the problem.
+
+2009-07-10  Richard Jones  <rjones at trick.home.annexia.org>
+
+	Add --version options to virt-df, virt-inspector and virt-v2v.
+
+	Add 'version' call to get true library version number.
+	This patch also changes the way that the version is specified
+	in configure.ac.  It is now made out of four parts (major, minor,
+	release and extra) and constructed for AC_INIT.
+
+	Move 'use File::Temp' from virt-inspector program to Sys::Guestfs::Lib.
+
+	Version 1.0.57.
+
+	Update PO files.
+
+	Additional C files for POTFILES.in.
+
+	Rename internal subroutines with leading underscore character.
+	Otherwise Pod::Coverage in the tests will complain that the
+	internal subroutines are undocumented.
+
+	Working version of virt-df.
+
+	Fix for returning structures (hashes) from Perl calls.
+	Calls such as stat and statvfs which returned a single structure
+	were returning an array of values instead of a full hash of keys +
+	values.
+
+	Fix this by pushing the key names on the stack too.
+
+	'$_' should be marked as a local variable in Sys::Guestfs::Lib::open_guest.
+
+	Properly close fds and unregister handlers in guestfs_close.
+	This caused a segfault if you tried to repeatedly open and close
+	a guestfs handle in the same program.  The reason is that the
+	old handler remained registered (not always - it was racey).
+
+	This adds proper cleanup to the guestfs_close path, also for file
+	descriptors.
+
+	Added framework for 'virt-df' command.
+
+	Ignore any file called 'localconfigure'.
+	Developers should put their custom parameters for configure/autogen.sh
+	into a script called ./localconfigure, and this script will be ignored
+	by git and the build system.
+
+	Added outline of the virt-v2v script.
+
+2009-07-09  Richard Jones  <rjones at trick.home.annexia.org>
+
+	Remove virt-inspector --force option - it didn't do anything.
+
+	Sys::Guestfs::Lib minor documentation clean-up.
+
+	Move the inspection analysis code into Sys::Guestfs::Lib library.
+	Creates new functions:
+	  inspect_all_partitions
+	  inspect_partition
+	  inspect_operating_systems
+	  mount_operating_system
+	  inspect_in_detail
+
+	Includes far more documentation for the process.
+
+	Move 'resolve_windows_path' to Sys::Guestfs::Lib.
+
+	Move 'get_partitions' call into Sys::Guestfs::Lib.
+
+	Add Sys::Guestfs::Lib - useful functions for using libguestfs from Perl.
+	This adds an extra Perl module called Sys::Guestfs::Lib which
+	adds useful functions for using libguestfs from Perl.
+
+	The intention is that common code shared between virt-inspector,
+	virt-df and virt-v2v will move into this library.
+
+	This patch also changes virt-inspector to use this library.
+
+	Just whitespace changes in the generator code.
+
+2009-07-08  Richard Jones  <rjones at trick.home.annexia.org>
+
+	Update with links to the new mailing list.
+
+2009-07-07  Richard W.M. Jones  <rjones at redhat.com>
+
+	Fix checking of generator being run from the right directory.
+	Originally it was looking for 'config.status', but this file
+	might not exist until configure has been run.  Make it look for
+	HACKING instead.
+
+	Version 1.0.56.
+
 2009-07-07  Richard Jones  <rjones at centos5x32.home.annexia.org>
 
 	RHEL 5: Mount squashfs with explicit type.
diff --git a/HACKING b/HACKING
index b42a807..6ca33be 100644
--- a/HACKING
+++ b/HACKING
@@ -30,6 +30,9 @@ Directories
 appliance/
 	The qemu appliance, build scripts and so on.
 
+cat/
+	The virt-cat tool.
+
 capitests/
 	Automated tests of the C API.
 
@@ -39,6 +42,9 @@ contrib/
 daemon/
 	The daemon that runs inside the guest and carries out actions.
 
+df/
+	The virt-df tool.
+
 examples/
 	The examples.
 
@@ -85,6 +91,9 @@ src/
 	Source code to the C library.
 	Also contains the crucial generator program.
 
+v2v/
+	Xen to KVM (V2V) conversion tool.
+
 Debugging
 ----------------------------------------------------------------------
 
@@ -97,8 +106,8 @@ they will show up if you use 'guestfish -v'.
 Patches
 ----------------------------------------------------------------------
 
-Submit patches to the fedora-virt mailing list:
-http://www.redhat.com/mailman/listinfo/fedora-virt
+Submit patches to the mailing list:
+http://www.redhat.com/mailman/listinfo/libguestfs
 and CC to rjones at redhat.com
 
 I18N
diff --git a/Makefile.am b/Makefile.am
index 1cb2299..b425ddd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,6 +41,15 @@ endif
 if HAVE_INSPECTOR
 SUBDIRS += inspector
 endif
+if HAVE_V2V
+SUBDIRS += v2v
+endif
+if HAVE_DF
+SUBDIRS += df
+endif
+if HAVE_CAT
+SUBDIRS += cat
+endif
 
 EXTRA_DIST = \
 	config.rpath \
@@ -123,7 +132,10 @@ html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcar
 	mv $@-t $@
 
 HTMLFILES = html/guestfs.3.html html/guestfish.1.html \
+	html/virt-cat.1.html \
+	html/virt-df.1.html \
 	html/virt-inspector.1.html \
+	html/virt-v2v.1.html \
 	html/recipes.html \
 	html/pod.css html/recipes.css
 
@@ -141,6 +153,15 @@ dist-hook:
 	./gitlog-to-changelog > ChangeLog
 	cp ChangeLog $(distdir)/ChangeLog
 
+# Update the list of translatable files in po/POTFILES.in.
+all-local:
+	find -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
+	grep -v '/blib/' | \
+	grep -v '/capitests/' | \
+	grep -v '/examples/' | \
+	sort | \
+	sed 's,^\./,,' > $(srcdir)/po/POTFILES.in
+
 # Pkgconfig.
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git a/Makefile.in b/Makefile.in
index a0b87d2..26bd77a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -33,8 +34,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -56,6 +58,9 @@ host_triplet = @host@
 @HAVE_JAVA_TRUE at am__append_5 = java
 @HAVE_HASKELL_TRUE at am__append_6 = haskell
 @HAVE_INSPECTOR_TRUE at am__append_7 = inspector
+ at HAVE_V2V_TRUE@am__append_8 = v2v
+ at HAVE_DF_TRUE@am__append_9 = df
+ at HAVE_CAT_TRUE@am__append_10 = cat
 subdir = .
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
@@ -80,6 +85,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES = appliance/debian/debirf.conf libguestfs.pc
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -89,33 +95,76 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \
 	"$(DESTDIR)$(pkgconfigdir)"
 man3dir = $(mandir)/man3
 NROFF = nroff
 MANS = $(man_MANS)
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-    *) f=$$p;; \
-  esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-pkgconfigDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(noinst_DATA) $(pkgconfig_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir dist dist-all distcheck
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = src daemon appliance fish po examples images capitests \
-	regressions ocaml perl python ruby java haskell inspector
+	regressions ocaml perl python ruby java haskell inspector v2v \
+	df cat
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d $(distdir) \
-    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr $(distdir); }; }
+  { test ! -d "$(distdir)" \
+    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr "$(distdir)"; }; }
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
@@ -299,7 +348,8 @@ ACLOCAL_AMFLAGS = -I m4
 SUBDIRS = src daemon appliance fish po examples images capitests \
 	regressions $(am__append_1) $(am__append_2) $(am__append_3) \
 	$(am__append_4) $(am__append_5) $(am__append_6) \
-	$(am__append_7)
+	$(am__append_7) $(am__append_8) $(am__append_9) \
+	$(am__append_10)
 EXTRA_DIST = \
 	config.rpath \
 	guestfs.pod guestfs-actions.pod guestfs-structs.pod \
@@ -329,7 +379,10 @@ EXTRA_DIST = \
 man_MANS = guestfs.3 libguestfs.3 guestfish.1
 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
 HTMLFILES = html/guestfs.3.html html/guestfish.1.html \
+	html/virt-cat.1.html \
+	html/virt-df.1.html \
 	html/virt-inspector.1.html \
+	html/virt-v2v.1.html \
 	html/recipes.html \
 	html/pod.css html/recipes.css
 
@@ -352,15 +405,15 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
-	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
 		&& exit 0; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -376,9 +429,10 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC
 	$(SHELL) ./config.status --recheck
 
 $(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(srcdir) && $(AUTOCONF)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
 
 config.h: stamp-h1
 	@if test ! -f $@; then \
@@ -390,7 +444,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
 	cd $(top_builddir) && $(SHELL) ./config.status config.h
 $(srcdir)/config.h.in:  $(am__configure_deps) 
-	cd $(top_srcdir) && $(AUTOHEADER)
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
 	rm -f stamp-h1
 	touch $@
 
@@ -409,113 +463,102 @@ clean-libtool:
 
 distclean-libtool:
 	-rm -f libtool config.lt
-install-man1: $(man1_MANS) $(man_MANS)
+install-man1: $(man_MANS)
 	@$(NORMAL_INSTALL)
 	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.1*) list="$$list $$i" ;; \
-	  esac; \
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+	  fi; \
 	done; \
-	for i in $$list; do \
-	  if test -f $$i; then file=$$i; \
-	  else file=$(srcdir)/$$i; fi; \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    1*) ;; \
-	    *) ext='1' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
-	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
-	done
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+	done; }
+
 uninstall-man1:
 	@$(NORMAL_UNINSTALL)
-	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.1*) list="$$list $$i" ;; \
-	  esac; \
-	done; \
-	for i in $$list; do \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    1*) ;; \
-	    *) ext='1' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
-	  rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
-	done
-install-man3: $(man3_MANS) $(man_MANS)
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+install-man3: $(man_MANS)
 	@$(NORMAL_INSTALL)
 	test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)"
-	@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.3*) list="$$list $$i" ;; \
-	  esac; \
+	@list=''; test -n "$(man3dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.3[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
+	  fi; \
 	done; \
-	for i in $$list; do \
-	  if test -f $$i; then file=$$i; \
-	  else file=$(srcdir)/$$i; fi; \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    3*) ;; \
-	    *) ext='3' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
-	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst"; \
-	done
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
+	done; }
+
 uninstall-man3:
 	@$(NORMAL_UNINSTALL)
-	@list='$(man3_MANS) $(dist_man3_MANS) $(nodist_man3_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.3*) list="$$list $$i" ;; \
-	  esac; \
-	done; \
-	for i in $$list; do \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    3*) ;; \
-	    *) ext='3' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f '$(DESTDIR)$(man3dir)/$$inst'"; \
-	  rm -f "$(DESTDIR)$(man3dir)/$$inst"; \
-	done
+	@list=''; test -n "$(man3dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.3[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man3dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man3dir)" && rm -f $$files; }
 install-pkgconfigDATA: $(pkgconfig_DATA)
 	@$(NORMAL_INSTALL)
 	test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
-	@list='$(pkgconfig_DATA)'; for p in $$list; do \
+	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
-	  $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
 	done
 
 uninstall-pkgconfigDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(pkgconfig_DATA)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
-	done
+	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
@@ -541,7 +584,7 @@ $(RECURSIVE_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
@@ -575,16 +618,16 @@ $(RECURSIVE_CLEAN_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
 	done
 ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -599,7 +642,7 @@ tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
@@ -611,7 +654,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test ! -f $$subdir/TAGS || \
-	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
@@ -620,36 +663,54 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
 	$(am__remove_distdir)
-	test -d $(distdir) || mkdir $(distdir)
+	test -d "$(distdir)" || mkdir "$(distdir)"
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -665,29 +726,44 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test -d "$(distdir)/$$subdir" \
 	    || $(MKDIR_P) "$(distdir)/$$subdir" \
 	    || exit 1; \
-	    distdir=`$(am__cd) $(distdir) && pwd`; \
-	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
-	    (cd $$subdir && \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
 	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$top_distdir" \
-	        distdir="$$distdir/$$subdir" \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
 		am__remove_distdir=: \
 		am__skip_length_check=: \
+		am__skip_mode_fix=: \
 	        distdir) \
 	      || exit 1; \
 	  fi; \
@@ -695,11 +771,12 @@ distdir: $(DISTFILES)
 	$(MAKE) $(AM_MAKEFLAGS) \
 	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
 	  dist-hook
-	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
 	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
 	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
-	|| chmod -R a+r $(distdir)
+	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
 	$(am__remove_distdir)
@@ -712,6 +789,10 @@ dist-lzma: distdir
 	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
 	$(am__remove_distdir)
 
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+	$(am__remove_distdir)
+
 dist-tarZ: distdir
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__remove_distdir)
@@ -740,6 +821,8 @@ distcheck: dist
 	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lzma*) \
 	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
@@ -751,9 +834,11 @@ distcheck: dist
 	mkdir $(distdir)/_build
 	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-	  && cd $(distdir)/_build \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
@@ -775,13 +860,15 @@ distcheck: dist
 	  && rm -rf "$$dc_destdir" \
 	  && $(MAKE) $(AM_MAKEFLAGS) dist \
 	  && rm -rf $(DIST_ARCHIVES) \
-	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
 	$(am__remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@cd $(distuninstallcheck_dir) \
+	@$(am__cd) '$(distuninstallcheck_dir)' \
 	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
@@ -800,7 +887,7 @@ distcleancheck: distclean
 	       exit 1; } >&2
 check-am: all-am
 check: check-recursive
-all-am: Makefile $(MANS) $(DATA) config.h
+all-am: Makefile $(MANS) $(DATA) config.h all-local
 installdirs: installdirs-recursive
 installdirs-am:
 	for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(pkgconfigdir)"; do \
@@ -827,6 +914,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -847,6 +935,8 @@ dvi-am:
 
 html: html-recursive
 
+html-am:
+
 info: info-recursive
 
 info-am:
@@ -855,18 +945,28 @@ install-data-am: install-man install-pkgconfigDATA
 
 install-dvi: install-dvi-recursive
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-recursive
 
+install-html-am:
+
 install-info: install-info-recursive
 
+install-info-am:
+
 install-man: install-man1 install-man3
 
 install-pdf: install-pdf-recursive
 
+install-pdf-am:
+
 install-ps: install-ps-recursive
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -891,26 +991,27 @@ uninstall-am: uninstall-man uninstall-pkgconfigDATA
 
 uninstall-man: uninstall-man1 uninstall-man3
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
-	install-strip
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
+	ctags-recursive install-am install-strip tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am am--refresh check check-am clean clean-generic \
-	clean-libtool clean-local ctags ctags-recursive dist dist-all \
-	dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar dist-tarZ \
-	dist-zip distcheck distclean distclean-generic distclean-hdr \
-	distclean-libtool distclean-tags distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-man1 install-man3 install-pdf install-pdf-am \
-	install-pkgconfigDATA install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs installdirs-am \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
-	tags tags-recursive uninstall uninstall-am uninstall-man \
-	uninstall-man1 uninstall-man3 uninstall-pkgconfigDATA
+	all all-am all-local am--refresh check check-am clean \
+	clean-generic clean-libtool clean-local ctags ctags-recursive \
+	dist dist-all dist-bzip2 dist-gzip dist-hook dist-lzma \
+	dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
+	distclean-generic distclean-hdr distclean-libtool \
+	distclean-tags distcleancheck distdir distuninstallcheck dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-man1 \
+	install-man3 install-pdf install-pdf-am install-pkgconfigDATA \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-man uninstall-man1 \
+	uninstall-man3 uninstall-pkgconfigDATA
 
 
 guestfs.3: guestfs.pod guestfs-actions.pod guestfs-structs.pod
@@ -973,8 +1074,18 @@ dist-hook:
 	./gitlog-to-changelog > ChangeLog
 	cp ChangeLog $(distdir)/ChangeLog
 
+# Update the list of translatable files in po/POTFILES.in.
+all-local:
+	find -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
+	grep -v '/blib/' | \
+	grep -v '/capitests/' | \
+	grep -v '/examples/' | \
+	sort | \
+	sed 's,^\./,,' > $(srcdir)/po/POTFILES.in
+
 clean-local:
 	rm -rf initramfs
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/README b/README
index e376cc7..d56d21e 100644
--- a/README
+++ b/README
@@ -19,10 +19,11 @@ Libguestfs is a library that can be linked with C and C++ management
 programs (or management programs written in OCaml, Perl, Python, Ruby, Java
 or Haskell).  You can also use it from shell scripts or the command line.
 
-Libguestfs was written by Richard W.M. Jones (rjones at redhat.com).
-For discussion please use the fedora-virt mailing list:
+Libguestfs was written by Richard W.M. Jones (rjones at redhat.com) and
+hacked on by lots of other people.  For discussion, development,
+patches, etc. please use the mailing list:
 
-  https://www.redhat.com/mailman/listinfo/fedora-virt
+  http://www.redhat.com/mailman/listinfo/libguestfs
 
 
 Home page
@@ -76,6 +77,8 @@ bindings
 - (Optional) Perl XML::XPath, Sys::Virt modules (for libvirt support
 in virt-inspector).
 
+- (Optional, but highly recommended) perl-libintl for translating perl code.
+
 Running ./configure will check you have all the requirements installed
 on your machine.
 
@@ -123,13 +126,17 @@ or build from our source RPMs.
 Debian
 ----------------------------------------------------------------------
 
-libguestfs should build and run on Debian.
+libguestfs is now built as a package in Debian by Guido Gunther and
+the other Debian libvirt maintainers.  See:
+
+http://wiki.debian.org/Teams/DebianLibvirtTeam#Packages
 
-febootstrap, yum, rpm, fakeroot, fakechroot are all packaged in
-Debian.
+You can build for Debian in two different ways, either building a
+Fedora-based appliance using febootstrap, yum, rpm, fakeroot,
+fakechroot (all packaged in Debian).  However the recommended way is
+to build a Debian-based appliance using debootstrap and debirf.
 
-Please see the fedora-virt mailing list for the status of libguestfs
-in Debian.
+Both ways are supported by the configure script.
 
 
 qemu
diff --git a/TODO b/TODO
index 5b4c843..4133122 100644
--- a/TODO
+++ b/TODO
@@ -127,8 +127,6 @@ Extra commands / functionality:
     some sort of alloc/fallocate/posix_fallocate call to create empty space
     realpath
     trunc[ate??]
-    getfattr (also useful because gives us access to NTFS datastreams)
-    setfattr
 
   ext2 properties:
     chattr
@@ -178,11 +176,3 @@ Other initrd-* commands, such as:
 
 initrd-extract
 initrd-replace
-
-----------------------------------------------------------------------
-
-Control guestfish from a pipe.
-
-For shell scripts - they can start up a long-running guestfish process
-and intermittently send it commands.  Avoids the start-up overhead,
-but how do we reliably signal errors?
\ No newline at end of file
diff --git a/aclocal.m4 b/aclocal.m4
index 4b73ffe..b6f7610 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -31,10 +31,10 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.10'
+[am__api_version='1.11'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.10.2], [],
+m4_if([$1], [1.11], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -50,7 +50,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10.2])dnl
+[AM_AUTOMAKE_VERSION([1.11])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -110,14 +110,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
+# serial 9
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
@@ -130,6 +130,7 @@ AC_SUBST([$1_TRUE])dnl
 AC_SUBST([$1_FALSE])dnl
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
 if $2; then
   $1_TRUE=
   $1_FALSE='#'
@@ -143,14 +144,14 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
+# serial 10
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -207,6 +208,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
   fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -224,7 +235,17 @@ AC_CACHE_CHECK([dependency style of $depcc],
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
@@ -234,19 +255,23 @@ AC_CACHE_CHECK([dependency style of $depcc],
 	break
       fi
       ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -310,59 +335,61 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 4
+#serial 5
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[# Autoconf 2.62 quotes --file arguments for eval, but not when files
-# are listed without --file.  Let's play safe and only enable the eval
-# if we detect the quoting.
-case $CONFIG_FILES in
-*\'*) eval set x "$CONFIG_FILES" ;;
-*)   set x $CONFIG_FILES ;;
-esac
-shift
-for mf
-do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # Grep'ing the whole file is not good either: AIX grep has a line
-  # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
 
@@ -382,13 +409,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # Do all the work for Automake.                             -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008 Free Software Foundation, Inc.
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 13
+# serial 16
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
@@ -405,7 +432,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.60])dnl
+[AC_PREREQ([2.62])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -456,8 +483,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf)
 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
 AM_MISSING_PROG(AUTOHEADER, autoheader)
 AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
@@ -465,24 +492,37 @@ AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-	      		     [_AM_PROG_TAR([v7])])])
+	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+			     [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-                  [_AM_DEPENDENCIES(CC)],
-                  [define([AC_PROG_CC],
-                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+		  [_AM_DEPENDENCIES(CC)],
+		  [define([AC_PROG_CC],
+			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                  [_AM_DEPENDENCIES(CXX)],
-                  [define([AC_PROG_CXX],
-                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+		  [_AM_DEPENDENCIES(CXX)],
+		  [define([AC_PROG_CXX],
+			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-                  [_AM_DEPENDENCIES(OBJC)],
-                  [define([AC_PROG_OBJC],
-                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+		  [_AM_DEPENDENCIES(OBJC)],
+		  [define([AC_PROG_OBJC],
+			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
 ])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
 
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
@@ -505,7 +545,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -516,7 +556,14 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
 AC_SUBST(install_sh)])
 
 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
@@ -542,13 +589,13 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
+# serial 4
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -557,7 +604,7 @@ AC_DEFUN([AM_MAKE_INCLUDE],
 [am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
@@ -567,24 +614,24 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 AC_SUBST([am__include])
 AC_SUBST([am__quote])
@@ -629,14 +676,14 @@ m4_define([AC_PROG_CC],
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -653,7 +700,14 @@ AC_SUBST($1)])
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
@@ -724,14 +778,14 @@ AC_DEFUN([_AM_IF_OPTION],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 # AM_SANITY_CHECK
 # ---------------
@@ -740,16 +794,29 @@ AC_DEFUN([AM_SANITY_CHECK],
 # Just in case
 sleep 1
 echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
    if test "$[*]" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t "$srcdir/configure" conftest.file`
    fi
    rm -f conftest.file
    if test "$[*]" != "X $srcdir/configure conftest.file" \
@@ -802,18 +869,25 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 2
+
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
 # This macro is traced by Automake.
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
 # Check how to create a tarball.                            -*- Autoconf -*-
 
 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
diff --git a/appliance/Makefile.in b/appliance/Makefile.in
index 3813b2e..ebe88ae 100644
--- a/appliance/Makefile.in
+++ b/appliance/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -34,8 +35,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -71,18 +73,32 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = make.sh update.sh supermin-split.sh \
 	supermin-make.sh libguestfs-supermin-helper
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(fsdir)"
-binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-SCRIPTS = $(bin_SCRIPTS)
-SOURCES =
-DIST_SOURCES =
+CONFIG_CLEAN_VPATH_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-fsDATA_INSTALL = $(INSTALL_DATA)
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(fsdir)"
+SCRIPTS = $(bin_SCRIPTS)
+SOURCES =
+DIST_SOURCES =
 DATA = $(fs_DATA) $(noinst_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
@@ -319,9 +335,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  appliance/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  appliance/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign appliance/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign appliance/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -339,6 +355,7 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 make.sh: $(top_builddir)/config.status $(srcdir)/make.sh.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 update.sh: $(top_builddir)/config.status $(srcdir)/update.sh.in
@@ -352,22 +369,37 @@ libguestfs-supermin-helper: $(top_builddir)/config.status $(srcdir)/libguestfs-s
 install-binSCRIPTS: $(bin_SCRIPTS)
 	@$(NORMAL_INSTALL)
 	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
-	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  if test -f $$d$$p; then \
-	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
-	    echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
-	    $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
-	  else :; fi; \
-	done
+	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n' \
+	    -e 'h;s|.*|.|' \
+	    -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+	      if (++n[d] == $(am__install_max)) { \
+		print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+	    else { print "f", d "/" $$4, $$1 } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	     if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	     test -z "$$files" || { \
+	       echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	       $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	     } \
+	; done
 
 uninstall-binSCRIPTS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(bin_SCRIPTS)'; for p in $$list; do \
-	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
-	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
-	done
+	@list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	       sed -e 's,.*/,,;$(transform)'`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -377,20 +409,23 @@ clean-libtool:
 install-fsDATA: $(fs_DATA)
 	@$(NORMAL_INSTALL)
 	test -z "$(fsdir)" || $(MKDIR_P) "$(DESTDIR)$(fsdir)"
-	@list='$(fs_DATA)'; for p in $$list; do \
+	@list='$(fs_DATA)'; test -n "$(fsdir)" || list=; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(fsDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(fsdir)/$$f'"; \
-	  $(fsDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(fsdir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(fsdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(fsdir)" || exit $$?; \
 	done
 
 uninstall-fsDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(fs_DATA)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(fsdir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(fsdir)/$$f"; \
-	done
+	@list='$(fs_DATA)'; test -n "$(fsdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(fsdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(fsdir)" && rm -f $$files
 tags: TAGS
 TAGS:
 
@@ -414,13 +449,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -452,6 +491,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -470,6 +510,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -478,18 +520,28 @@ install-data-am: install-fsDATA
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am: install-binSCRIPTS
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -603,6 +655,7 @@ test-boot-realistic: emptydisk
 
 clean-local:
 	rm -rf $(top_builddir)/initramfs
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/appliance/kmod.whitelist b/appliance/kmod.whitelist
index f94130a..60681fe 100644
--- a/appliance/kmod.whitelist
+++ b/appliance/kmod.whitelist
@@ -29,3 +29,4 @@ hfsplus.ko
 ufs.ko
 exportfs.ko
 xfs.ko
+reiserfs.ko
diff --git a/appliance/kmod.whitelist.in b/appliance/kmod.whitelist.in
index 590285d..734b3c4 100644
--- a/appliance/kmod.whitelist.in
+++ b/appliance/kmod.whitelist.in
@@ -46,3 +46,5 @@ hfsplus.ko
 ufs.ko
 exportfs.ko
 xfs.ko
+
+reiserfs.ko
\ No newline at end of file
diff --git a/appliance/libguestfs-supermin-helper b/appliance/libguestfs-supermin-helper
index b50b5e4..66b4dc3 100755
--- a/appliance/libguestfs-supermin-helper
+++ b/appliance/libguestfs-supermin-helper
@@ -37,7 +37,7 @@ initrd="$3"
 # RHEL 5 didn't append the arch to the kernel name, so look for kernels
 # without arch second.
 
-arch=$(echo "i686" | sed 's/^i.86$/i?86/')
+arch=$(echo "x86_64" | sed 's/^i.86$/i?86/')
 kernels=$(ls -1vr /boot/vmlinuz-*.$arch* 2>/dev/null | grep -v xen; ls -1vr /boot/vmlinuz-* 2>/dev/null | grep -v xen)
 for f in $kernels; do
     b=$(basename "$f")
@@ -57,14 +57,14 @@ fi
 
 # The initrd consists of these components:
 # (1) The base skeleton appliance that we constructed at build time.
-#     name = initramfs.fedora-11.i686.supermin.img
+#     name = initramfs.fedora-11.x86_64.supermin.img
 #     format = compressed cpio
 # (2) The modules from modpath which are on the module whitelist.
 #     format = plain cpio
 # (3) The host files which match wildcards in *.supermin.hostfiles.
 #     format = plain cpio
 
-cp "$sourcedir"/initramfs.fedora-11.i686.supermin.img "$initrd"
+cp "$sourcedir"/initramfs.fedora-11.x86_64.supermin.img "$initrd"
 
 # Kernel modules (2).
 exec 5<"$sourcedir"/kmod.whitelist
@@ -81,6 +81,6 @@ find "$modpath" \( -not -name '*.ko' $whitelist \) -a -print0 |
 
 (cd / && \
   ls -1df $(
-      cat "$sourcedir"/initramfs.fedora-11.i686.supermin.hostfiles
+      cat "$sourcedir"/initramfs.fedora-11.x86_64.supermin.hostfiles
     ) 2>/dev/null |
   cpio --quiet -o -H newc ) >> "$initrd"
diff --git a/appliance/make.sh b/appliance/make.sh
index a36f7db..f2d4642 100755
--- a/appliance/make.sh
+++ b/appliance/make.sh
@@ -26,8 +26,8 @@ set -x
 if [ "REDHAT" = "REDHAT" ]; then
   cd ..
   # Decide on names for the final output.  These have to match Makefile.am.
-  output=appliance/initramfs.fedora-11.i686.img
-  koutput=appliance/vmlinuz.fedora-11.i686
+  output=appliance/initramfs.fedora-11.x86_64.img
+  koutput=appliance/vmlinuz.fedora-11.x86_64
   rm -f $output
   rm -f $koutput
 
@@ -39,7 +39,7 @@ if [ "REDHAT" = "REDHAT" ]; then
   done
   exec 5<&-
 
-  febootstrap $packages -u updates-released-f11 fedora-11 initramfs 
+  febootstrap $packages -u http://www.mirrorservice.org/sites/download.fedora.redhat.com/pub/fedora/linux/updates/11/x86_64/ fedora-11 initramfs http://www.mirrorservice.org/sites/download.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/x86_64/os/
 
   # /sysroot is where the guest root filesystem will be mounted.
   febootstrap-run initramfs -- mkdir -p --mode=0777 /sysroot
diff --git a/appliance/supermin-make.sh b/appliance/supermin-make.sh
index 834a169..125a75c 100755
--- a/appliance/supermin-make.sh
+++ b/appliance/supermin-make.sh
@@ -25,7 +25,7 @@ set -e
 
 cd ..
 
-output=appliance/initramfs.fedora-11.i686.supermin.img
+output=appliance/initramfs.fedora-11.x86_64.supermin.img
 
 # Generate final image.
 febootstrap-to-initramfs \
diff --git a/appliance/supermin-split.sh b/appliance/supermin-split.sh
index 2e8a15f..fce8b23 100755
--- a/appliance/supermin-split.sh
+++ b/appliance/supermin-split.sh
@@ -39,7 +39,7 @@ set -e
 cd ../initramfs
 
 incfiles=../appliance/supermin.incfiles
-hostfiles=../appliance/initramfs.fedora-11.i686.supermin.hostfiles
+hostfiles=../appliance/initramfs.fedora-11.x86_64.supermin.hostfiles
 
 exec 5>$incfiles
 exec 6>$hostfiles
diff --git a/appliance/update.sh b/appliance/update.sh
index 10ad08b..e1044d5 100755
--- a/appliance/update.sh
+++ b/appliance/update.sh
@@ -25,7 +25,7 @@ set -e
 
 if [ "REDHAT" = "REDHAT" ]; then
   cd ..
-  output=appliance/initramfs.fedora-11.i686.img
+  output=appliance/initramfs.fedora-11.x86_64.img
 
   # Create the init script.
   febootstrap-install initramfs appliance/../appliance/init /init 0755 root.root
@@ -40,8 +40,8 @@ if [ "REDHAT" = "REDHAT" ]; then
 elif [ "REDHAT" = "DEBIAN" ]; then
   cd ../appliance
 
-  output=initramfs.fedora-11.i686.img
-  vmlinuz=vmlinuz.fedora-11.i686
+  output=initramfs.fedora-11.x86_64.img
+  vmlinuz=vmlinuz.fedora-11.x86_64
 
   ln -sf debian/debirf-libguestfs_fedora-11*.cgz $output
   ln -sf debian/vmlinuz-* $vmlinuz
diff --git a/capitests/Makefile.in b/capitests/Makefile.in
index d50c3fa..bd4d22c 100644
--- a/capitests/Makefile.in
+++ b/capitests/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -32,8 +33,9 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -66,6 +68,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am_test_command_OBJECTS = test-command.$(OBJEXT)
 test_command_OBJECTS = $(am_test_command_OBJECTS)
 test_command_LDADD = $(LDADD)
@@ -81,6 +84,7 @@ tests_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -94,6 +98,8 @@ SOURCES = $(test_command_SOURCES) $(tests_SOURCES)
 DIST_SOURCES = $(test_command_SOURCES) $(tests_SOURCES)
 ETAGS = etags
 CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -305,9 +311,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  capitests/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  capitests/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign capitests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign capitests/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -325,13 +331,16 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 clean-checkPROGRAMS:
-	@list='$(check_PROGRAMS)'; for p in $$list; do \
-	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  echo " rm -f $$p $$f"; \
-	  rm -f $$p $$f ; \
-	done
+	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
 test-command$(EXEEXT): $(test_command_OBJECTS) $(test_command_DEPENDENCIES) 
 	@rm -f test-command$(EXEEXT)
 	$(test_command_LINK) $(test_command_OBJECTS) $(test_command_LDADD) $(LIBS)
@@ -350,35 +359,35 @@ distclean-compile:
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
 tests-tests.o: tests.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_CFLAGS) $(CFLAGS) -MT tests-tests.o -MD -MP -MF $(DEPDIR)/tests-tests.Tpo -c -o tests-tests.o `test -f 'tests.c' || echo '$(srcdir)/'`tests.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/tests-tests.Tpo $(DEPDIR)/tests-tests.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/tests-tests.Tpo $(DEPDIR)/tests-tests.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tests.c' object='tests-tests.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_CFLAGS) $(CFLAGS) -c -o tests-tests.o `test -f 'tests.c' || echo '$(srcdir)/'`tests.c
 
 tests-tests.obj: tests.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_CFLAGS) $(CFLAGS) -MT tests-tests.obj -MD -MP -MF $(DEPDIR)/tests-tests.Tpo -c -o tests-tests.obj `if test -f 'tests.c'; then $(CYGPATH_W) 'tests.c'; else $(CYGPATH_W) '$(srcdir)/tests.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/tests-tests.Tpo $(DEPDIR)/tests-tests.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/tests-tests.Tpo $(DEPDIR)/tests-tests.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tests.c' object='tests-tests.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(tests_CFLAGS) $(CFLAGS) -c -o tests-tests.obj `if test -f 'tests.c'; then $(CYGPATH_W) 'tests.c'; else $(CYGPATH_W) '$(srcdir)/tests.c'; fi`
@@ -401,7 +410,7 @@ tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
@@ -409,29 +418,34 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -440,6 +454,7 @@ check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
 	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
@@ -451,10 +466,10 @@ check-TESTS: $(TESTS)
 	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
@@ -462,17 +477,18 @@ check-TESTS: $(TESTS)
 	      case " $(XFAIL_TESTS) " in \
 	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
 	  if test "$$all" -eq 1; then \
 	    tests="test"; \
@@ -514,11 +530,15 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    echo "$$grn$$dashes"; \
+	  else \
+	    echo "$$red$$dashes"; \
+	  fi; \
 	  echo "$$banner"; \
 	  test -z "$$skipped" || echo "$$skipped"; \
 	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  echo "$$dashes$$std"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
@@ -538,13 +558,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -574,6 +598,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -595,6 +620,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -603,18 +630,28 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -637,7 +674,7 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
 	clean-checkPROGRAMS clean-generic clean-libtool ctags \
@@ -658,6 +695,7 @@ uninstall-am:
 
 valgrind:
 	$(MAKE) check VG="valgrind --quiet --leak-check=full"
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/capitests/tests.c b/capitests/tests.c
index 7e08dd3..ac98312 100644
--- a/capitests/tests.c
+++ b/capitests/tests.c
@@ -84,26 +84,16 @@ static void no_test_warnings (void)
   fprintf (stderr, "warning: \"guestfs_add_drive_ro\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_config\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_set_qemu\" has no tests\n");
-  fprintf (stderr, "warning: \"guestfs_get_qemu\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_set_path\" has no tests\n");
-  fprintf (stderr, "warning: \"guestfs_get_path\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_set_append\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_get_append\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_set_autosync\" has no tests\n");
-  fprintf (stderr, "warning: \"guestfs_get_autosync\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_set_verbose\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_get_verbose\" has no tests\n");
-  fprintf (stderr, "warning: \"guestfs_is_ready\" has no tests\n");
-  fprintf (stderr, "warning: \"guestfs_is_config\" has no tests\n");
-  fprintf (stderr, "warning: \"guestfs_is_launching\" has no tests\n");
-  fprintf (stderr, "warning: \"guestfs_is_busy\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_get_state\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_set_busy\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_set_ready\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_end_busy\" has no tests\n");
-  fprintf (stderr, "warning: \"guestfs_set_memsize\" has no tests\n");
-  fprintf (stderr, "warning: \"guestfs_get_memsize\" has no tests\n");
-  fprintf (stderr, "warning: \"guestfs_get_pid\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_ll\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_pvs_full\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_vgs_full\" has no tests\n");
@@ -152,6 +142,13 @@ static void no_test_warnings (void)
   fprintf (stderr, "warning: \"guestfs_umask\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_readdir\" has no tests\n");
   fprintf (stderr, "warning: \"guestfs_sfdiskM\" has no tests\n");
+  fprintf (stderr, "warning: \"guestfs_zfile\" has no tests\n");
+  fprintf (stderr, "warning: \"guestfs_getxattrs\" has no tests\n");
+  fprintf (stderr, "warning: \"guestfs_lgetxattrs\" has no tests\n");
+  fprintf (stderr, "warning: \"guestfs_setxattr\" has no tests\n");
+  fprintf (stderr, "warning: \"guestfs_lsetxattr\" has no tests\n");
+  fprintf (stderr, "warning: \"guestfs_removexattr\" has no tests\n");
+  fprintf (stderr, "warning: \"guestfs_lremovexattr\" has no tests\n");
 }
 
 static int test_mknod_c_0_skip (void)
@@ -19271,6 +19268,652 @@ static int test_mount_0 (void)
   return 0;
 }
 
+static int test_version_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "version") == NULL;
+  str = getenv ("SKIP_TEST_VERSION_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_VERSION");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_version_0 (void)
+{
+  if (test_version_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_version_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_version_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutputStruct for version (0) */
+  {
+    struct guestfs_version *r;
+    suppress_error = 0;
+    r = guestfs_version (g);
+    if (r == NULL)
+      return -1;
+    if (r->major != 1) {
+      fprintf (stderr, "test_version_0: major was %d, expected 1\n",
+               (int) r->major);
+      return -1;
+    }
+    guestfs_free_version (r);
+  }
+  return 0;
+}
+
+static int test_get_pid_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "get_pid") == NULL;
+  str = getenv ("SKIP_TEST_GET_PID_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_GET_PID");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_get_pid_0 (void)
+{
+  if (test_get_pid_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_get_pid_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_get_pid_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutputIntOp for get_pid (0) */
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_get_pid (g);
+    if (r == -1)
+      return -1;
+    if (! (r >= 1)) {
+      fprintf (stderr, "test_get_pid_0: expected >= 1 but got %d\n",               (int) r);
+      return -1;
+    }
+  }
+  return 0;
+}
+
+static int test_get_memsize_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "get_memsize") == NULL;
+  str = getenv ("SKIP_TEST_GET_MEMSIZE_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_GET_MEMSIZE");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_get_memsize_0 (void)
+{
+  if (test_get_memsize_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_get_memsize_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_get_memsize_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutputIntOp for get_memsize (0) */
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_get_memsize (g);
+    if (r == -1)
+      return -1;
+    if (! (r >= 256)) {
+      fprintf (stderr, "test_get_memsize_0: expected >= 256 but got %d\n",               (int) r);
+      return -1;
+    }
+  }
+  return 0;
+}
+
+static int test_set_memsize_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "set_memsize") == NULL;
+  str = getenv ("SKIP_TEST_SET_MEMSIZE_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_SET_MEMSIZE");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_set_memsize_0 (void)
+{
+  if (test_set_memsize_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_set_memsize_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_set_memsize_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutputInt for set_memsize (0) */
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_set_memsize (g, 500);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_get_memsize (g);
+    if (r == -1)
+      return -1;
+    if (r != 500) {
+      fprintf (stderr, "test_set_memsize_0: expected 500 but got %d\n",               (int) r);
+      return -1;
+    }
+  }
+  return 0;
+}
+
+static int test_is_busy_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "is_busy") == NULL;
+  str = getenv ("SKIP_TEST_IS_BUSY_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_IS_BUSY");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_is_busy_0 (void)
+{
+  if (test_is_busy_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_is_busy_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_is_busy_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutputFalse for is_busy (0) */
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_is_busy (g);
+    if (r == -1)
+      return -1;
+    if (r) {
+      fprintf (stderr, "test_is_busy_0: expected false, got true\n");
+      return -1;
+    }
+  }
+  return 0;
+}
+
+static int test_is_launching_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "is_launching") == NULL;
+  str = getenv ("SKIP_TEST_IS_LAUNCHING_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_IS_LAUNCHING");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_is_launching_0 (void)
+{
+  if (test_is_launching_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_is_launching_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_is_launching_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutputFalse for is_launching (0) */
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_is_launching (g);
+    if (r == -1)
+      return -1;
+    if (r) {
+      fprintf (stderr, "test_is_launching_0: expected false, got true\n");
+      return -1;
+    }
+  }
+  return 0;
+}
+
+static int test_is_config_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "is_config") == NULL;
+  str = getenv ("SKIP_TEST_IS_CONFIG_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_IS_CONFIG");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_is_config_0 (void)
+{
+  if (test_is_config_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_is_config_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_is_config_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutputFalse for is_config (0) */
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_is_config (g);
+    if (r == -1)
+      return -1;
+    if (r) {
+      fprintf (stderr, "test_is_config_0: expected false, got true\n");
+      return -1;
+    }
+  }
+  return 0;
+}
+
+static int test_is_ready_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "is_ready") == NULL;
+  str = getenv ("SKIP_TEST_IS_READY_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_IS_READY");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_is_ready_0 (void)
+{
+  if (test_is_ready_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_is_ready_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_is_ready_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestOutputTrue for is_ready (0) */
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_is_ready (g);
+    if (r == -1)
+      return -1;
+    if (!r) {
+      fprintf (stderr, "test_is_ready_0: expected true, got false\n");
+      return -1;
+    }
+  }
+  return 0;
+}
+
+static int test_get_autosync_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "get_autosync") == NULL;
+  str = getenv ("SKIP_TEST_GET_AUTOSYNC_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_GET_AUTOSYNC");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_get_autosync_0 (void)
+{
+  if (test_get_autosync_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_get_autosync_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_get_autosync_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestRun for get_autosync (0) */
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_get_autosync (g);
+    if (r == -1)
+      return -1;
+  }
+  return 0;
+}
+
+static int test_get_path_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "get_path") == NULL;
+  str = getenv ("SKIP_TEST_GET_PATH_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_GET_PATH");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_get_path_0 (void)
+{
+  if (test_get_path_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_get_path_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_get_path_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestRun for get_path (0) */
+  {
+    const char *r;
+    suppress_error = 0;
+    r = guestfs_get_path (g);
+    if (r == NULL)
+      return -1;
+  }
+  return 0;
+}
+
+static int test_get_qemu_0_skip (void)
+{
+  const char *str;
+
+  str = getenv ("TEST_ONLY");
+  if (str)
+    return strstr (str, "get_qemu") == NULL;
+  str = getenv ("SKIP_TEST_GET_QEMU_0");
+  if (str && strcmp (str, "1") == 0) return 1;
+  str = getenv ("SKIP_TEST_GET_QEMU");
+  if (str && strcmp (str, "1") == 0) return 1;
+  return 0;
+}
+
+static int test_get_qemu_0 (void)
+{
+  if (test_get_qemu_0_skip ()) {
+    printf ("        %s skipped (reason: environment variable set)\n", "test_get_qemu_0");
+    return 0;
+  }
+
+  /* InitNone|InitEmpty for test_get_qemu_0 */
+  {
+    const char *device = "/dev/sda";
+    int r;
+    suppress_error = 0;
+    r = guestfs_blockdev_setrw (g, device);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_umount_all (g);
+    if (r == -1)
+      return -1;
+  }
+  {
+    int r;
+    suppress_error = 0;
+    r = guestfs_lvm_remove_all (g);
+    if (r == -1)
+      return -1;
+  }
+  /* TestRun for get_qemu (0) */
+  {
+    const char *r;
+    suppress_error = 0;
+    r = guestfs_get_qemu (g);
+    if (r == NULL)
+      return -1;
+  }
+  return 0;
+}
+
 int main (int argc, char *argv[])
 {
   char c = 0;
@@ -19398,7 +20041,7 @@ int main (int argc, char *argv[])
   /* Cancel previous alarm. */
   alarm (0);
 
-  nr_tests = 174;
+  nr_tests = 185;
 
   test_num++;
   printf ("%3d/%3d test_mknod_c_0\n", test_num, nr_tests);
@@ -20444,6 +21087,72 @@ int main (int argc, char *argv[])
     printf ("test_mount_0 FAILED\n");
     failed++;
   }
+  test_num++;
+  printf ("%3d/%3d test_version_0\n", test_num, nr_tests);
+  if (test_version_0 () == -1) {
+    printf ("test_version_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_get_pid_0\n", test_num, nr_tests);
+  if (test_get_pid_0 () == -1) {
+    printf ("test_get_pid_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_get_memsize_0\n", test_num, nr_tests);
+  if (test_get_memsize_0 () == -1) {
+    printf ("test_get_memsize_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_set_memsize_0\n", test_num, nr_tests);
+  if (test_set_memsize_0 () == -1) {
+    printf ("test_set_memsize_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_is_busy_0\n", test_num, nr_tests);
+  if (test_is_busy_0 () == -1) {
+    printf ("test_is_busy_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_is_launching_0\n", test_num, nr_tests);
+  if (test_is_launching_0 () == -1) {
+    printf ("test_is_launching_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_is_config_0\n", test_num, nr_tests);
+  if (test_is_config_0 () == -1) {
+    printf ("test_is_config_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_is_ready_0\n", test_num, nr_tests);
+  if (test_is_ready_0 () == -1) {
+    printf ("test_is_ready_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_get_autosync_0\n", test_num, nr_tests);
+  if (test_get_autosync_0 () == -1) {
+    printf ("test_get_autosync_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_get_path_0\n", test_num, nr_tests);
+  if (test_get_path_0 () == -1) {
+    printf ("test_get_path_0 FAILED\n");
+    failed++;
+  }
+  test_num++;
+  printf ("%3d/%3d test_get_qemu_0\n", test_num, nr_tests);
+  if (test_get_qemu_0 () == -1) {
+    printf ("test_get_qemu_0 FAILED\n");
+    failed++;
+  }
 
   guestfs_close (g);
   unlink ("test1.img");
diff --git a/inspector/Makefile.am b/cat/Makefile.am
similarity index 66%
copy from inspector/Makefile.am
copy to cat/Makefile.am
index a1df2ab..89a33a4 100644
--- a/inspector/Makefile.am
+++ b/cat/Makefile.am
@@ -1,4 +1,4 @@
-# libguestfs virt-inspector
+# libguestfs virt-cat
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -16,33 +16,33 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 EXTRA_DIST = \
-	run-inspector-locally \
-	virt-inspector.pl
+	run-cat-locally \
+	virt-cat.pl
 
-if HAVE_INSPECTOR
+if HAVE_CAT
 
-man_MANS = virt-inspector.1
+man_MANS = virt-cat.1
 
-noinst_DATA = @top_builddir@/html/virt-inspector.1.html
+noinst_DATA = @top_builddir@/html/virt-cat.1.html
 
-virt-inspector.1: virt-inspector.pl
+virt-cat.1: virt-cat.pl
 	$(POD2MAN) \
 	  --section 1 \
 	  -c "Virtualization Support" \
 	  --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
 	  $< > $@
 
- at top_builddir@/html/virt-inspector.1.html: virt-inspector.pl
+ at top_builddir@/html/virt-cat.1.html: virt-cat.pl
 	mkdir -p @top_builddir@/html
 	cd @top_builddir@ && pod2html \
 	  --css 'pod.css' \
-	  --title 'virt-inspector, display OS version, kernel, drivers, mount points, applications, etc. in a virtual machine' \
+	  --title 'virt-cat, display a file in a virtual machine' \
 	  --htmldir html \
-	  --outfile html/virt-inspector.1.html \
-	  inspector/$<
+	  --outfile html/virt-cat.1.html \
+	  cat/$<
 
 install-data-hook:
 	mkdir -p $(DESTDIR)$(bindir)
-	install -m 0755 virt-inspector.pl $(DESTDIR)$(bindir)/virt-inspector
+	install -m 0755 virt-cat.pl $(DESTDIR)$(bindir)/virt-cat
 
 endif
diff --git a/inspector/Makefile.in b/cat/Makefile.in
similarity index 69%
copy from inspector/Makefile.in
copy to cat/Makefile.in
index fa379e6..e31ec83 100644
--- a/inspector/Makefile.in
+++ b/cat/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,7 +15,7 @@
 
 @SET_MAKE@
 
-# libguestfs virt-inspector
+# libguestfs virt-cat
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -33,8 +34,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -49,7 +51,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-subdir = inspector
+subdir = cat
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
@@ -65,8 +67,30 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
@@ -249,11 +273,11 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = \
-	run-inspector-locally \
-	virt-inspector.pl
+	run-cat-locally \
+	virt-cat.pl
 
- at HAVE_INSPECTOR_TRUE@man_MANS = virt-inspector.1
- at HAVE_INSPECTOR_TRUE@noinst_DATA = @top_builddir@/html/virt-inspector.1.html
+ at HAVE_CAT_TRUE@man_MANS = virt-cat.1
+ at HAVE_CAT_TRUE@noinst_DATA = @top_builddir@/html/virt-cat.1.html
 all: all-am
 
 .SUFFIXES:
@@ -266,9 +290,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  inspector/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  inspector/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign cat/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign cat/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -286,57 +310,51 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 mostlyclean-libtool:
 	-rm -f *.lo
 
 clean-libtool:
 	-rm -rf .libs _libs
-install-man1: $(man1_MANS) $(man_MANS)
+install-man1: $(man_MANS)
 	@$(NORMAL_INSTALL)
 	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.1*) list="$$list $$i" ;; \
-	  esac; \
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+	  fi; \
 	done; \
-	for i in $$list; do \
-	  if test -f $$i; then file=$$i; \
-	  else file=$(srcdir)/$$i; fi; \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    1*) ;; \
-	    *) ext='1' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
-	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
-	done
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+	done; }
+
 uninstall-man1:
 	@$(NORMAL_UNINSTALL)
-	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.1*) list="$$list $$i" ;; \
-	  esac; \
-	done; \
-	for i in $$list; do \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    1*) ;; \
-	    *) ext='1' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
-	  rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
-	done
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
 tags: TAGS
 TAGS:
 
@@ -345,6 +363,19 @@ CTAGS:
 
 
 distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -360,13 +391,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -397,11 +432,12 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
- at HAVE_INSPECTOR_FALSE@install-data-hook:
+ at HAVE_CAT_FALSE@install-data-hook:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool mostlyclean-am
@@ -416,6 +452,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -423,21 +461,30 @@ info-am:
 install-data-am: install-man
 	@$(NORMAL_INSTALL)
 	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man: install-man1
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -475,25 +522,26 @@ uninstall-man: uninstall-man1
 	ps ps-am uninstall uninstall-am uninstall-man uninstall-man1
 
 
- at HAVE_INSPECTOR_TRUE@virt-inspector.1: virt-inspector.pl
- at HAVE_INSPECTOR_TRUE@	$(POD2MAN) \
- at HAVE_INSPECTOR_TRUE@	  --section 1 \
- at HAVE_INSPECTOR_TRUE@	  -c "Virtualization Support" \
- at HAVE_INSPECTOR_TRUE@	  --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
- at HAVE_INSPECTOR_TRUE@	  $< > $@
-
- at HAVE_INSPECTOR_TRUE@@top_builddir@/html/virt-inspector.1.html: virt-inspector.pl
- at HAVE_INSPECTOR_TRUE@	mkdir -p @top_builddir@/html
- at HAVE_INSPECTOR_TRUE@	cd @top_builddir@ && pod2html \
- at HAVE_INSPECTOR_TRUE@	  --css 'pod.css' \
- at HAVE_INSPECTOR_TRUE@	  --title 'virt-inspector, display OS version, kernel, drivers, mount points, applications, etc. in a virtual machine' \
- at HAVE_INSPECTOR_TRUE@	  --htmldir html \
- at HAVE_INSPECTOR_TRUE@	  --outfile html/virt-inspector.1.html \
- at HAVE_INSPECTOR_TRUE@	  inspector/$<
-
- at HAVE_INSPECTOR_TRUE@install-data-hook:
- at HAVE_INSPECTOR_TRUE@	mkdir -p $(DESTDIR)$(bindir)
- at HAVE_INSPECTOR_TRUE@	install -m 0755 virt-inspector.pl $(DESTDIR)$(bindir)/virt-inspector
+ at HAVE_CAT_TRUE@virt-cat.1: virt-cat.pl
+ at HAVE_CAT_TRUE@	$(POD2MAN) \
+ at HAVE_CAT_TRUE@	  --section 1 \
+ at HAVE_CAT_TRUE@	  -c "Virtualization Support" \
+ at HAVE_CAT_TRUE@	  --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
+ at HAVE_CAT_TRUE@	  $< > $@
+
+ at HAVE_CAT_TRUE@@top_builddir@/html/virt-cat.1.html: virt-cat.pl
+ at HAVE_CAT_TRUE@	mkdir -p @top_builddir@/html
+ at HAVE_CAT_TRUE@	cd @top_builddir@ && pod2html \
+ at HAVE_CAT_TRUE@	  --css 'pod.css' \
+ at HAVE_CAT_TRUE@	  --title 'virt-cat, display a file in a virtual machine' \
+ at HAVE_CAT_TRUE@	  --htmldir html \
+ at HAVE_CAT_TRUE@	  --outfile html/virt-cat.1.html \
+ at HAVE_CAT_TRUE@	  cat/$<
+
+ at HAVE_CAT_TRUE@install-data-hook:
+ at HAVE_CAT_TRUE@	mkdir -p $(DESTDIR)$(bindir)
+ at HAVE_CAT_TRUE@	install -m 0755 virt-cat.pl $(DESTDIR)$(bindir)/virt-cat
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/inspector/run-inspector-locally b/cat/run-cat-locally
similarity index 86%
copy from inspector/run-inspector-locally
copy to cat/run-cat-locally
index 156f3ae..bba2c08 100755
--- a/inspector/run-inspector-locally
+++ b/cat/run-cat-locally
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# libguestfs inspector
+# virt-cat
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -16,12 +16,12 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-# This script sets up the environment so you can run virt-inspector in place
-# without needing to do 'make install' first. You can also run virt-inspector
+# This script sets up the environment so you can run virt-cat in place
+# without needing to do 'make install' first. You can also run virt-cat
 # by creating a symlink to this script and putting it in your path.
 #
 # Use it like this:
-#   ./run-inspector-locally [usual virt-inspector args ...]
+#   ./run-cat-locally [usual virt-cat args ...]
 
 use strict;
 use warnings;
@@ -49,4 +49,4 @@ $ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
 $ENV{LIBGUESTFS_PATH} = $path.'/appliance';
 $ENV{PERL5LIB}        = $path.'/perl/blib/lib:'.$path.'/perl/blib/arch';
 
-exec('perl', $path.'/inspector/virt-inspector.pl', @ARGV);
+exec('perl', $path.'/cat/virt-cat.pl', @ARGV);
diff --git a/cat/virt-cat.pl b/cat/virt-cat.pl
new file mode 100755
index 0000000..6a50280
--- /dev/null
+++ b/cat/virt-cat.pl
@@ -0,0 +1,192 @@
+#!/usr/bin/perl -w
+# virt-cat
+# Copyright (C) 2009 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+use warnings;
+use strict;
+
+use Sys::Guestfs;
+use Sys::Guestfs::Lib qw(open_guest get_partitions resolve_windows_path
+  inspect_all_partitions inspect_partition
+  inspect_operating_systems mount_operating_system);
+use Pod::Usage;
+use Getopt::Long;
+use Data::Dumper;
+use File::Temp qw/tempdir/;
+use XML::Writer;
+use Locale::TextDomain 'libguestfs';
+
+=encoding utf8
+
+=head1 NAME
+
+virt-cat - Display a file in a virtual machine
+
+=head1 SYNOPSIS
+
+ virt-cat [--options] domname file
+
+ virt-cat [--options] disk.img [disk.img ...] file
+
+=head1 DESCRIPTION
+
+C<virt-cat> is a command line tool to display the contents of C<file>
+where C<file> exists in the named virtual machine (or disk image).
+
+C<virt-cat> can be used to quickly view a single file.  For more
+complex cases you should look at the L<guestfish(1)> tool.
+
+=head1 EXAMPLES
+
+Display C</etc/fstab> file from inside the libvirt VM called
+C<mydomain>:
+
+ virt-cat mydomain /etc/fstab
+
+List syslog messages from a VM:
+
+ virt-cat mydomain /var/log/messages | tail
+
+Find out what packages were recently installed:
+
+ virt-cat mydomain /var/log/yum.log | tail
+
+Find out who is logged on inside a virtual machine:
+
+ virt-cat mydomain /var/run/utmp > /tmp/utmp
+ who /tmp/utmp
+
+or who was logged on:
+
+ virt-cat mydomain /var/log/wtmp > /tmp/wtmp
+ last -f /tmp/wtmp
+
+=head1 OPTIONS
+
+=over 4
+
+=cut
+
+my $help;
+
+=item B<--help>
+
+Display brief help.
+
+=cut
+
+my $version;
+
+=item B<--version>
+
+Display version number and exit.
+
+=cut
+
+my $uri;
+
+=item B<--connect URI> | B<-c URI>
+
+If using libvirt, connect to the given I<URI>.  If omitted, then we
+connect to the default libvirt hypervisor.
+
+If you specify guest block devices directly, then libvirt is not used
+at all.
+
+=back
+
+=cut
+
+GetOptions ("help|?" => \$help,
+	    "version" => \$version,
+	    "connect|c=s" => \$uri,
+    ) or pod2usage (2);
+pod2usage (1) if $help;
+if ($version) {
+    my $g = Sys::Guestfs->new ();
+    my %h = $g->version ();
+    print "$h{major}.$h{minor}.$h{release}$h{extra}\n";
+    exit
+}
+
+pod2usage (__"virt-cat: no image, VM names or filenames to cat given")
+    if @ARGV <= 1;
+
+my $filename = pop @ARGV;
+
+my $g;
+if ($uri) {
+    $g = open_guest (\@ARGV, address => $uri);
+} else {
+    $g = open_guest (\@ARGV);
+}
+
+$g->launch ();
+$g->wait_ready ();
+
+# List of possible filesystems.
+my @partitions = get_partitions ($g);
+
+# Now query each one to build up a picture of what's in it.
+my %fses =
+    inspect_all_partitions ($g, \@partitions,
+      use_windows_registry => 0);
+
+my $oses = inspect_operating_systems ($g, \%fses);
+
+my @roots = keys %$oses;
+die __"no root device found in this operating system image" if @roots == 0;
+die __"multiboot operating systems are not supported by virt-cat" if @roots > 1;
+my $root_dev = $roots[0];
+
+my $os = $oses->{$root_dev};
+mount_operating_system ($g, $os);
+
+# Allow this to fail in case eg. the file does not exist.
+# NB: https://bugzilla.redhat.com/show_bug.cgi?id=501888
+print $g->download($filename, "/dev/stdout");
+
+=head1 SEE ALSO
+
+L<guestfs(3)>,
+L<guestfish(1)>,
+L<Sys::Guestfs(3)>,
+L<Sys::Guestfs::Lib(3)>,
+L<Sys::Virt(3)>,
+L<http://libguestfs.org/>.
+
+=head1 AUTHOR
+
+Richard W.M. Jones L<http://et.redhat.com/~rjones/>
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009 Red Hat Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/config.h.in b/config.h.in
index e84b4d0..63a0779 100644
--- a/config.h.in
+++ b/config.h.in
@@ -90,6 +90,18 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* Extra version string */
+#undef PACKAGE_VERSION_EXTRA
+
+/* Major version number */
+#undef PACKAGE_VERSION_MAJOR
+
+/* Minor version number */
+#undef PACKAGE_VERSION_MINOR
+
+/* Release number */
+#undef PACKAGE_VERSION_RELEASE
+
 /* Define to 1 if the C compiler supports function prototypes. */
 #undef PROTOTYPES
 
@@ -105,9 +117,6 @@
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
-/* Name of Fedora updates repository. */
-#undef UPDATES
-
 /* Version number of package */
 #undef VERSION
 
diff --git a/configure b/configure
index 6d9eadf..3bf662f 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for libguestfs 1.0.56.
+# Generated by GNU Autoconf 2.63 for libguestfs 1.0.61.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -743,8 +743,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='libguestfs'
 PACKAGE_TARNAME='libguestfs'
-PACKAGE_VERSION='1.0.56'
-PACKAGE_STRING='libguestfs 1.0.56'
+PACKAGE_VERSION='1.0.61'
+PACKAGE_STRING='libguestfs 1.0.61'
 PACKAGE_BUGREPORT=''
 
 # Factoring default headers for most tests.
@@ -784,12 +784,20 @@ ac_includes_default="\
 #endif"
 
 enable_option_checking=no
-ac_subst_vars='LTLIBOBJS
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
 LIBOBJS
 subdirs
 MAX_PROC_NR
+HAVE_V2V_FALSE
+HAVE_V2V_TRUE
 HAVE_INSPECTOR_FALSE
 HAVE_INSPECTOR_TRUE
+HAVE_DF_FALSE
+HAVE_DF_TRUE
+HAVE_CAT_FALSE
+HAVE_CAT_TRUE
 HAVE_HASKELL_FALSE
 HAVE_HASKELL_TRUE
 GHC
@@ -1558,7 +1566,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libguestfs 1.0.56 to adapt to many kinds of systems.
+\`configure' configures libguestfs 1.0.61 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1628,7 +1636,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libguestfs 1.0.56:";;
+     short | recursive ) echo "Configuration of libguestfs 1.0.61:";;
    esac
   cat <<\_ACEOF
 
@@ -1744,7 +1752,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libguestfs configure 1.0.56
+libguestfs configure 1.0.61
 generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1758,7 +1766,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libguestfs $as_me 1.0.56, which was
+It was created by libguestfs $as_me 1.0.61, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
@@ -2126,7 +2134,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-am__api_version='1.10'
+am__api_version='1.11'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2257,16 +2265,33 @@ $as_echo_n "checking whether build environment is sane... " >&6; }
 # Just in case
 sleep 1
 echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5
+$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
+$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
    if test "$*" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t "$srcdir/configure" conftest.file`
    fi
    rm -f conftest.file
    if test "$*" != "X $srcdir/configure conftest.file" \
@@ -2310,7 +2335,14 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
 
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
@@ -2320,6 +2352,115 @@ else
 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 fi
 
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
 { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
@@ -2474,7 +2615,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libguestfs'
- VERSION='1.0.56'
+ VERSION='1.0.61'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2502,108 +2643,6 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 # Always define AMTAR for backward compatibility.
@@ -2735,7 +2774,7 @@ ac_config_commands="$ac_config_commands depfiles"
 am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
@@ -2746,24 +2785,24 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 
 
@@ -3752,6 +3791,11 @@ else
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -3769,7 +3813,17 @@ else
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
@@ -3779,19 +3833,23 @@ else
 	break
       fi
       ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -4424,13 +4482,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:4427: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:4485: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4430: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:4488: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4433: output\"" >&5)
+  (eval echo "\"\$as_me:4491: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -5636,7 +5694,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 5639 "configure"' > conftest.$ac_ext
+  echo '#line 5697 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7493,11 +7551,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7496: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7554: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7500: \$? = $ac_status" >&5
+   echo "$as_me:7558: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -7832,11 +7890,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7835: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7893: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7839: \$? = $ac_status" >&5
+   echo "$as_me:7897: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -7937,11 +7995,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7940: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7998: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7944: \$? = $ac_status" >&5
+   echo "$as_me:8002: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -7992,11 +8050,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7995: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8053: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7999: \$? = $ac_status" >&5
+   echo "$as_me:8057: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -10795,7 +10853,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10798 "configure"
+#line 10856 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -10891,7 +10949,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10894 "configure"
+#line 10952 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11119,6 +11177,27 @@ CC="$lt_save_CC"
 
 
 
+
+cat >>confdefs.h <<\_ACEOF
+#define PACKAGE_VERSION_MAJOR 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define PACKAGE_VERSION_MINOR 0
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define PACKAGE_VERSION_RELEASE 61
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define PACKAGE_VERSION_EXTRA ""
+_ACEOF
+
+
    case $ac_cv_prog_cc_stdc in
   no) ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;;
   *) { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5
@@ -13684,12 +13763,6 @@ _ACEOF
 
 
 
-cat >>confdefs.h <<_ACEOF
-#define host_cpu "$host_cpu"
-_ACEOF
-
-
-
 # Check whether --with-updates was given.
 if test "${with_updates+set}" = set; then
   withval=$with_updates;
@@ -13700,11 +13773,6 @@ fi
 UPDATES="$with_updates"
 
 
-cat >>confdefs.h <<_ACEOF
-#define UPDATES "$UPDATES"
-_ACEOF
-
-
 
 cat >>confdefs.h <<_ACEOF
 #define host_cpu "$host_cpu"
@@ -16667,7 +16735,7 @@ fi
 
 
 missing_perl_modules=no
-for pm in Test::More Test::Pod Test::Pod::Coverage ExtUtils::MakeMaker; do
+for pm in Test::More Test::Pod Test::Pod::Coverage ExtUtils::MakeMaker Locale::TextDomain; do
     { $as_echo "$as_me:$LINENO: checking for $pm" >&5
 $as_echo_n "checking for $pm... " >&6; }
     if ! perl -M$pm -e1 >/dev/null 2>&1; then
@@ -17130,7 +17198,7 @@ fi
 
 
 missing_perl_modules=no
-for pm in Pod::Usage Getopt::Long Sys::Virt Data::Dumper XML::Writer; do
+for pm in Pod::Usage Getopt::Long Sys::Virt Data::Dumper XML::Writer Locale::TextDomain; do
     { $as_echo "$as_me:$LINENO: checking for $pm" >&5
 $as_echo_n "checking for $pm... " >&6; }
     if ! perl -M$pm -e1 >/dev/null 2>&1; then
@@ -17143,8 +17211,24 @@ $as_echo "yes" >&6; }
     fi
 done
 if test "x$missing_perl_modules" = "xyes"; then
-    { $as_echo "$as_me:$LINENO: WARNING: some Perl modules required to compile virt-inspector are missing" >&5
-$as_echo "$as_me: WARNING: some Perl modules required to compile virt-inspector are missing" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: some Perl modules required to compile virt-cat, virt-df, virt-inspector and virt-v2v are missing" >&5
+$as_echo "$as_me: WARNING: some Perl modules required to compile virt-cat, virt-df, virt-inspector and virt-v2v are missing" >&2;}
+fi
+
+ if test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"; then
+  HAVE_CAT_TRUE=
+  HAVE_CAT_FALSE='#'
+else
+  HAVE_CAT_TRUE='#'
+  HAVE_CAT_FALSE=
+fi
+
+ if test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"; then
+  HAVE_DF_TRUE=
+  HAVE_DF_FALSE='#'
+else
+  HAVE_DF_TRUE='#'
+  HAVE_DF_FALSE=
 fi
 
  if test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"; then
@@ -17155,6 +17239,14 @@ else
   HAVE_INSPECTOR_FALSE=
 fi
 
+ if test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"; then
+  HAVE_V2V_TRUE=
+  HAVE_V2V_FALSE='#'
+else
+  HAVE_V2V_TRUE='#'
+  HAVE_V2V_FALSE=
+fi
+
 
 MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`
 
@@ -17176,7 +17268,7 @@ ac_config_files="$ac_config_files appliance/supermin-make.sh"
 
 ac_config_files="$ac_config_files appliance/libguestfs-supermin-helper"
 
-ac_config_files="$ac_config_files Makefile src/Makefile fish/Makefile po/Makefile.in examples/Makefile appliance/Makefile appliance/debian/debirf.conf images/Makefile capitests/Makefile regressions/Makefile ocaml/Makefile ocaml/examples/Makefile perl/Makefile python/Makefile ruby/Makefile ruby/Rakefile java/Makefile haskell/Makefile inspector/Makefile libguestfs.pc ocaml/META perl/Makefile.PL"
+ac_config_files="$ac_config_files Makefile src/Makefile fish/Makefile po/Makefile.in examples/Makefile appliance/Makefile appliance/debian/debirf.conf images/Makefile capitests/Makefile regressions/Makefile ocaml/Makefile ocaml/examples/Makefile perl/Makefile python/Makefile ruby/Makefile ruby/Rakefile java/Makefile haskell/Makefile cat/Makefile df/Makefile inspector/Makefile v2v/Makefile libguestfs.pc ocaml/META perl/Makefile.PL"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -17275,6 +17367,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
   { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -17345,6 +17445,20 @@ $as_echo "$as_me: error: conditional \"HAVE_HASKELL\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${HAVE_CAT_TRUE}" && test -z "${HAVE_CAT_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_CAT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"HAVE_CAT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_DF_TRUE}" && test -z "${HAVE_DF_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_DF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"HAVE_DF\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${HAVE_INSPECTOR_TRUE}" && test -z "${HAVE_INSPECTOR_FALSE}"; then
   { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_INSPECTOR\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -17352,6 +17466,13 @@ $as_echo "$as_me: error: conditional \"HAVE_INSPECTOR\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${HAVE_V2V_TRUE}" && test -z "${HAVE_V2V_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_V2V\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"HAVE_V2V\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_write_fail=0
@@ -17674,7 +17795,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libguestfs $as_me 1.0.56, which was
+This file was extended by libguestfs $as_me 1.0.61, which was
 generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -17737,7 +17858,7 @@ Report bugs to <bug-autoconf at gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-libguestfs config.status 1.0.56
+libguestfs config.status 1.0.61
 configured by $0, generated by GNU Autoconf 2.63,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -18149,7 +18270,10 @@ do
     "ruby/Rakefile") CONFIG_FILES="$CONFIG_FILES ruby/Rakefile" ;;
     "java/Makefile") CONFIG_FILES="$CONFIG_FILES java/Makefile" ;;
     "haskell/Makefile") CONFIG_FILES="$CONFIG_FILES haskell/Makefile" ;;
+    "cat/Makefile") CONFIG_FILES="$CONFIG_FILES cat/Makefile" ;;
+    "df/Makefile") CONFIG_FILES="$CONFIG_FILES df/Makefile" ;;
     "inspector/Makefile") CONFIG_FILES="$CONFIG_FILES inspector/Makefile" ;;
+    "v2v/Makefile") CONFIG_FILES="$CONFIG_FILES v2v/Makefile" ;;
     "libguestfs.pc") CONFIG_FILES="$CONFIG_FILES libguestfs.pc" ;;
     "ocaml/META") CONFIG_FILES="$CONFIG_FILES ocaml/META" ;;
     "perl/Makefile.PL") CONFIG_FILES="$CONFIG_FILES perl/Makefile.PL" ;;
@@ -18807,27 +18931,28 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
-# are listed without --file.  Let's play safe and only enable the eval
-# if we detect the quoting.
-case $CONFIG_FILES in
-*\'*) eval set x "$CONFIG_FILES" ;;
-*)   set x $CONFIG_FILES ;;
-esac
-shift
-for mf
-do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # Grep'ing the whole file is not good either: AIX grep has a line
-  # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-    dirpart=`$as_dirname -- "$mf" ||
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$mf" : 'X\(//\)[^/]' \| \
 	 X"$mf" : 'X\(//\)$' \| \
@@ -18850,28 +18975,28 @@ $as_echo X"$mf" |
 	    q
 	  }
 	  s/.*/./; q'`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`$as_dirname -- "$file" ||
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$file" : 'X\(//\)[^/]' \| \
 	 X"$file" : 'X\(//\)$' \| \
@@ -18894,7 +19019,7 @@ $as_echo X"$file" |
 	    q
 	  }
 	  s/.*/./; q'`
-    { as_dir=$dirpart/$fdir
+      { as_dir=$dirpart/$fdir
   case $as_dir in #(
   -*) as_dir=./$as_dir;;
   esac
@@ -18935,10 +19060,11 @@ $as_echo X"$as_dir" |
   } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
  ;;
     "libtool":C)
 
@@ -19938,15 +20064,21 @@ echo -n "Java bindings ....................... "
 if test "x$HAVE_JAVA_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 echo -n "Haskell bindings .................... "
 if test "x$HAVE_HASKELL" = "x"; then echo "yes"; else echo "no"; fi
+echo -n "virt-cat ............................ "
+if test "x$HAVE_CAT" = "x"; then echo "yes"; else echo "no"; fi
+echo -n "virt-df ............................. "
+if test "x$HAVE_DF" = "x"; then echo "yes"; else echo "no"; fi
 echo -n "virt-inspector ...................... "
 if test "x$HAVE_INSPECTOR" = "x"; then echo "yes"; else echo "no"; fi
+echo -n "virt-v2v ............................ "
+if test "x$HAVE_V2V" = "x"; then echo "yes"; else echo "no"; fi
 echo "supermin appliance .................. $enable_supermin"
 echo
 echo "If any optional component is configured 'no' when you expected 'yes'"
 echo "then you should check the preceeding messages."
 echo
-echo "Please report bugs back to the fedora-virt mailing list:"
-echo "http://www.redhat.com/mailman/listinfo/fedora-virt"
+echo "Please report bugs back to the mailing list:"
+echo "http://www.redhat.com/mailman/listinfo/libguestfs"
 echo
 echo "Next you should type 'make' to build the package,"
 echo "then 'make check' to run the tests."
diff --git a/configure.ac b/configure.ac
index 1271e7c..6b14c4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,13 +15,26 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-AC_INIT([libguestfs],[1.0.56])
+# major/minor/release must be numbers
+m4_define([libguestfs_major],   [1])
+m4_define([libguestfs_minor],   [0])
+m4_define([libguestfs_release], [61])
+# extra can be any string
+m4_define([libguestfs_extra],   [])
+
+AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release[]libguestfs_extra)
 AM_INIT_AUTOMAKE([foreign])
 
 AC_CONFIG_MACRO_DIR([m4])
 
 AC_PROG_LIBTOOL
 
+dnl Split up the version string.
+AC_DEFINE([PACKAGE_VERSION_MAJOR],[libguestfs_major],[Major version number])
+AC_DEFINE([PACKAGE_VERSION_MINOR],[libguestfs_minor],[Minor version number])
+AC_DEFINE([PACKAGE_VERSION_RELEASE],[libguestfs_release],[Release number])
+AC_DEFINE([PACKAGE_VERSION_EXTRA],["libguestfs_extra"],[Extra version string])
+
 dnl Check for basic C environment.
 AC_PROG_CC_STDC
 AC_PROG_INSTALL
@@ -193,8 +206,6 @@ REPO="$with_repo"
 AC_SUBST(REPO)
 AC_DEFINE_UNQUOTED([REPO],["$REPO"],[Name of Fedora repository.])
 
-AC_DEFINE_UNQUOTED([host_cpu],["$host_cpu"],[Host architecture.])
-
 dnl --with-updates to specify a Fedora updates repository.
 AC_ARG_WITH([updates],
 	[AS_HELP_STRING([--with-updates],
@@ -203,8 +214,8 @@ AC_ARG_WITH([updates],
 	[with_updates=updates-released-f11])
 UPDATES="$with_updates"
 AC_SUBST(UPDATES)
-AC_DEFINE_UNQUOTED([UPDATES],["$UPDATES"],[Name of Fedora updates repository.])
 
+dnl Define a symbol for the host CPU architecture.
 AC_DEFINE_UNQUOTED([host_cpu],["$host_cpu"],[Host architecture.])
 
 dnl --with-mirror to specify a local Fedora mirror.
@@ -295,7 +306,7 @@ AC_CHECK_PROG([PERL],[perl],[perl],[no])
 dnl Check for Perl modules that must be present to compile and
 dnl test the Perl bindings.
 missing_perl_modules=no
-for pm in Test::More Test::Pod Test::Pod::Coverage ExtUtils::MakeMaker; do
+for pm in Test::More Test::Pod Test::Pod::Coverage ExtUtils::MakeMaker Locale::TextDomain; do
     AC_MSG_CHECKING([for $pm])
     if ! perl -M$pm -e1 >/dev/null 2>&1; then
         AC_MSG_RESULT([no])
@@ -506,9 +517,9 @@ AC_CHECK_PROG([GHC],[ghc],[ghc],[no])
 AM_CONDITIONAL([HAVE_HASKELL],
     [test "x$GHC" != "xno"])
 
-dnl Check for Perl modules needed by the inspector.
+dnl Check for Perl modules needed by virt-df, inspector, V2V etc.
 missing_perl_modules=no
-for pm in Pod::Usage Getopt::Long Sys::Virt Data::Dumper XML::Writer; do
+for pm in Pod::Usage Getopt::Long Sys::Virt Data::Dumper XML::Writer Locale::TextDomain; do
     AC_MSG_CHECKING([for $pm])
     if ! perl -M$pm -e1 >/dev/null 2>&1; then
         AC_MSG_RESULT([no])
@@ -518,11 +529,17 @@ for pm in Pod::Usage Getopt::Long Sys::Virt Data::Dumper XML::Writer; do
     fi
 done
 if test "x$missing_perl_modules" = "xyes"; then
-    AC_MSG_WARN([some Perl modules required to compile virt-inspector are missing])
+    AC_MSG_WARN([some Perl modules required to compile virt-cat, virt-df, virt-inspector and virt-v2v are missing])
 fi
 
+AM_CONDITIONAL([HAVE_CAT],
+    [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
+AM_CONDITIONAL([HAVE_DF],
+    [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
 AM_CONDITIONAL([HAVE_INSPECTOR],
     [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
+AM_CONDITIONAL([HAVE_V2V],
+    [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
 
 dnl Library versioning.
 MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`
@@ -557,7 +574,10 @@ AC_CONFIG_FILES([Makefile
 		 ruby/Makefile ruby/Rakefile
 		 java/Makefile
 		 haskell/Makefile
+		 cat/Makefile
+		 df/Makefile
 		 inspector/Makefile
+		 v2v/Makefile
 		 libguestfs.pc
 		 ocaml/META perl/Makefile.PL])
 AC_OUTPUT
@@ -583,15 +603,21 @@ echo -n "Java bindings ....................... "
 if test "x$HAVE_JAVA_TRUE" = "x"; then echo "yes"; else echo "no"; fi
 echo -n "Haskell bindings .................... "
 if test "x$HAVE_HASKELL" = "x"; then echo "yes"; else echo "no"; fi
+echo -n "virt-cat ............................ "
+if test "x$HAVE_CAT" = "x"; then echo "yes"; else echo "no"; fi
+echo -n "virt-df ............................. "
+if test "x$HAVE_DF" = "x"; then echo "yes"; else echo "no"; fi
 echo -n "virt-inspector ...................... "
 if test "x$HAVE_INSPECTOR" = "x"; then echo "yes"; else echo "no"; fi
+echo -n "virt-v2v ............................ "
+if test "x$HAVE_V2V" = "x"; then echo "yes"; else echo "no"; fi
 echo "supermin appliance .................. $enable_supermin"
 echo
 echo "If any optional component is configured 'no' when you expected 'yes'"
 echo "then you should check the preceeding messages."
 echo
-echo "Please report bugs back to the fedora-virt mailing list:"
-echo "http://www.redhat.com/mailman/listinfo/fedora-virt"
+echo "Please report bugs back to the mailing list:"
+echo "http://www.redhat.com/mailman/listinfo/libguestfs"
 echo
 echo "Next you should type 'make' to build the package,"
 echo "then 'make check' to run the tests."
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 846a95c..7b8a87e 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -65,6 +65,7 @@ guestfsd_SOURCES = \
 	umask.c \
 	upload.c \
 	wc.c \
+	xattr.c \
 	zero.c \
 	zerofree.c \
 	$(top_builddir)/../src/guestfs_protocol.h \
diff --git a/daemon/Makefile.in b/daemon/Makefile.in
index db16b13..f28caf7 100644
--- a/daemon/Makefile.in
+++ b/daemon/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -33,8 +34,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -62,6 +64,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 PROGRAMS = $(noinst_PROGRAMS)
 am_guestfsd_OBJECTS = guestfsd-augeas.$(OBJEXT) \
 	guestfsd-blockdev.$(OBJEXT) guestfsd-checksum.$(OBJEXT) \
@@ -85,8 +88,8 @@ am_guestfsd_OBJECTS = guestfsd-augeas.$(OBJEXT) \
 	guestfsd-stubs.$(OBJEXT) guestfsd-swap.$(OBJEXT) \
 	guestfsd-sync.$(OBJEXT) guestfsd-tar.$(OBJEXT) \
 	guestfsd-umask.$(OBJEXT) guestfsd-upload.$(OBJEXT) \
-	guestfsd-wc.$(OBJEXT) guestfsd-zero.$(OBJEXT) \
-	guestfsd-zerofree.$(OBJEXT) \
+	guestfsd-wc.$(OBJEXT) guestfsd-xattr.$(OBJEXT) \
+	guestfsd-zero.$(OBJEXT) guestfsd-zerofree.$(OBJEXT) \
 	guestfsd-guestfs_protocol.$(OBJEXT)
 guestfsd_OBJECTS = $(am_guestfsd_OBJECTS)
 guestfsd_LDADD = $(LDADD)
@@ -95,6 +98,7 @@ guestfsd_LINK = $(CCLD) $(guestfsd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 DEFAULT_INCLUDES = -I. at am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 CCLD = $(CC)
@@ -107,9 +111,9 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 am__remove_distdir = \
-  { test ! -d $(distdir) \
-    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
-         && rm -fr $(distdir); }; }
+  { test ! -d "$(distdir)" \
+    || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr "$(distdir)"; }; }
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
@@ -247,6 +251,7 @@ guestfsd_SOURCES = \
 	umask.c \
 	upload.c \
 	wc.c \
+	xattr.c \
 	zero.c \
 	zerofree.c \
 	$(top_builddir)/../src/guestfs_protocol.h \
@@ -264,15 +269,15 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
-	      cd $(srcdir) && $(AUTOMAKE) --foreign  \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
 		&& exit 0; \
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -288,9 +293,10 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC
 	$(SHELL) ./config.status --recheck
 
 $(top_srcdir)/configure:  $(am__configure_deps)
-	cd $(srcdir) && $(AUTOCONF)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
-	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
 
 config.h: stamp-h1
 	@if test ! -f $@; then \
@@ -302,7 +308,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
 	@rm -f stamp-h1
 	cd $(top_builddir) && $(SHELL) ./config.status config.h
 $(srcdir)/config.h.in:  $(am__configure_deps) 
-	cd $(top_srcdir) && $(AUTOHEADER)
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
 	rm -f stamp-h1
 	touch $@
 
@@ -366,677 +372,692 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfsd-umask.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfsd-upload.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfsd-wc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfsd-xattr.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfsd-zero.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfsd-zerofree.Po at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 guestfsd-augeas.o: augeas.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-augeas.o -MD -MP -MF $(DEPDIR)/guestfsd-augeas.Tpo -c -o guestfsd-augeas.o `test -f 'augeas.c' || echo '$(srcdir)/'`augeas.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-augeas.Tpo $(DEPDIR)/guestfsd-augeas.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-augeas.Tpo $(DEPDIR)/guestfsd-augeas.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='augeas.c' object='guestfsd-augeas.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-augeas.o `test -f 'augeas.c' || echo '$(srcdir)/'`augeas.c
 
 guestfsd-augeas.obj: augeas.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-augeas.obj -MD -MP -MF $(DEPDIR)/guestfsd-augeas.Tpo -c -o guestfsd-augeas.obj `if test -f 'augeas.c'; then $(CYGPATH_W) 'augeas.c'; else $(CYGPATH_W) '$(srcdir)/augeas.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-augeas.Tpo $(DEPDIR)/guestfsd-augeas.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-augeas.Tpo $(DEPDIR)/guestfsd-augeas.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='augeas.c' object='guestfsd-augeas.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-augeas.obj `if test -f 'augeas.c'; then $(CYGPATH_W) 'augeas.c'; else $(CYGPATH_W) '$(srcdir)/augeas.c'; fi`
 
 guestfsd-blockdev.o: blockdev.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-blockdev.o -MD -MP -MF $(DEPDIR)/guestfsd-blockdev.Tpo -c -o guestfsd-blockdev.o `test -f 'blockdev.c' || echo '$(srcdir)/'`blockdev.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-blockdev.Tpo $(DEPDIR)/guestfsd-blockdev.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-blockdev.Tpo $(DEPDIR)/guestfsd-blockdev.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='blockdev.c' object='guestfsd-blockdev.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-blockdev.o `test -f 'blockdev.c' || echo '$(srcdir)/'`blockdev.c
 
 guestfsd-blockdev.obj: blockdev.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-blockdev.obj -MD -MP -MF $(DEPDIR)/guestfsd-blockdev.Tpo -c -o guestfsd-blockdev.obj `if test -f 'blockdev.c'; then $(CYGPATH_W) 'blockdev.c'; else $(CYGPATH_W) '$(srcdir)/blockdev.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-blockdev.Tpo $(DEPDIR)/guestfsd-blockdev.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-blockdev.Tpo $(DEPDIR)/guestfsd-blockdev.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='blockdev.c' object='guestfsd-blockdev.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-blockdev.obj `if test -f 'blockdev.c'; then $(CYGPATH_W) 'blockdev.c'; else $(CYGPATH_W) '$(srcdir)/blockdev.c'; fi`
 
 guestfsd-checksum.o: checksum.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-checksum.o -MD -MP -MF $(DEPDIR)/guestfsd-checksum.Tpo -c -o guestfsd-checksum.o `test -f 'checksum.c' || echo '$(srcdir)/'`checksum.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-checksum.Tpo $(DEPDIR)/guestfsd-checksum.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-checksum.Tpo $(DEPDIR)/guestfsd-checksum.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='checksum.c' object='guestfsd-checksum.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-checksum.o `test -f 'checksum.c' || echo '$(srcdir)/'`checksum.c
 
 guestfsd-checksum.obj: checksum.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-checksum.obj -MD -MP -MF $(DEPDIR)/guestfsd-checksum.Tpo -c -o guestfsd-checksum.obj `if test -f 'checksum.c'; then $(CYGPATH_W) 'checksum.c'; else $(CYGPATH_W) '$(srcdir)/checksum.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-checksum.Tpo $(DEPDIR)/guestfsd-checksum.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-checksum.Tpo $(DEPDIR)/guestfsd-checksum.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='checksum.c' object='guestfsd-checksum.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-checksum.obj `if test -f 'checksum.c'; then $(CYGPATH_W) 'checksum.c'; else $(CYGPATH_W) '$(srcdir)/checksum.c'; fi`
 
 guestfsd-cmp.o: cmp.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-cmp.o -MD -MP -MF $(DEPDIR)/guestfsd-cmp.Tpo -c -o guestfsd-cmp.o `test -f 'cmp.c' || echo '$(srcdir)/'`cmp.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-cmp.Tpo $(DEPDIR)/guestfsd-cmp.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-cmp.Tpo $(DEPDIR)/guestfsd-cmp.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cmp.c' object='guestfsd-cmp.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-cmp.o `test -f 'cmp.c' || echo '$(srcdir)/'`cmp.c
 
 guestfsd-cmp.obj: cmp.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-cmp.obj -MD -MP -MF $(DEPDIR)/guestfsd-cmp.Tpo -c -o guestfsd-cmp.obj `if test -f 'cmp.c'; then $(CYGPATH_W) 'cmp.c'; else $(CYGPATH_W) '$(srcdir)/cmp.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-cmp.Tpo $(DEPDIR)/guestfsd-cmp.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-cmp.Tpo $(DEPDIR)/guestfsd-cmp.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cmp.c' object='guestfsd-cmp.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-cmp.obj `if test -f 'cmp.c'; then $(CYGPATH_W) 'cmp.c'; else $(CYGPATH_W) '$(srcdir)/cmp.c'; fi`
 
 guestfsd-command.o: command.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-command.o -MD -MP -MF $(DEPDIR)/guestfsd-command.Tpo -c -o guestfsd-command.o `test -f 'command.c' || echo '$(srcdir)/'`command.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-command.Tpo $(DEPDIR)/guestfsd-command.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-command.Tpo $(DEPDIR)/guestfsd-command.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='command.c' object='guestfsd-command.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-command.o `test -f 'command.c' || echo '$(srcdir)/'`command.c
 
 guestfsd-command.obj: command.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-command.obj -MD -MP -MF $(DEPDIR)/guestfsd-command.Tpo -c -o guestfsd-command.obj `if test -f 'command.c'; then $(CYGPATH_W) 'command.c'; else $(CYGPATH_W) '$(srcdir)/command.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-command.Tpo $(DEPDIR)/guestfsd-command.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-command.Tpo $(DEPDIR)/guestfsd-command.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='command.c' object='guestfsd-command.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-command.obj `if test -f 'command.c'; then $(CYGPATH_W) 'command.c'; else $(CYGPATH_W) '$(srcdir)/command.c'; fi`
 
 guestfsd-cpmv.o: cpmv.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-cpmv.o -MD -MP -MF $(DEPDIR)/guestfsd-cpmv.Tpo -c -o guestfsd-cpmv.o `test -f 'cpmv.c' || echo '$(srcdir)/'`cpmv.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-cpmv.Tpo $(DEPDIR)/guestfsd-cpmv.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-cpmv.Tpo $(DEPDIR)/guestfsd-cpmv.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cpmv.c' object='guestfsd-cpmv.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-cpmv.o `test -f 'cpmv.c' || echo '$(srcdir)/'`cpmv.c
 
 guestfsd-cpmv.obj: cpmv.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-cpmv.obj -MD -MP -MF $(DEPDIR)/guestfsd-cpmv.Tpo -c -o guestfsd-cpmv.obj `if test -f 'cpmv.c'; then $(CYGPATH_W) 'cpmv.c'; else $(CYGPATH_W) '$(srcdir)/cpmv.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-cpmv.Tpo $(DEPDIR)/guestfsd-cpmv.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-cpmv.Tpo $(DEPDIR)/guestfsd-cpmv.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cpmv.c' object='guestfsd-cpmv.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-cpmv.obj `if test -f 'cpmv.c'; then $(CYGPATH_W) 'cpmv.c'; else $(CYGPATH_W) '$(srcdir)/cpmv.c'; fi`
 
 guestfsd-debug.o: debug.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-debug.o -MD -MP -MF $(DEPDIR)/guestfsd-debug.Tpo -c -o guestfsd-debug.o `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-debug.Tpo $(DEPDIR)/guestfsd-debug.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-debug.Tpo $(DEPDIR)/guestfsd-debug.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='debug.c' object='guestfsd-debug.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-debug.o `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
 
 guestfsd-debug.obj: debug.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-debug.obj -MD -MP -MF $(DEPDIR)/guestfsd-debug.Tpo -c -o guestfsd-debug.obj `if test -f 'debug.c'; then $(CYGPATH_W) 'debug.c'; else $(CYGPATH_W) '$(srcdir)/debug.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-debug.Tpo $(DEPDIR)/guestfsd-debug.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-debug.Tpo $(DEPDIR)/guestfsd-debug.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='debug.c' object='guestfsd-debug.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-debug.obj `if test -f 'debug.c'; then $(CYGPATH_W) 'debug.c'; else $(CYGPATH_W) '$(srcdir)/debug.c'; fi`
 
 guestfsd-devsparts.o: devsparts.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-devsparts.o -MD -MP -MF $(DEPDIR)/guestfsd-devsparts.Tpo -c -o guestfsd-devsparts.o `test -f 'devsparts.c' || echo '$(srcdir)/'`devsparts.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-devsparts.Tpo $(DEPDIR)/guestfsd-devsparts.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-devsparts.Tpo $(DEPDIR)/guestfsd-devsparts.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='devsparts.c' object='guestfsd-devsparts.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-devsparts.o `test -f 'devsparts.c' || echo '$(srcdir)/'`devsparts.c
 
 guestfsd-devsparts.obj: devsparts.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-devsparts.obj -MD -MP -MF $(DEPDIR)/guestfsd-devsparts.Tpo -c -o guestfsd-devsparts.obj `if test -f 'devsparts.c'; then $(CYGPATH_W) 'devsparts.c'; else $(CYGPATH_W) '$(srcdir)/devsparts.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-devsparts.Tpo $(DEPDIR)/guestfsd-devsparts.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-devsparts.Tpo $(DEPDIR)/guestfsd-devsparts.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='devsparts.c' object='guestfsd-devsparts.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-devsparts.obj `if test -f 'devsparts.c'; then $(CYGPATH_W) 'devsparts.c'; else $(CYGPATH_W) '$(srcdir)/devsparts.c'; fi`
 
 guestfsd-df.o: df.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-df.o -MD -MP -MF $(DEPDIR)/guestfsd-df.Tpo -c -o guestfsd-df.o `test -f 'df.c' || echo '$(srcdir)/'`df.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-df.Tpo $(DEPDIR)/guestfsd-df.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-df.Tpo $(DEPDIR)/guestfsd-df.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='df.c' object='guestfsd-df.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-df.o `test -f 'df.c' || echo '$(srcdir)/'`df.c
 
 guestfsd-df.obj: df.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-df.obj -MD -MP -MF $(DEPDIR)/guestfsd-df.Tpo -c -o guestfsd-df.obj `if test -f 'df.c'; then $(CYGPATH_W) 'df.c'; else $(CYGPATH_W) '$(srcdir)/df.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-df.Tpo $(DEPDIR)/guestfsd-df.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-df.Tpo $(DEPDIR)/guestfsd-df.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='df.c' object='guestfsd-df.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-df.obj `if test -f 'df.c'; then $(CYGPATH_W) 'df.c'; else $(CYGPATH_W) '$(srcdir)/df.c'; fi`
 
 guestfsd-dir.o: dir.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-dir.o -MD -MP -MF $(DEPDIR)/guestfsd-dir.Tpo -c -o guestfsd-dir.o `test -f 'dir.c' || echo '$(srcdir)/'`dir.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-dir.Tpo $(DEPDIR)/guestfsd-dir.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-dir.Tpo $(DEPDIR)/guestfsd-dir.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dir.c' object='guestfsd-dir.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-dir.o `test -f 'dir.c' || echo '$(srcdir)/'`dir.c
 
 guestfsd-dir.obj: dir.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-dir.obj -MD -MP -MF $(DEPDIR)/guestfsd-dir.Tpo -c -o guestfsd-dir.obj `if test -f 'dir.c'; then $(CYGPATH_W) 'dir.c'; else $(CYGPATH_W) '$(srcdir)/dir.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-dir.Tpo $(DEPDIR)/guestfsd-dir.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-dir.Tpo $(DEPDIR)/guestfsd-dir.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dir.c' object='guestfsd-dir.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-dir.obj `if test -f 'dir.c'; then $(CYGPATH_W) 'dir.c'; else $(CYGPATH_W) '$(srcdir)/dir.c'; fi`
 
 guestfsd-dmesg.o: dmesg.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-dmesg.o -MD -MP -MF $(DEPDIR)/guestfsd-dmesg.Tpo -c -o guestfsd-dmesg.o `test -f 'dmesg.c' || echo '$(srcdir)/'`dmesg.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-dmesg.Tpo $(DEPDIR)/guestfsd-dmesg.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-dmesg.Tpo $(DEPDIR)/guestfsd-dmesg.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dmesg.c' object='guestfsd-dmesg.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-dmesg.o `test -f 'dmesg.c' || echo '$(srcdir)/'`dmesg.c
 
 guestfsd-dmesg.obj: dmesg.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-dmesg.obj -MD -MP -MF $(DEPDIR)/guestfsd-dmesg.Tpo -c -o guestfsd-dmesg.obj `if test -f 'dmesg.c'; then $(CYGPATH_W) 'dmesg.c'; else $(CYGPATH_W) '$(srcdir)/dmesg.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-dmesg.Tpo $(DEPDIR)/guestfsd-dmesg.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-dmesg.Tpo $(DEPDIR)/guestfsd-dmesg.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dmesg.c' object='guestfsd-dmesg.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-dmesg.obj `if test -f 'dmesg.c'; then $(CYGPATH_W) 'dmesg.c'; else $(CYGPATH_W) '$(srcdir)/dmesg.c'; fi`
 
 guestfsd-dropcaches.o: dropcaches.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-dropcaches.o -MD -MP -MF $(DEPDIR)/guestfsd-dropcaches.Tpo -c -o guestfsd-dropcaches.o `test -f 'dropcaches.c' || echo '$(srcdir)/'`dropcaches.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-dropcaches.Tpo $(DEPDIR)/guestfsd-dropcaches.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-dropcaches.Tpo $(DEPDIR)/guestfsd-dropcaches.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dropcaches.c' object='guestfsd-dropcaches.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-dropcaches.o `test -f 'dropcaches.c' || echo '$(srcdir)/'`dropcaches.c
 
 guestfsd-dropcaches.obj: dropcaches.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-dropcaches.obj -MD -MP -MF $(DEPDIR)/guestfsd-dropcaches.Tpo -c -o guestfsd-dropcaches.obj `if test -f 'dropcaches.c'; then $(CYGPATH_W) 'dropcaches.c'; else $(CYGPATH_W) '$(srcdir)/dropcaches.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-dropcaches.Tpo $(DEPDIR)/guestfsd-dropcaches.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-dropcaches.Tpo $(DEPDIR)/guestfsd-dropcaches.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dropcaches.c' object='guestfsd-dropcaches.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-dropcaches.obj `if test -f 'dropcaches.c'; then $(CYGPATH_W) 'dropcaches.c'; else $(CYGPATH_W) '$(srcdir)/dropcaches.c'; fi`
 
 guestfsd-du.o: du.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-du.o -MD -MP -MF $(DEPDIR)/guestfsd-du.Tpo -c -o guestfsd-du.o `test -f 'du.c' || echo '$(srcdir)/'`du.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-du.Tpo $(DEPDIR)/guestfsd-du.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-du.Tpo $(DEPDIR)/guestfsd-du.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='du.c' object='guestfsd-du.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-du.o `test -f 'du.c' || echo '$(srcdir)/'`du.c
 
 guestfsd-du.obj: du.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-du.obj -MD -MP -MF $(DEPDIR)/guestfsd-du.Tpo -c -o guestfsd-du.obj `if test -f 'du.c'; then $(CYGPATH_W) 'du.c'; else $(CYGPATH_W) '$(srcdir)/du.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-du.Tpo $(DEPDIR)/guestfsd-du.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-du.Tpo $(DEPDIR)/guestfsd-du.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='du.c' object='guestfsd-du.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-du.obj `if test -f 'du.c'; then $(CYGPATH_W) 'du.c'; else $(CYGPATH_W) '$(srcdir)/du.c'; fi`
 
 guestfsd-ext2.o: ext2.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-ext2.o -MD -MP -MF $(DEPDIR)/guestfsd-ext2.Tpo -c -o guestfsd-ext2.o `test -f 'ext2.c' || echo '$(srcdir)/'`ext2.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-ext2.Tpo $(DEPDIR)/guestfsd-ext2.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-ext2.Tpo $(DEPDIR)/guestfsd-ext2.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ext2.c' object='guestfsd-ext2.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-ext2.o `test -f 'ext2.c' || echo '$(srcdir)/'`ext2.c
 
 guestfsd-ext2.obj: ext2.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-ext2.obj -MD -MP -MF $(DEPDIR)/guestfsd-ext2.Tpo -c -o guestfsd-ext2.obj `if test -f 'ext2.c'; then $(CYGPATH_W) 'ext2.c'; else $(CYGPATH_W) '$(srcdir)/ext2.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-ext2.Tpo $(DEPDIR)/guestfsd-ext2.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-ext2.Tpo $(DEPDIR)/guestfsd-ext2.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ext2.c' object='guestfsd-ext2.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-ext2.obj `if test -f 'ext2.c'; then $(CYGPATH_W) 'ext2.c'; else $(CYGPATH_W) '$(srcdir)/ext2.c'; fi`
 
 guestfsd-file.o: file.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-file.o -MD -MP -MF $(DEPDIR)/guestfsd-file.Tpo -c -o guestfsd-file.o `test -f 'file.c' || echo '$(srcdir)/'`file.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-file.Tpo $(DEPDIR)/guestfsd-file.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-file.Tpo $(DEPDIR)/guestfsd-file.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='file.c' object='guestfsd-file.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-file.o `test -f 'file.c' || echo '$(srcdir)/'`file.c
 
 guestfsd-file.obj: file.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-file.obj -MD -MP -MF $(DEPDIR)/guestfsd-file.Tpo -c -o guestfsd-file.obj `if test -f 'file.c'; then $(CYGPATH_W) 'file.c'; else $(CYGPATH_W) '$(srcdir)/file.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-file.Tpo $(DEPDIR)/guestfsd-file.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-file.Tpo $(DEPDIR)/guestfsd-file.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='file.c' object='guestfsd-file.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-file.obj `if test -f 'file.c'; then $(CYGPATH_W) 'file.c'; else $(CYGPATH_W) '$(srcdir)/file.c'; fi`
 
 guestfsd-find.o: find.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-find.o -MD -MP -MF $(DEPDIR)/guestfsd-find.Tpo -c -o guestfsd-find.o `test -f 'find.c' || echo '$(srcdir)/'`find.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-find.Tpo $(DEPDIR)/guestfsd-find.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-find.Tpo $(DEPDIR)/guestfsd-find.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='find.c' object='guestfsd-find.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-find.o `test -f 'find.c' || echo '$(srcdir)/'`find.c
 
 guestfsd-find.obj: find.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-find.obj -MD -MP -MF $(DEPDIR)/guestfsd-find.Tpo -c -o guestfsd-find.obj `if test -f 'find.c'; then $(CYGPATH_W) 'find.c'; else $(CYGPATH_W) '$(srcdir)/find.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-find.Tpo $(DEPDIR)/guestfsd-find.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-find.Tpo $(DEPDIR)/guestfsd-find.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='find.c' object='guestfsd-find.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-find.obj `if test -f 'find.c'; then $(CYGPATH_W) 'find.c'; else $(CYGPATH_W) '$(srcdir)/find.c'; fi`
 
 guestfsd-fsck.o: fsck.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-fsck.o -MD -MP -MF $(DEPDIR)/guestfsd-fsck.Tpo -c -o guestfsd-fsck.o `test -f 'fsck.c' || echo '$(srcdir)/'`fsck.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-fsck.Tpo $(DEPDIR)/guestfsd-fsck.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-fsck.Tpo $(DEPDIR)/guestfsd-fsck.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fsck.c' object='guestfsd-fsck.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-fsck.o `test -f 'fsck.c' || echo '$(srcdir)/'`fsck.c
 
 guestfsd-fsck.obj: fsck.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-fsck.obj -MD -MP -MF $(DEPDIR)/guestfsd-fsck.Tpo -c -o guestfsd-fsck.obj `if test -f 'fsck.c'; then $(CYGPATH_W) 'fsck.c'; else $(CYGPATH_W) '$(srcdir)/fsck.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-fsck.Tpo $(DEPDIR)/guestfsd-fsck.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-fsck.Tpo $(DEPDIR)/guestfsd-fsck.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fsck.c' object='guestfsd-fsck.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-fsck.obj `if test -f 'fsck.c'; then $(CYGPATH_W) 'fsck.c'; else $(CYGPATH_W) '$(srcdir)/fsck.c'; fi`
 
 guestfsd-glob.o: glob.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-glob.o -MD -MP -MF $(DEPDIR)/guestfsd-glob.Tpo -c -o guestfsd-glob.o `test -f 'glob.c' || echo '$(srcdir)/'`glob.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-glob.Tpo $(DEPDIR)/guestfsd-glob.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-glob.Tpo $(DEPDIR)/guestfsd-glob.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='glob.c' object='guestfsd-glob.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-glob.o `test -f 'glob.c' || echo '$(srcdir)/'`glob.c
 
 guestfsd-glob.obj: glob.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-glob.obj -MD -MP -MF $(DEPDIR)/guestfsd-glob.Tpo -c -o guestfsd-glob.obj `if test -f 'glob.c'; then $(CYGPATH_W) 'glob.c'; else $(CYGPATH_W) '$(srcdir)/glob.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-glob.Tpo $(DEPDIR)/guestfsd-glob.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-glob.Tpo $(DEPDIR)/guestfsd-glob.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='glob.c' object='guestfsd-glob.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-glob.obj `if test -f 'glob.c'; then $(CYGPATH_W) 'glob.c'; else $(CYGPATH_W) '$(srcdir)/glob.c'; fi`
 
 guestfsd-grub.o: grub.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-grub.o -MD -MP -MF $(DEPDIR)/guestfsd-grub.Tpo -c -o guestfsd-grub.o `test -f 'grub.c' || echo '$(srcdir)/'`grub.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-grub.Tpo $(DEPDIR)/guestfsd-grub.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-grub.Tpo $(DEPDIR)/guestfsd-grub.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='grub.c' object='guestfsd-grub.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-grub.o `test -f 'grub.c' || echo '$(srcdir)/'`grub.c
 
 guestfsd-grub.obj: grub.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-grub.obj -MD -MP -MF $(DEPDIR)/guestfsd-grub.Tpo -c -o guestfsd-grub.obj `if test -f 'grub.c'; then $(CYGPATH_W) 'grub.c'; else $(CYGPATH_W) '$(srcdir)/grub.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-grub.Tpo $(DEPDIR)/guestfsd-grub.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-grub.Tpo $(DEPDIR)/guestfsd-grub.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='grub.c' object='guestfsd-grub.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-grub.obj `if test -f 'grub.c'; then $(CYGPATH_W) 'grub.c'; else $(CYGPATH_W) '$(srcdir)/grub.c'; fi`
 
 guestfsd-guestfsd.o: guestfsd.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-guestfsd.o -MD -MP -MF $(DEPDIR)/guestfsd-guestfsd.Tpo -c -o guestfsd-guestfsd.o `test -f 'guestfsd.c' || echo '$(srcdir)/'`guestfsd.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-guestfsd.Tpo $(DEPDIR)/guestfsd-guestfsd.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-guestfsd.Tpo $(DEPDIR)/guestfsd-guestfsd.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='guestfsd.c' object='guestfsd-guestfsd.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-guestfsd.o `test -f 'guestfsd.c' || echo '$(srcdir)/'`guestfsd.c
 
 guestfsd-guestfsd.obj: guestfsd.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-guestfsd.obj -MD -MP -MF $(DEPDIR)/guestfsd-guestfsd.Tpo -c -o guestfsd-guestfsd.obj `if test -f 'guestfsd.c'; then $(CYGPATH_W) 'guestfsd.c'; else $(CYGPATH_W) '$(srcdir)/guestfsd.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-guestfsd.Tpo $(DEPDIR)/guestfsd-guestfsd.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-guestfsd.Tpo $(DEPDIR)/guestfsd-guestfsd.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='guestfsd.c' object='guestfsd-guestfsd.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-guestfsd.obj `if test -f 'guestfsd.c'; then $(CYGPATH_W) 'guestfsd.c'; else $(CYGPATH_W) '$(srcdir)/guestfsd.c'; fi`
 
 guestfsd-headtail.o: headtail.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-headtail.o -MD -MP -MF $(DEPDIR)/guestfsd-headtail.Tpo -c -o guestfsd-headtail.o `test -f 'headtail.c' || echo '$(srcdir)/'`headtail.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-headtail.Tpo $(DEPDIR)/guestfsd-headtail.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-headtail.Tpo $(DEPDIR)/guestfsd-headtail.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='headtail.c' object='guestfsd-headtail.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-headtail.o `test -f 'headtail.c' || echo '$(srcdir)/'`headtail.c
 
 guestfsd-headtail.obj: headtail.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-headtail.obj -MD -MP -MF $(DEPDIR)/guestfsd-headtail.Tpo -c -o guestfsd-headtail.obj `if test -f 'headtail.c'; then $(CYGPATH_W) 'headtail.c'; else $(CYGPATH_W) '$(srcdir)/headtail.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-headtail.Tpo $(DEPDIR)/guestfsd-headtail.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-headtail.Tpo $(DEPDIR)/guestfsd-headtail.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='headtail.c' object='guestfsd-headtail.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-headtail.obj `if test -f 'headtail.c'; then $(CYGPATH_W) 'headtail.c'; else $(CYGPATH_W) '$(srcdir)/headtail.c'; fi`
 
 guestfsd-hexdump.o: hexdump.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-hexdump.o -MD -MP -MF $(DEPDIR)/guestfsd-hexdump.Tpo -c -o guestfsd-hexdump.o `test -f 'hexdump.c' || echo '$(srcdir)/'`hexdump.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-hexdump.Tpo $(DEPDIR)/guestfsd-hexdump.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-hexdump.Tpo $(DEPDIR)/guestfsd-hexdump.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='hexdump.c' object='guestfsd-hexdump.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-hexdump.o `test -f 'hexdump.c' || echo '$(srcdir)/'`hexdump.c
 
 guestfsd-hexdump.obj: hexdump.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-hexdump.obj -MD -MP -MF $(DEPDIR)/guestfsd-hexdump.Tpo -c -o guestfsd-hexdump.obj `if test -f 'hexdump.c'; then $(CYGPATH_W) 'hexdump.c'; else $(CYGPATH_W) '$(srcdir)/hexdump.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-hexdump.Tpo $(DEPDIR)/guestfsd-hexdump.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-hexdump.Tpo $(DEPDIR)/guestfsd-hexdump.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='hexdump.c' object='guestfsd-hexdump.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-hexdump.obj `if test -f 'hexdump.c'; then $(CYGPATH_W) 'hexdump.c'; else $(CYGPATH_W) '$(srcdir)/hexdump.c'; fi`
 
 guestfsd-initrd.o: initrd.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-initrd.o -MD -MP -MF $(DEPDIR)/guestfsd-initrd.Tpo -c -o guestfsd-initrd.o `test -f 'initrd.c' || echo '$(srcdir)/'`initrd.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-initrd.Tpo $(DEPDIR)/guestfsd-initrd.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-initrd.Tpo $(DEPDIR)/guestfsd-initrd.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='initrd.c' object='guestfsd-initrd.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-initrd.o `test -f 'initrd.c' || echo '$(srcdir)/'`initrd.c
 
 guestfsd-initrd.obj: initrd.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-initrd.obj -MD -MP -MF $(DEPDIR)/guestfsd-initrd.Tpo -c -o guestfsd-initrd.obj `if test -f 'initrd.c'; then $(CYGPATH_W) 'initrd.c'; else $(CYGPATH_W) '$(srcdir)/initrd.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-initrd.Tpo $(DEPDIR)/guestfsd-initrd.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-initrd.Tpo $(DEPDIR)/guestfsd-initrd.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='initrd.c' object='guestfsd-initrd.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-initrd.obj `if test -f 'initrd.c'; then $(CYGPATH_W) 'initrd.c'; else $(CYGPATH_W) '$(srcdir)/initrd.c'; fi`
 
 guestfsd-ls.o: ls.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-ls.o -MD -MP -MF $(DEPDIR)/guestfsd-ls.Tpo -c -o guestfsd-ls.o `test -f 'ls.c' || echo '$(srcdir)/'`ls.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-ls.Tpo $(DEPDIR)/guestfsd-ls.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-ls.Tpo $(DEPDIR)/guestfsd-ls.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ls.c' object='guestfsd-ls.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-ls.o `test -f 'ls.c' || echo '$(srcdir)/'`ls.c
 
 guestfsd-ls.obj: ls.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-ls.obj -MD -MP -MF $(DEPDIR)/guestfsd-ls.Tpo -c -o guestfsd-ls.obj `if test -f 'ls.c'; then $(CYGPATH_W) 'ls.c'; else $(CYGPATH_W) '$(srcdir)/ls.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-ls.Tpo $(DEPDIR)/guestfsd-ls.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-ls.Tpo $(DEPDIR)/guestfsd-ls.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ls.c' object='guestfsd-ls.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-ls.obj `if test -f 'ls.c'; then $(CYGPATH_W) 'ls.c'; else $(CYGPATH_W) '$(srcdir)/ls.c'; fi`
 
 guestfsd-lvm.o: lvm.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-lvm.o -MD -MP -MF $(DEPDIR)/guestfsd-lvm.Tpo -c -o guestfsd-lvm.o `test -f 'lvm.c' || echo '$(srcdir)/'`lvm.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-lvm.Tpo $(DEPDIR)/guestfsd-lvm.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-lvm.Tpo $(DEPDIR)/guestfsd-lvm.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='lvm.c' object='guestfsd-lvm.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-lvm.o `test -f 'lvm.c' || echo '$(srcdir)/'`lvm.c
 
 guestfsd-lvm.obj: lvm.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-lvm.obj -MD -MP -MF $(DEPDIR)/guestfsd-lvm.Tpo -c -o guestfsd-lvm.obj `if test -f 'lvm.c'; then $(CYGPATH_W) 'lvm.c'; else $(CYGPATH_W) '$(srcdir)/lvm.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-lvm.Tpo $(DEPDIR)/guestfsd-lvm.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-lvm.Tpo $(DEPDIR)/guestfsd-lvm.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='lvm.c' object='guestfsd-lvm.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-lvm.obj `if test -f 'lvm.c'; then $(CYGPATH_W) 'lvm.c'; else $(CYGPATH_W) '$(srcdir)/lvm.c'; fi`
 
 guestfsd-mknod.o: mknod.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-mknod.o -MD -MP -MF $(DEPDIR)/guestfsd-mknod.Tpo -c -o guestfsd-mknod.o `test -f 'mknod.c' || echo '$(srcdir)/'`mknod.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-mknod.Tpo $(DEPDIR)/guestfsd-mknod.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-mknod.Tpo $(DEPDIR)/guestfsd-mknod.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mknod.c' object='guestfsd-mknod.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-mknod.o `test -f 'mknod.c' || echo '$(srcdir)/'`mknod.c
 
 guestfsd-mknod.obj: mknod.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-mknod.obj -MD -MP -MF $(DEPDIR)/guestfsd-mknod.Tpo -c -o guestfsd-mknod.obj `if test -f 'mknod.c'; then $(CYGPATH_W) 'mknod.c'; else $(CYGPATH_W) '$(srcdir)/mknod.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-mknod.Tpo $(DEPDIR)/guestfsd-mknod.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-mknod.Tpo $(DEPDIR)/guestfsd-mknod.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mknod.c' object='guestfsd-mknod.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-mknod.obj `if test -f 'mknod.c'; then $(CYGPATH_W) 'mknod.c'; else $(CYGPATH_W) '$(srcdir)/mknod.c'; fi`
 
 guestfsd-mount.o: mount.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-mount.o -MD -MP -MF $(DEPDIR)/guestfsd-mount.Tpo -c -o guestfsd-mount.o `test -f 'mount.c' || echo '$(srcdir)/'`mount.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-mount.Tpo $(DEPDIR)/guestfsd-mount.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-mount.Tpo $(DEPDIR)/guestfsd-mount.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mount.c' object='guestfsd-mount.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-mount.o `test -f 'mount.c' || echo '$(srcdir)/'`mount.c
 
 guestfsd-mount.obj: mount.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-mount.obj -MD -MP -MF $(DEPDIR)/guestfsd-mount.Tpo -c -o guestfsd-mount.obj `if test -f 'mount.c'; then $(CYGPATH_W) 'mount.c'; else $(CYGPATH_W) '$(srcdir)/mount.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-mount.Tpo $(DEPDIR)/guestfsd-mount.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-mount.Tpo $(DEPDIR)/guestfsd-mount.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mount.c' object='guestfsd-mount.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-mount.obj `if test -f 'mount.c'; then $(CYGPATH_W) 'mount.c'; else $(CYGPATH_W) '$(srcdir)/mount.c'; fi`
 
 guestfsd-names.o: names.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-names.o -MD -MP -MF $(DEPDIR)/guestfsd-names.Tpo -c -o guestfsd-names.o `test -f 'names.c' || echo '$(srcdir)/'`names.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-names.Tpo $(DEPDIR)/guestfsd-names.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-names.Tpo $(DEPDIR)/guestfsd-names.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='names.c' object='guestfsd-names.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-names.o `test -f 'names.c' || echo '$(srcdir)/'`names.c
 
 guestfsd-names.obj: names.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-names.obj -MD -MP -MF $(DEPDIR)/guestfsd-names.Tpo -c -o guestfsd-names.obj `if test -f 'names.c'; then $(CYGPATH_W) 'names.c'; else $(CYGPATH_W) '$(srcdir)/names.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-names.Tpo $(DEPDIR)/guestfsd-names.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-names.Tpo $(DEPDIR)/guestfsd-names.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='names.c' object='guestfsd-names.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-names.obj `if test -f 'names.c'; then $(CYGPATH_W) 'names.c'; else $(CYGPATH_W) '$(srcdir)/names.c'; fi`
 
 guestfsd-ntfs.o: ntfs.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-ntfs.o -MD -MP -MF $(DEPDIR)/guestfsd-ntfs.Tpo -c -o guestfsd-ntfs.o `test -f 'ntfs.c' || echo '$(srcdir)/'`ntfs.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-ntfs.Tpo $(DEPDIR)/guestfsd-ntfs.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-ntfs.Tpo $(DEPDIR)/guestfsd-ntfs.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntfs.c' object='guestfsd-ntfs.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-ntfs.o `test -f 'ntfs.c' || echo '$(srcdir)/'`ntfs.c
 
 guestfsd-ntfs.obj: ntfs.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-ntfs.obj -MD -MP -MF $(DEPDIR)/guestfsd-ntfs.Tpo -c -o guestfsd-ntfs.obj `if test -f 'ntfs.c'; then $(CYGPATH_W) 'ntfs.c'; else $(CYGPATH_W) '$(srcdir)/ntfs.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-ntfs.Tpo $(DEPDIR)/guestfsd-ntfs.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-ntfs.Tpo $(DEPDIR)/guestfsd-ntfs.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ntfs.c' object='guestfsd-ntfs.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-ntfs.obj `if test -f 'ntfs.c'; then $(CYGPATH_W) 'ntfs.c'; else $(CYGPATH_W) '$(srcdir)/ntfs.c'; fi`
 
 guestfsd-pingdaemon.o: pingdaemon.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-pingdaemon.o -MD -MP -MF $(DEPDIR)/guestfsd-pingdaemon.Tpo -c -o guestfsd-pingdaemon.o `test -f 'pingdaemon.c' || echo '$(srcdir)/'`pingdaemon.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-pingdaemon.Tpo $(DEPDIR)/guestfsd-pingdaemon.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-pingdaemon.Tpo $(DEPDIR)/guestfsd-pingdaemon.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='pingdaemon.c' object='guestfsd-pingdaemon.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-pingdaemon.o `test -f 'pingdaemon.c' || echo '$(srcdir)/'`pingdaemon.c
 
 guestfsd-pingdaemon.obj: pingdaemon.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-pingdaemon.obj -MD -MP -MF $(DEPDIR)/guestfsd-pingdaemon.Tpo -c -o guestfsd-pingdaemon.obj `if test -f 'pingdaemon.c'; then $(CYGPATH_W) 'pingdaemon.c'; else $(CYGPATH_W) '$(srcdir)/pingdaemon.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-pingdaemon.Tpo $(DEPDIR)/guestfsd-pingdaemon.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-pingdaemon.Tpo $(DEPDIR)/guestfsd-pingdaemon.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='pingdaemon.c' object='guestfsd-pingdaemon.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-pingdaemon.obj `if test -f 'pingdaemon.c'; then $(CYGPATH_W) 'pingdaemon.c'; else $(CYGPATH_W) '$(srcdir)/pingdaemon.c'; fi`
 
 guestfsd-proto.o: proto.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-proto.o -MD -MP -MF $(DEPDIR)/guestfsd-proto.Tpo -c -o guestfsd-proto.o `test -f 'proto.c' || echo '$(srcdir)/'`proto.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-proto.Tpo $(DEPDIR)/guestfsd-proto.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-proto.Tpo $(DEPDIR)/guestfsd-proto.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='proto.c' object='guestfsd-proto.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-proto.o `test -f 'proto.c' || echo '$(srcdir)/'`proto.c
 
 guestfsd-proto.obj: proto.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-proto.obj -MD -MP -MF $(DEPDIR)/guestfsd-proto.Tpo -c -o guestfsd-proto.obj `if test -f 'proto.c'; then $(CYGPATH_W) 'proto.c'; else $(CYGPATH_W) '$(srcdir)/proto.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-proto.Tpo $(DEPDIR)/guestfsd-proto.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-proto.Tpo $(DEPDIR)/guestfsd-proto.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='proto.c' object='guestfsd-proto.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-proto.obj `if test -f 'proto.c'; then $(CYGPATH_W) 'proto.c'; else $(CYGPATH_W) '$(srcdir)/proto.c'; fi`
 
 guestfsd-readdir.o: readdir.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-readdir.o -MD -MP -MF $(DEPDIR)/guestfsd-readdir.Tpo -c -o guestfsd-readdir.o `test -f 'readdir.c' || echo '$(srcdir)/'`readdir.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-readdir.Tpo $(DEPDIR)/guestfsd-readdir.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-readdir.Tpo $(DEPDIR)/guestfsd-readdir.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='readdir.c' object='guestfsd-readdir.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-readdir.o `test -f 'readdir.c' || echo '$(srcdir)/'`readdir.c
 
 guestfsd-readdir.obj: readdir.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-readdir.obj -MD -MP -MF $(DEPDIR)/guestfsd-readdir.Tpo -c -o guestfsd-readdir.obj `if test -f 'readdir.c'; then $(CYGPATH_W) 'readdir.c'; else $(CYGPATH_W) '$(srcdir)/readdir.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-readdir.Tpo $(DEPDIR)/guestfsd-readdir.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-readdir.Tpo $(DEPDIR)/guestfsd-readdir.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='readdir.c' object='guestfsd-readdir.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-readdir.obj `if test -f 'readdir.c'; then $(CYGPATH_W) 'readdir.c'; else $(CYGPATH_W) '$(srcdir)/readdir.c'; fi`
 
 guestfsd-scrub.o: scrub.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-scrub.o -MD -MP -MF $(DEPDIR)/guestfsd-scrub.Tpo -c -o guestfsd-scrub.o `test -f 'scrub.c' || echo '$(srcdir)/'`scrub.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-scrub.Tpo $(DEPDIR)/guestfsd-scrub.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-scrub.Tpo $(DEPDIR)/guestfsd-scrub.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='scrub.c' object='guestfsd-scrub.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-scrub.o `test -f 'scrub.c' || echo '$(srcdir)/'`scrub.c
 
 guestfsd-scrub.obj: scrub.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-scrub.obj -MD -MP -MF $(DEPDIR)/guestfsd-scrub.Tpo -c -o guestfsd-scrub.obj `if test -f 'scrub.c'; then $(CYGPATH_W) 'scrub.c'; else $(CYGPATH_W) '$(srcdir)/scrub.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-scrub.Tpo $(DEPDIR)/guestfsd-scrub.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-scrub.Tpo $(DEPDIR)/guestfsd-scrub.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='scrub.c' object='guestfsd-scrub.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-scrub.obj `if test -f 'scrub.c'; then $(CYGPATH_W) 'scrub.c'; else $(CYGPATH_W) '$(srcdir)/scrub.c'; fi`
 
 guestfsd-sfdisk.o: sfdisk.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-sfdisk.o -MD -MP -MF $(DEPDIR)/guestfsd-sfdisk.Tpo -c -o guestfsd-sfdisk.o `test -f 'sfdisk.c' || echo '$(srcdir)/'`sfdisk.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-sfdisk.Tpo $(DEPDIR)/guestfsd-sfdisk.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-sfdisk.Tpo $(DEPDIR)/guestfsd-sfdisk.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='sfdisk.c' object='guestfsd-sfdisk.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-sfdisk.o `test -f 'sfdisk.c' || echo '$(srcdir)/'`sfdisk.c
 
 guestfsd-sfdisk.obj: sfdisk.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-sfdisk.obj -MD -MP -MF $(DEPDIR)/guestfsd-sfdisk.Tpo -c -o guestfsd-sfdisk.obj `if test -f 'sfdisk.c'; then $(CYGPATH_W) 'sfdisk.c'; else $(CYGPATH_W) '$(srcdir)/sfdisk.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-sfdisk.Tpo $(DEPDIR)/guestfsd-sfdisk.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-sfdisk.Tpo $(DEPDIR)/guestfsd-sfdisk.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='sfdisk.c' object='guestfsd-sfdisk.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-sfdisk.obj `if test -f 'sfdisk.c'; then $(CYGPATH_W) 'sfdisk.c'; else $(CYGPATH_W) '$(srcdir)/sfdisk.c'; fi`
 
 guestfsd-sleep.o: sleep.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-sleep.o -MD -MP -MF $(DEPDIR)/guestfsd-sleep.Tpo -c -o guestfsd-sleep.o `test -f 'sleep.c' || echo '$(srcdir)/'`sleep.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-sleep.Tpo $(DEPDIR)/guestfsd-sleep.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-sleep.Tpo $(DEPDIR)/guestfsd-sleep.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='sleep.c' object='guestfsd-sleep.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-sleep.o `test -f 'sleep.c' || echo '$(srcdir)/'`sleep.c
 
 guestfsd-sleep.obj: sleep.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-sleep.obj -MD -MP -MF $(DEPDIR)/guestfsd-sleep.Tpo -c -o guestfsd-sleep.obj `if test -f 'sleep.c'; then $(CYGPATH_W) 'sleep.c'; else $(CYGPATH_W) '$(srcdir)/sleep.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-sleep.Tpo $(DEPDIR)/guestfsd-sleep.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-sleep.Tpo $(DEPDIR)/guestfsd-sleep.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='sleep.c' object='guestfsd-sleep.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-sleep.obj `if test -f 'sleep.c'; then $(CYGPATH_W) 'sleep.c'; else $(CYGPATH_W) '$(srcdir)/sleep.c'; fi`
 
 guestfsd-stat.o: stat.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-stat.o -MD -MP -MF $(DEPDIR)/guestfsd-stat.Tpo -c -o guestfsd-stat.o `test -f 'stat.c' || echo '$(srcdir)/'`stat.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-stat.Tpo $(DEPDIR)/guestfsd-stat.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-stat.Tpo $(DEPDIR)/guestfsd-stat.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='stat.c' object='guestfsd-stat.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-stat.o `test -f 'stat.c' || echo '$(srcdir)/'`stat.c
 
 guestfsd-stat.obj: stat.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-stat.obj -MD -MP -MF $(DEPDIR)/guestfsd-stat.Tpo -c -o guestfsd-stat.obj `if test -f 'stat.c'; then $(CYGPATH_W) 'stat.c'; else $(CYGPATH_W) '$(srcdir)/stat.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-stat.Tpo $(DEPDIR)/guestfsd-stat.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-stat.Tpo $(DEPDIR)/guestfsd-stat.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='stat.c' object='guestfsd-stat.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-stat.obj `if test -f 'stat.c'; then $(CYGPATH_W) 'stat.c'; else $(CYGPATH_W) '$(srcdir)/stat.c'; fi`
 
 guestfsd-strings.o: strings.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-strings.o -MD -MP -MF $(DEPDIR)/guestfsd-strings.Tpo -c -o guestfsd-strings.o `test -f 'strings.c' || echo '$(srcdir)/'`strings.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-strings.Tpo $(DEPDIR)/guestfsd-strings.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-strings.Tpo $(DEPDIR)/guestfsd-strings.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='strings.c' object='guestfsd-strings.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-strings.o `test -f 'strings.c' || echo '$(srcdir)/'`strings.c
 
 guestfsd-strings.obj: strings.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-strings.obj -MD -MP -MF $(DEPDIR)/guestfsd-strings.Tpo -c -o guestfsd-strings.obj `if test -f 'strings.c'; then $(CYGPATH_W) 'strings.c'; else $(CYGPATH_W) '$(srcdir)/strings.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-strings.Tpo $(DEPDIR)/guestfsd-strings.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-strings.Tpo $(DEPDIR)/guestfsd-strings.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='strings.c' object='guestfsd-strings.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-strings.obj `if test -f 'strings.c'; then $(CYGPATH_W) 'strings.c'; else $(CYGPATH_W) '$(srcdir)/strings.c'; fi`
 
 guestfsd-stubs.o: stubs.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-stubs.o -MD -MP -MF $(DEPDIR)/guestfsd-stubs.Tpo -c -o guestfsd-stubs.o `test -f 'stubs.c' || echo '$(srcdir)/'`stubs.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-stubs.Tpo $(DEPDIR)/guestfsd-stubs.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-stubs.Tpo $(DEPDIR)/guestfsd-stubs.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='stubs.c' object='guestfsd-stubs.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-stubs.o `test -f 'stubs.c' || echo '$(srcdir)/'`stubs.c
 
 guestfsd-stubs.obj: stubs.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-stubs.obj -MD -MP -MF $(DEPDIR)/guestfsd-stubs.Tpo -c -o guestfsd-stubs.obj `if test -f 'stubs.c'; then $(CYGPATH_W) 'stubs.c'; else $(CYGPATH_W) '$(srcdir)/stubs.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-stubs.Tpo $(DEPDIR)/guestfsd-stubs.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-stubs.Tpo $(DEPDIR)/guestfsd-stubs.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='stubs.c' object='guestfsd-stubs.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-stubs.obj `if test -f 'stubs.c'; then $(CYGPATH_W) 'stubs.c'; else $(CYGPATH_W) '$(srcdir)/stubs.c'; fi`
 
 guestfsd-swap.o: swap.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-swap.o -MD -MP -MF $(DEPDIR)/guestfsd-swap.Tpo -c -o guestfsd-swap.o `test -f 'swap.c' || echo '$(srcdir)/'`swap.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-swap.Tpo $(DEPDIR)/guestfsd-swap.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-swap.Tpo $(DEPDIR)/guestfsd-swap.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='swap.c' object='guestfsd-swap.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-swap.o `test -f 'swap.c' || echo '$(srcdir)/'`swap.c
 
 guestfsd-swap.obj: swap.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-swap.obj -MD -MP -MF $(DEPDIR)/guestfsd-swap.Tpo -c -o guestfsd-swap.obj `if test -f 'swap.c'; then $(CYGPATH_W) 'swap.c'; else $(CYGPATH_W) '$(srcdir)/swap.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-swap.Tpo $(DEPDIR)/guestfsd-swap.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-swap.Tpo $(DEPDIR)/guestfsd-swap.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='swap.c' object='guestfsd-swap.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-swap.obj `if test -f 'swap.c'; then $(CYGPATH_W) 'swap.c'; else $(CYGPATH_W) '$(srcdir)/swap.c'; fi`
 
 guestfsd-sync.o: sync.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-sync.o -MD -MP -MF $(DEPDIR)/guestfsd-sync.Tpo -c -o guestfsd-sync.o `test -f 'sync.c' || echo '$(srcdir)/'`sync.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-sync.Tpo $(DEPDIR)/guestfsd-sync.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-sync.Tpo $(DEPDIR)/guestfsd-sync.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='sync.c' object='guestfsd-sync.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-sync.o `test -f 'sync.c' || echo '$(srcdir)/'`sync.c
 
 guestfsd-sync.obj: sync.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-sync.obj -MD -MP -MF $(DEPDIR)/guestfsd-sync.Tpo -c -o guestfsd-sync.obj `if test -f 'sync.c'; then $(CYGPATH_W) 'sync.c'; else $(CYGPATH_W) '$(srcdir)/sync.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-sync.Tpo $(DEPDIR)/guestfsd-sync.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-sync.Tpo $(DEPDIR)/guestfsd-sync.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='sync.c' object='guestfsd-sync.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-sync.obj `if test -f 'sync.c'; then $(CYGPATH_W) 'sync.c'; else $(CYGPATH_W) '$(srcdir)/sync.c'; fi`
 
 guestfsd-tar.o: tar.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-tar.o -MD -MP -MF $(DEPDIR)/guestfsd-tar.Tpo -c -o guestfsd-tar.o `test -f 'tar.c' || echo '$(srcdir)/'`tar.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-tar.Tpo $(DEPDIR)/guestfsd-tar.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-tar.Tpo $(DEPDIR)/guestfsd-tar.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tar.c' object='guestfsd-tar.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-tar.o `test -f 'tar.c' || echo '$(srcdir)/'`tar.c
 
 guestfsd-tar.obj: tar.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-tar.obj -MD -MP -MF $(DEPDIR)/guestfsd-tar.Tpo -c -o guestfsd-tar.obj `if test -f 'tar.c'; then $(CYGPATH_W) 'tar.c'; else $(CYGPATH_W) '$(srcdir)/tar.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-tar.Tpo $(DEPDIR)/guestfsd-tar.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-tar.Tpo $(DEPDIR)/guestfsd-tar.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tar.c' object='guestfsd-tar.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-tar.obj `if test -f 'tar.c'; then $(CYGPATH_W) 'tar.c'; else $(CYGPATH_W) '$(srcdir)/tar.c'; fi`
 
 guestfsd-umask.o: umask.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-umask.o -MD -MP -MF $(DEPDIR)/guestfsd-umask.Tpo -c -o guestfsd-umask.o `test -f 'umask.c' || echo '$(srcdir)/'`umask.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-umask.Tpo $(DEPDIR)/guestfsd-umask.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-umask.Tpo $(DEPDIR)/guestfsd-umask.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='umask.c' object='guestfsd-umask.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-umask.o `test -f 'umask.c' || echo '$(srcdir)/'`umask.c
 
 guestfsd-umask.obj: umask.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-umask.obj -MD -MP -MF $(DEPDIR)/guestfsd-umask.Tpo -c -o guestfsd-umask.obj `if test -f 'umask.c'; then $(CYGPATH_W) 'umask.c'; else $(CYGPATH_W) '$(srcdir)/umask.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-umask.Tpo $(DEPDIR)/guestfsd-umask.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-umask.Tpo $(DEPDIR)/guestfsd-umask.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='umask.c' object='guestfsd-umask.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-umask.obj `if test -f 'umask.c'; then $(CYGPATH_W) 'umask.c'; else $(CYGPATH_W) '$(srcdir)/umask.c'; fi`
 
 guestfsd-upload.o: upload.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-upload.o -MD -MP -MF $(DEPDIR)/guestfsd-upload.Tpo -c -o guestfsd-upload.o `test -f 'upload.c' || echo '$(srcdir)/'`upload.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-upload.Tpo $(DEPDIR)/guestfsd-upload.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-upload.Tpo $(DEPDIR)/guestfsd-upload.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='upload.c' object='guestfsd-upload.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-upload.o `test -f 'upload.c' || echo '$(srcdir)/'`upload.c
 
 guestfsd-upload.obj: upload.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-upload.obj -MD -MP -MF $(DEPDIR)/guestfsd-upload.Tpo -c -o guestfsd-upload.obj `if test -f 'upload.c'; then $(CYGPATH_W) 'upload.c'; else $(CYGPATH_W) '$(srcdir)/upload.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-upload.Tpo $(DEPDIR)/guestfsd-upload.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-upload.Tpo $(DEPDIR)/guestfsd-upload.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='upload.c' object='guestfsd-upload.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-upload.obj `if test -f 'upload.c'; then $(CYGPATH_W) 'upload.c'; else $(CYGPATH_W) '$(srcdir)/upload.c'; fi`
 
 guestfsd-wc.o: wc.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-wc.o -MD -MP -MF $(DEPDIR)/guestfsd-wc.Tpo -c -o guestfsd-wc.o `test -f 'wc.c' || echo '$(srcdir)/'`wc.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-wc.Tpo $(DEPDIR)/guestfsd-wc.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-wc.Tpo $(DEPDIR)/guestfsd-wc.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='wc.c' object='guestfsd-wc.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-wc.o `test -f 'wc.c' || echo '$(srcdir)/'`wc.c
 
 guestfsd-wc.obj: wc.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-wc.obj -MD -MP -MF $(DEPDIR)/guestfsd-wc.Tpo -c -o guestfsd-wc.obj `if test -f 'wc.c'; then $(CYGPATH_W) 'wc.c'; else $(CYGPATH_W) '$(srcdir)/wc.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-wc.Tpo $(DEPDIR)/guestfsd-wc.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-wc.Tpo $(DEPDIR)/guestfsd-wc.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='wc.c' object='guestfsd-wc.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-wc.obj `if test -f 'wc.c'; then $(CYGPATH_W) 'wc.c'; else $(CYGPATH_W) '$(srcdir)/wc.c'; fi`
 
+guestfsd-xattr.o: xattr.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-xattr.o -MD -MP -MF $(DEPDIR)/guestfsd-xattr.Tpo -c -o guestfsd-xattr.o `test -f 'xattr.c' || echo '$(srcdir)/'`xattr.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-xattr.Tpo $(DEPDIR)/guestfsd-xattr.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='xattr.c' object='guestfsd-xattr.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-xattr.o `test -f 'xattr.c' || echo '$(srcdir)/'`xattr.c
+
+guestfsd-xattr.obj: xattr.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-xattr.obj -MD -MP -MF $(DEPDIR)/guestfsd-xattr.Tpo -c -o guestfsd-xattr.obj `if test -f 'xattr.c'; then $(CYGPATH_W) 'xattr.c'; else $(CYGPATH_W) '$(srcdir)/xattr.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-xattr.Tpo $(DEPDIR)/guestfsd-xattr.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='xattr.c' object='guestfsd-xattr.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-xattr.obj `if test -f 'xattr.c'; then $(CYGPATH_W) 'xattr.c'; else $(CYGPATH_W) '$(srcdir)/xattr.c'; fi`
+
 guestfsd-zero.o: zero.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-zero.o -MD -MP -MF $(DEPDIR)/guestfsd-zero.Tpo -c -o guestfsd-zero.o `test -f 'zero.c' || echo '$(srcdir)/'`zero.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-zero.Tpo $(DEPDIR)/guestfsd-zero.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-zero.Tpo $(DEPDIR)/guestfsd-zero.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='zero.c' object='guestfsd-zero.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-zero.o `test -f 'zero.c' || echo '$(srcdir)/'`zero.c
 
 guestfsd-zero.obj: zero.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-zero.obj -MD -MP -MF $(DEPDIR)/guestfsd-zero.Tpo -c -o guestfsd-zero.obj `if test -f 'zero.c'; then $(CYGPATH_W) 'zero.c'; else $(CYGPATH_W) '$(srcdir)/zero.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-zero.Tpo $(DEPDIR)/guestfsd-zero.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-zero.Tpo $(DEPDIR)/guestfsd-zero.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='zero.c' object='guestfsd-zero.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-zero.obj `if test -f 'zero.c'; then $(CYGPATH_W) 'zero.c'; else $(CYGPATH_W) '$(srcdir)/zero.c'; fi`
 
 guestfsd-zerofree.o: zerofree.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-zerofree.o -MD -MP -MF $(DEPDIR)/guestfsd-zerofree.Tpo -c -o guestfsd-zerofree.o `test -f 'zerofree.c' || echo '$(srcdir)/'`zerofree.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-zerofree.Tpo $(DEPDIR)/guestfsd-zerofree.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-zerofree.Tpo $(DEPDIR)/guestfsd-zerofree.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='zerofree.c' object='guestfsd-zerofree.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-zerofree.o `test -f 'zerofree.c' || echo '$(srcdir)/'`zerofree.c
 
 guestfsd-zerofree.obj: zerofree.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-zerofree.obj -MD -MP -MF $(DEPDIR)/guestfsd-zerofree.Tpo -c -o guestfsd-zerofree.obj `if test -f 'zerofree.c'; then $(CYGPATH_W) 'zerofree.c'; else $(CYGPATH_W) '$(srcdir)/zerofree.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-zerofree.Tpo $(DEPDIR)/guestfsd-zerofree.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-zerofree.Tpo $(DEPDIR)/guestfsd-zerofree.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='zerofree.c' object='guestfsd-zerofree.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-zerofree.obj `if test -f 'zerofree.c'; then $(CYGPATH_W) 'zerofree.c'; else $(CYGPATH_W) '$(srcdir)/zerofree.c'; fi`
 
 guestfsd-guestfs_protocol.o: $(top_builddir)/../src/guestfs_protocol.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-guestfs_protocol.o -MD -MP -MF $(DEPDIR)/guestfsd-guestfs_protocol.Tpo -c -o guestfsd-guestfs_protocol.o `test -f '$(top_builddir)/../src/guestfs_protocol.c' || echo '$(srcdir)/'`$(top_builddir)/../src/guestfs_protocol.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-guestfs_protocol.Tpo $(DEPDIR)/guestfsd-guestfs_protocol.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-guestfs_protocol.Tpo $(DEPDIR)/guestfsd-guestfs_protocol.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_builddir)/../src/guestfs_protocol.c' object='guestfsd-guestfs_protocol.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-guestfs_protocol.o `test -f '$(top_builddir)/../src/guestfs_protocol.c' || echo '$(srcdir)/'`$(top_builddir)/../src/guestfs_protocol.c
 
 guestfsd-guestfs_protocol.obj: $(top_builddir)/../src/guestfs_protocol.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -MT guestfsd-guestfs_protocol.obj -MD -MP -MF $(DEPDIR)/guestfsd-guestfs_protocol.Tpo -c -o guestfsd-guestfs_protocol.obj `if test -f '$(top_builddir)/../src/guestfs_protocol.c'; then $(CYGPATH_W) '$(top_builddir)/../src/guestfs_protocol.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/../src/guestfs_protocol.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfsd-guestfs_protocol.Tpo $(DEPDIR)/guestfsd-guestfs_protocol.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfsd-guestfs_protocol.Tpo $(DEPDIR)/guestfsd-guestfs_protocol.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_builddir)/../src/guestfs_protocol.c' object='guestfsd-guestfs_protocol.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfsd_CFLAGS) $(CFLAGS) -c -o guestfsd-guestfs_protocol.obj `if test -f '$(top_builddir)/../src/guestfs_protocol.c'; then $(CYGPATH_W) '$(top_builddir)/../src/guestfs_protocol.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/../src/guestfs_protocol.c'; fi`
@@ -1053,7 +1074,7 @@ tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
@@ -1061,36 +1082,41 @@ TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
 	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
-	test -d $(distdir) || mkdir $(distdir)
+	test -d "$(distdir)" || mkdir "$(distdir)"
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -1106,21 +1132,26 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
 	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
 	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
-	|| chmod -R a+r $(distdir)
+	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
 	$(am__remove_distdir)
@@ -1133,6 +1164,10 @@ dist-lzma: distdir
 	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
 	$(am__remove_distdir)
 
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
+	$(am__remove_distdir)
+
 dist-tarZ: distdir
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__remove_distdir)
@@ -1161,6 +1196,8 @@ distcheck: dist
 	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lzma*) \
 	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
@@ -1172,9 +1209,11 @@ distcheck: dist
 	mkdir $(distdir)/_build
 	mkdir $(distdir)/_inst
 	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
-	  && cd $(distdir)/_build \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
 	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
@@ -1196,13 +1235,15 @@ distcheck: dist
 	  && rm -rf "$$dc_destdir" \
 	  && $(MAKE) $(AM_MAKEFLAGS) dist \
 	  && rm -rf $(DIST_ARCHIVES) \
-	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
 	$(am__remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
 distuninstallcheck:
-	@cd $(distuninstallcheck_dir) \
+	@$(am__cd) '$(distuninstallcheck_dir)' \
 	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
 	   || { echo "ERROR: files left after uninstall:" ; \
 	        if test -n "$(DESTDIR)"; then \
@@ -1243,6 +1284,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -1264,6 +1306,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -1272,18 +1316,28 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -1307,22 +1361,23 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: install-am install-strip
+.MAKE: all install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
 	clean-generic clean-noinstPROGRAMS ctags dist dist-all \
-	dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-zip \
-	distcheck distclean distclean-compile distclean-generic \
-	distclean-hdr distclean-tags distcleancheck distdir \
-	distuninstallcheck dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	maintainer-clean maintainer-clean-generic mostlyclean \
-	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
-	tags uninstall uninstall-am
+	dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ dist-xz \
+	dist-zip distcheck distclean distclean-compile \
+	distclean-generic distclean-hdr distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+	ps ps-am tags uninstall uninstall-am
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/daemon/aclocal.m4 b/daemon/aclocal.m4
index bfa9aab..4b0e468 100644
--- a/daemon/aclocal.m4
+++ b/daemon/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.11 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -31,10 +31,10 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.10'
+[am__api_version='1.11'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.10.2], [],
+m4_if([$1], [1.11], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -50,7 +50,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10.2])dnl
+[AM_AUTOMAKE_VERSION([1.11])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -110,14 +110,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 8
+# serial 9
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
@@ -130,6 +130,7 @@ AC_SUBST([$1_TRUE])dnl
 AC_SUBST([$1_FALSE])dnl
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
 if $2; then
   $1_TRUE=
   $1_FALSE='#'
@@ -143,14 +144,14 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
+# serial 10
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -207,6 +208,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
   fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -224,7 +235,17 @@ AC_CACHE_CHECK([dependency style of $depcc],
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
@@ -234,19 +255,23 @@ AC_CACHE_CHECK([dependency style of $depcc],
 	break
       fi
       ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -310,59 +335,61 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 4
+#serial 5
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[# Autoconf 2.62 quotes --file arguments for eval, but not when files
-# are listed without --file.  Let's play safe and only enable the eval
-# if we detect the quoting.
-case $CONFIG_FILES in
-*\'*) eval set x "$CONFIG_FILES" ;;
-*)   set x $CONFIG_FILES ;;
-esac
-shift
-for mf
-do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # Grep'ing the whole file is not good either: AIX grep has a line
-  # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
 
@@ -382,13 +409,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # Do all the work for Automake.                             -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008 Free Software Foundation, Inc.
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 13
+# serial 16
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
@@ -405,7 +432,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 # arguments mandatory, and then we can depend on a new Autoconf
 # release and drop the old call support.
 AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.60])dnl
+[AC_PREREQ([2.62])dnl
 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
 dnl the ones we care about.
 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -456,8 +483,8 @@ AM_MISSING_PROG(AUTOCONF, autoconf)
 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
 AM_MISSING_PROG(AUTOHEADER, autoheader)
 AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_PROG_INSTALL_SH
-AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
@@ -465,24 +492,37 @@ AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
-              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
-	      		     [_AM_PROG_TAR([v7])])])
+	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+			     [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-                  [_AM_DEPENDENCIES(CC)],
-                  [define([AC_PROG_CC],
-                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+		  [_AM_DEPENDENCIES(CC)],
+		  [define([AC_PROG_CC],
+			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-                  [_AM_DEPENDENCIES(CXX)],
-                  [define([AC_PROG_CXX],
-                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+		  [_AM_DEPENDENCIES(CXX)],
+		  [define([AC_PROG_CXX],
+			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-                  [_AM_DEPENDENCIES(OBJC)],
-                  [define([AC_PROG_OBJC],
-                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+		  [_AM_DEPENDENCIES(OBJC)],
+		  [define([AC_PROG_OBJC],
+			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
 ])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
 
 # When config.status generates a header, we must update the stamp-h file.
 # This file resides in the same directory as the config header
@@ -505,7 +545,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -516,7 +556,14 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
 AC_SUBST(install_sh)])
 
 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
@@ -542,13 +589,13 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
+# serial 4
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -557,7 +604,7 @@ AC_DEFUN([AM_MAKE_INCLUDE],
 [am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
@@ -567,24 +614,24 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 AC_SUBST([am__include])
 AC_SUBST([am__quote])
@@ -629,14 +676,14 @@ m4_define([AC_PROG_CC],
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -653,7 +700,14 @@ AC_SUBST($1)])
 AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
@@ -724,14 +778,14 @@ AC_DEFUN([_AM_IF_OPTION],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 # AM_SANITY_CHECK
 # ---------------
@@ -740,16 +794,29 @@ AC_DEFUN([AM_SANITY_CHECK],
 # Just in case
 sleep 1
 echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
    if test "$[*]" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t "$srcdir/configure" conftest.file`
    fi
    rm -f conftest.file
    if test "$[*]" != "X $srcdir/configure conftest.file" \
@@ -802,18 +869,25 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# serial 2
+
 # _AM_SUBST_NOTMAKE(VARIABLE)
 # ---------------------------
 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
 # This macro is traced by Automake.
 AC_DEFUN([_AM_SUBST_NOTMAKE])
 
+# AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
 # Check how to create a tarball.                            -*- Autoconf -*-
 
 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
diff --git a/daemon/actions.h b/daemon/actions.h
index 92e6b4c..3ba543e 100644
--- a/daemon/actions.h
+++ b/daemon/actions.h
@@ -160,3 +160,10 @@ extern int do_mknod_c (int mode, int devmajor, int devminor, char *path);
 extern int do_umask (int mask);
 extern guestfs_int_dirent_list *do_readdir (char *dir);
 extern int do_sfdiskM (char *device, char **lines);
+extern char *do_zfile (char *method, char *path);
+extern guestfs_int_xattr_list *do_getxattrs (char *path);
+extern guestfs_int_xattr_list *do_lgetxattrs (char *path);
+extern int do_setxattr (char *xattr, char *val, int vallen, char *path);
+extern int do_lsetxattr (char *xattr, char *val, int vallen, char *path);
+extern int do_removexattr (char *xattr, char *path);
+extern int do_lremovexattr (char *xattr, char *path);
diff --git a/daemon/config.h.in b/daemon/config.h.in
index 747483f..131575a 100644
--- a/daemon/config.h.in
+++ b/daemon/config.h.in
@@ -3,6 +3,9 @@
 /* Enable the 'debug' command */
 #undef ENABLE_DEBUG_COMMAND
 
+/* Define to 1 if you have the <attr/xattr.h> header file. */
+#undef HAVE_ATTR_XATTR_H
+
 /* Define to 1 if you have Augeas */
 #undef HAVE_AUGEAS
 
@@ -18,15 +21,39 @@
 /* Define to 1 if you have the `futimens' function. */
 #undef HAVE_FUTIMENS
 
+/* Define to 1 if you have the `getxattr' function. */
+#undef HAVE_GETXATTR
+
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `lgetxattr' function. */
+#undef HAVE_LGETXATTR
+
 /* Define to 1 if you have the `portablexdr' library (-lportablexdr). */
 #undef HAVE_LIBPORTABLEXDR
 
+/* Define to 1 if you have the `listxattr' function. */
+#undef HAVE_LISTXATTR
+
+/* Define to 1 if you have the `llistxattr' function. */
+#undef HAVE_LLISTXATTR
+
+/* Define to 1 if you have the `lremovexattr' function. */
+#undef HAVE_LREMOVEXATTR
+
+/* Define to 1 if you have the `lsetxattr' function. */
+#undef HAVE_LSETXATTR
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
+/* Define to 1 if you have the `removexattr' function. */
+#undef HAVE_REMOVEXATTR
+
+/* Define to 1 if you have the `setxattr' function. */
+#undef HAVE_SETXATTR
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
@@ -45,6 +72,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the <sys/xattr.h> header file. */
+#undef HAVE_SYS_XATTR_H
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
diff --git a/daemon/configure b/daemon/configure
index a5de4db..95c866f 100755
--- a/daemon/configure
+++ b/daemon/configure
@@ -634,7 +634,9 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='LTLIBOBJS
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
 LIBOBJS
 EGREP
 GREP
@@ -1820,7 +1822,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-am__api_version='1.10'
+am__api_version='1.11'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -1951,16 +1953,33 @@ $as_echo_n "checking whether build environment is sane... " >&6; }
 # Just in case
 sleep 1
 echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5
+$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
+$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
    if test "$*" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t "$srcdir/configure" conftest.file`
    fi
    rm -f conftest.file
    if test "$*" != "X $srcdir/configure conftest.file" \
@@ -2004,7 +2023,14 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
 
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
@@ -2014,6 +2040,115 @@ else
 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 fi
 
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
 { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
@@ -2196,108 +2331,6 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
-
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
 # Always define AMTAR for backward compatibility.
@@ -2339,7 +2372,7 @@ ac_config_commands="$ac_config_commands depfiles"
 am_make=${MAKE-make}
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
@@ -2350,24 +2383,24 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 
 
@@ -3356,6 +3389,11 @@ else
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -3373,7 +3411,17 @@ else
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
@@ -3383,19 +3431,23 @@ else
 	break
       fi
       ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -5000,6 +5052,11 @@ else
   if test "$am_compiler_list" = ""; then
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
     # like to wrap large dependency lists on column 80 (with \), and
@@ -5017,7 +5074,17 @@ else
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
       # after this tag, mechanisms are not by side-effect, so they'll
       # only be used when explicitly requested
@@ -5027,19 +5094,23 @@ else
 	break
       fi
       ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
       # or remarks (even with -Werror).  So we grep stderr for any message
@@ -5917,7 +5988,15 @@ fi
 
 
 
-for ac_func in futimens
+
+
+
+
+
+
+
+
+for ac_func in futimens listxattr llistxattr getxattr lgetxattr setxattr lsetxattr removexattr lremovexattr
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -6018,6 +6097,154 @@ fi
 done
 
 
+
+
+for ac_header in attr/xattr.h sys/xattr.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
 ac_config_headers="$ac_config_headers config.h"
 
 ac_config_files="$ac_config_files Makefile"
@@ -6119,6 +6346,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
   { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -7305,27 +7540,28 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
-# are listed without --file.  Let's play safe and only enable the eval
-# if we detect the quoting.
-case $CONFIG_FILES in
-*\'*) eval set x "$CONFIG_FILES" ;;
-*)   set x $CONFIG_FILES ;;
-esac
-shift
-for mf
-do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # Grep'ing the whole file is not good either: AIX grep has a line
-  # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-    dirpart=`$as_dirname -- "$mf" ||
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$mf" : 'X\(//\)[^/]' \| \
 	 X"$mf" : 'X\(//\)$' \| \
@@ -7348,28 +7584,28 @@ $as_echo X"$mf" |
 	    q
 	  }
 	  s/.*/./; q'`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`$as_dirname -- "$file" ||
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$file" : 'X\(//\)[^/]' \| \
 	 X"$file" : 'X\(//\)$' \| \
@@ -7392,7 +7628,7 @@ $as_echo X"$file" |
 	    q
 	  }
 	  s/.*/./; q'`
-    { as_dir=$dirpart/$fdir
+      { as_dir=$dirpart/$fdir
   case $as_dir in #(
   -*) as_dir=./$as_dir;;
   esac
@@ -7433,10 +7669,11 @@ $as_echo X"$as_dir" |
   } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
  ;;
 
   esac
diff --git a/daemon/configure.ac b/daemon/configure.ac
index 238532e..dc6936b 100644
--- a/daemon/configure.ac
+++ b/daemon/configure.ac
@@ -63,7 +63,10 @@ AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
 	])
 
 dnl Functions which may not be available in older distributions.
-AC_CHECK_FUNCS([futimens])
+AC_CHECK_FUNCS([futimens listxattr llistxattr getxattr lgetxattr setxattr lsetxattr removexattr lremovexattr])
+
+dnl Headers.
+AC_CHECK_HEADERS([attr/xattr.h sys/xattr.h])
 
 dnl Produce output files.
 AC_CONFIG_HEADERS([config.h])
diff --git a/daemon/file.c b/daemon/file.c
index 3ef7441..98c356d 100644
--- a/daemon/file.c
+++ b/daemon/file.c
@@ -376,3 +376,63 @@ do_file (char *path)
 
   return out;			/* caller frees */
 }
+
+/* zcat | file */
+char *
+do_zfile (char *method, char *path)
+{
+  int len;
+  char *cmd;
+  FILE *fp;
+  char line[256];
+
+  NEED_ROOT (NULL);
+  ABS_PATH (path, NULL);
+
+  len = 2 * strlen (path) + 64;
+  cmd = malloc (len);
+  if (!cmd) {
+    reply_with_perror ("malloc");
+    return NULL;
+  }
+
+  if (strcmp (method, "gzip") == 0 || strcmp (method, "compress") == 0)
+    strcpy (cmd, "zcat");
+  else if (strcmp (method, "bzip2") == 0)
+    strcpy (cmd, "bzcat");
+  else {
+    free (cmd);
+    reply_with_error ("zfile: unknown method");
+    return NULL;
+  }
+
+  strcat (cmd, " /sysroot");
+  shell_quote (cmd + strlen (cmd), len - strlen (cmd), path);
+  strcat (cmd, " | file -bsL -");
+
+  fp = popen (cmd, "r");
+  if (fp == NULL) {
+    reply_with_perror ("%s", cmd);
+    free (cmd);
+    return NULL;
+  }
+
+  free (cmd);
+
+  if (fgets (line, sizeof line, fp) == NULL) {
+    reply_with_perror ("zfile: fgets");
+    fclose (fp);
+    return NULL;
+  }
+
+  if (fclose (fp) == -1) {
+    reply_with_perror ("zfile: fclose");
+    return NULL;
+  }
+
+  len = strlen (line);
+  if (len > 0 && line[len-1] == '\n')
+    line[len-1] = '\0';
+
+  return strdup (line);
+}
diff --git a/daemon/names.c b/daemon/names.c
index 1eab7ff..0508630 100644
--- a/daemon/names.c
+++ b/daemon/names.c
@@ -164,4 +164,11 @@ const char *function_names[] = {
   [137] = "umask",
   [138] = "readdir",
   [139] = "sfdiskM",
+  [140] = "zfile",
+  [141] = "getxattrs",
+  [142] = "lgetxattrs",
+  [143] = "setxattr",
+  [144] = "lsetxattr",
+  [145] = "removexattr",
+  [146] = "lremovexattr",
 };
diff --git a/daemon/stubs.c b/daemon/stubs.c
index a18e9ed..eeff946 100644
--- a/daemon/stubs.c
+++ b/daemon/stubs.c
@@ -3539,6 +3539,201 @@ done:
   xdr_free ((xdrproc_t) xdr_guestfs_sfdiskM_args, (char *) &args);
 }
 
+static void zfile_stub (XDR *xdr_in)
+{
+  char *r;
+  struct guestfs_zfile_args args;
+  char *method;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_zfile_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "zfile");
+    return;
+  }
+  method = args.method;
+  path = args.path;
+
+  r = do_zfile (method, path);
+  if (r == NULL)
+    /* do_zfile has already called reply_with_error */
+    goto done;
+
+  struct guestfs_zfile_ret ret;
+  ret.description = r;
+  reply ((xdrproc_t) &xdr_guestfs_zfile_ret, (char *) &ret);
+  free (r);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_zfile_args, (char *) &args);
+}
+
+static void getxattrs_stub (XDR *xdr_in)
+{
+  guestfs_int_xattr_list *r;
+  struct guestfs_getxattrs_args args;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_getxattrs_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "getxattrs");
+    return;
+  }
+  path = args.path;
+
+  r = do_getxattrs (path);
+  if (r == NULL)
+    /* do_getxattrs has already called reply_with_error */
+    goto done;
+
+  struct guestfs_getxattrs_ret ret;
+  ret.xattrs = *r;
+  reply ((xdrproc_t) xdr_guestfs_getxattrs_ret, (char *) &ret);
+  xdr_free ((xdrproc_t) xdr_guestfs_getxattrs_ret, (char *) &ret);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_getxattrs_args, (char *) &args);
+}
+
+static void lgetxattrs_stub (XDR *xdr_in)
+{
+  guestfs_int_xattr_list *r;
+  struct guestfs_lgetxattrs_args args;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_lgetxattrs_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "lgetxattrs");
+    return;
+  }
+  path = args.path;
+
+  r = do_lgetxattrs (path);
+  if (r == NULL)
+    /* do_lgetxattrs has already called reply_with_error */
+    goto done;
+
+  struct guestfs_lgetxattrs_ret ret;
+  ret.xattrs = *r;
+  reply ((xdrproc_t) xdr_guestfs_lgetxattrs_ret, (char *) &ret);
+  xdr_free ((xdrproc_t) xdr_guestfs_lgetxattrs_ret, (char *) &ret);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_lgetxattrs_args, (char *) &args);
+}
+
+static void setxattr_stub (XDR *xdr_in)
+{
+  int r;
+  struct guestfs_setxattr_args args;
+  char *xattr;
+  char *val;
+  int vallen;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_setxattr_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "setxattr");
+    return;
+  }
+  xattr = args.xattr;
+  val = args.val;
+  vallen = args.vallen;
+  path = args.path;
+
+  r = do_setxattr (xattr, val, vallen, path);
+  if (r == -1)
+    /* do_setxattr has already called reply_with_error */
+    goto done;
+
+  reply (NULL, NULL);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_setxattr_args, (char *) &args);
+}
+
+static void lsetxattr_stub (XDR *xdr_in)
+{
+  int r;
+  struct guestfs_lsetxattr_args args;
+  char *xattr;
+  char *val;
+  int vallen;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_lsetxattr_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "lsetxattr");
+    return;
+  }
+  xattr = args.xattr;
+  val = args.val;
+  vallen = args.vallen;
+  path = args.path;
+
+  r = do_lsetxattr (xattr, val, vallen, path);
+  if (r == -1)
+    /* do_lsetxattr has already called reply_with_error */
+    goto done;
+
+  reply (NULL, NULL);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_lsetxattr_args, (char *) &args);
+}
+
+static void removexattr_stub (XDR *xdr_in)
+{
+  int r;
+  struct guestfs_removexattr_args args;
+  char *xattr;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_removexattr_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "removexattr");
+    return;
+  }
+  xattr = args.xattr;
+  path = args.path;
+
+  r = do_removexattr (xattr, path);
+  if (r == -1)
+    /* do_removexattr has already called reply_with_error */
+    goto done;
+
+  reply (NULL, NULL);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_removexattr_args, (char *) &args);
+}
+
+static void lremovexattr_stub (XDR *xdr_in)
+{
+  int r;
+  struct guestfs_lremovexattr_args args;
+  char *xattr;
+  char *path;
+
+  memset (&args, 0, sizeof args);
+
+  if (!xdr_guestfs_lremovexattr_args (xdr_in, &args)) {
+    reply_with_error ("%s: daemon failed to decode procedure arguments", "lremovexattr");
+    return;
+  }
+  xattr = args.xattr;
+  path = args.path;
+
+  r = do_lremovexattr (xattr, path);
+  if (r == -1)
+    /* do_lremovexattr has already called reply_with_error */
+    goto done;
+
+  reply (NULL, NULL);
+done:
+  xdr_free ((xdrproc_t) xdr_guestfs_lremovexattr_args, (char *) &args);
+}
+
 void dispatch_incoming_message (XDR *xdr_in)
 {
   switch (proc_nr) {
@@ -3959,6 +4154,27 @@ void dispatch_incoming_message (XDR *xdr_in)
     case GUESTFS_PROC_SFDISKM:
       sfdiskM_stub (xdr_in);
       break;
+    case GUESTFS_PROC_ZFILE:
+      zfile_stub (xdr_in);
+      break;
+    case GUESTFS_PROC_GETXATTRS:
+      getxattrs_stub (xdr_in);
+      break;
+    case GUESTFS_PROC_LGETXATTRS:
+      lgetxattrs_stub (xdr_in);
+      break;
+    case GUESTFS_PROC_SETXATTR:
+      setxattr_stub (xdr_in);
+      break;
+    case GUESTFS_PROC_LSETXATTR:
+      lsetxattr_stub (xdr_in);
+      break;
+    case GUESTFS_PROC_REMOVEXATTR:
+      removexattr_stub (xdr_in);
+      break;
+    case GUESTFS_PROC_LREMOVEXATTR:
+      lremovexattr_stub (xdr_in);
+      break;
     default:
       reply_with_error ("dispatch_incoming_message: unknown procedure number %d, set LIBGUESTFS_PATH to point to the matching libguestfs appliance directory", proc_nr);
   }
diff --git a/daemon/xattr.c b/daemon/xattr.c
new file mode 100644
index 0000000..23b00d8
--- /dev/null
+++ b/daemon/xattr.c
@@ -0,0 +1,291 @@
+/* libguestfs - the guestfsd daemon
+ * Copyright (C) 2009 Red Hat Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include "../src/guestfs_protocol.h"
+#include "daemon.h"
+#include "actions.h"
+
+#if defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_XATTR_H)
+
+#ifdef HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
+#else
+#ifdef HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#endif
+#endif
+
+static guestfs_int_xattr_list *getxattrs (char *path, ssize_t (*listxattr) (const char *path, char *list, size_t size), ssize_t (*getxattr) (const char *path, const char *name, void *value, size_t size));
+static int _setxattr (char *xattr, char *val, int vallen, char *path, int (*setxattr) (const char *path, const char *name, const void *value, size_t size, int flags));
+static int _removexattr (char *xattr, char *path, int (*removexattr) (const char *path, const char *name));
+
+guestfs_int_xattr_list *
+do_getxattrs (char *path)
+{
+#if defined(HAVE_LISTXATTR) && defined(HAVE_GETXATTR)
+  return getxattrs (path, listxattr, getxattr);
+#else
+  reply_with_error ("getxattrs: no support for listxattr and getxattr");
+  return NULL;
+#endif
+}
+
+guestfs_int_xattr_list *
+do_lgetxattrs (char *path)
+{
+#if defined(HAVE_LLISTXATTR) && defined(HAVE_LGETXATTR)
+  return getxattrs (path, llistxattr, lgetxattr);
+#else
+  reply_with_error ("lgetxattrs: no support for llistxattr and lgetxattr");
+  return NULL;
+#endif
+}
+
+int
+do_setxattr (char *xattr, char *val, int vallen, char *path)
+{
+#if defined(HAVE_SETXATTR)
+  return _setxattr (xattr, val, vallen, path, setxattr);
+#else
+  reply_with_error ("setxattr: no support for setxattr");
+  return -1;
+#endif
+}
+
+int
+do_lsetxattr (char *xattr, char *val, int vallen, char *path)
+{
+#if defined(HAVE_LSETXATTR)
+  return _setxattr (xattr, val, vallen, path, lsetxattr);
+#else
+  reply_with_error ("lsetxattr: no support for lsetxattr");
+  return -1;
+#endif
+}
+
+int
+do_removexattr (char *xattr, char *path)
+{
+#if defined(HAVE_REMOVEXATTR)
+  return _removexattr (xattr, path, removexattr);
+#else
+  reply_with_error ("removexattr: no support for removexattr");
+  return -1;
+#endif
+}
+
+int
+do_lremovexattr (char *xattr, char *path)
+{
+#if defined(HAVE_LREMOVEXATTR)
+  return _removexattr (xattr, path, lremovexattr);
+#else
+  reply_with_error ("lremovexattr: no support for lremovexattr");
+  return -1;
+#endif
+}
+
+static guestfs_int_xattr_list *
+getxattrs (char *path,
+	   ssize_t (*listxattr) (const char *path, char *list, size_t size),
+	   ssize_t (*getxattr) (const char *path, const char *name,
+				void *value, size_t size))
+{
+  ssize_t len, vlen;
+  char *buf = NULL;
+  int i, j;
+  guestfs_int_xattr_list *r = NULL;
+
+  NEED_ROOT (NULL);
+  ABS_PATH (path, NULL);
+
+  CHROOT_IN;
+  len = listxattr (path, NULL, 0);
+  CHROOT_OUT;
+  if (len == -1) {
+    reply_with_perror ("listxattr");
+    goto error;
+  }
+
+  buf = malloc (len);
+  if (buf == NULL) {
+    reply_with_perror ("malloc");
+    goto error;
+  }
+
+  CHROOT_IN;
+  len = listxattr (path, buf, len);
+  CHROOT_OUT;
+  if (len == -1) {
+    reply_with_perror ("listxattr");
+    goto error;
+  }
+
+  r = calloc (1, sizeof (*r));
+  if (r == NULL) {
+    reply_with_perror ("malloc");
+    goto error;
+  }
+
+  /* What we get from the kernel is a string "foo\0bar\0baz" of length
+   * len.  First count the strings.
+   */
+  r->guestfs_int_xattr_list_len = 0;
+  for (i = 0; i < len; i += strlen (&buf[i]) + 1)
+    r->guestfs_int_xattr_list_len++;
+
+  r->guestfs_int_xattr_list_val =
+    calloc (r->guestfs_int_xattr_list_len, sizeof (guestfs_int_xattr));
+  if (r->guestfs_int_xattr_list_val == NULL) {
+    reply_with_perror ("calloc");
+    goto error;
+  }
+
+  for (i = 0, j = 0; i < len; i += strlen (&buf[i]) + 1, ++j) {
+    CHROOT_IN;
+    vlen = getxattr (path, &buf[i], NULL, 0);
+    CHROOT_OUT;
+    if (vlen == -1) {
+      reply_with_perror ("getxattr");
+      goto error;
+    }
+
+    r->guestfs_int_xattr_list_val[j].attrname = strdup (&buf[i]);
+    r->guestfs_int_xattr_list_val[j].attrval.attrval_val = malloc (vlen);
+    r->guestfs_int_xattr_list_val[j].attrval.attrval_len = vlen;
+
+    if (r->guestfs_int_xattr_list_val[j].attrname == NULL ||
+	r->guestfs_int_xattr_list_val[j].attrval.attrval_val == NULL) {
+      reply_with_perror ("malloc");
+      goto error;
+    }
+
+    CHROOT_IN;
+    vlen = getxattr (path, &buf[i],
+		     r->guestfs_int_xattr_list_val[j].attrval.attrval_val,
+		     vlen);
+    CHROOT_OUT;
+    if (vlen == -1) {
+      reply_with_perror ("getxattr");
+      goto error;
+    }
+  }
+
+  free (buf);
+
+  return r;
+
+ error:
+  free (buf);
+  if (r) {
+    if (r->guestfs_int_xattr_list_val)
+      for (i = 0; i < r->guestfs_int_xattr_list_len; ++i) {
+	free (r->guestfs_int_xattr_list_val[i].attrname);
+	free (r->guestfs_int_xattr_list_val[i].attrval.attrval_val);
+      }
+    free (r->guestfs_int_xattr_list_val);
+  }
+  free (r);
+  return NULL;
+}
+
+static int
+_setxattr (char *xattr, char *val, int vallen, char *path,
+	   int (*setxattr) (const char *path, const char *name,
+			    const void *value, size_t size, int flags))
+{
+  int r;
+
+  CHROOT_IN;
+  r = setxattr (path, xattr, val, vallen, 0);
+  CHROOT_OUT;
+  if (r == -1) {
+    reply_with_perror ("setxattr");
+    return -1;
+  }
+
+  return 0;
+}
+
+static int
+_removexattr (char *xattr, char *path,
+	      int (*removexattr) (const char *path, const char *name))
+{
+  int r;
+
+  CHROOT_IN;
+  r = removexattr (path, xattr);
+  CHROOT_OUT;
+  if (r == -1) {
+    reply_with_perror ("removexattr");
+    return -1;
+  }
+
+  return 0;
+}
+
+#else /* no xattr.h */
+
+guestfs_int_xattr_list *
+do_getxattrs (char *path)
+{
+  reply_with_error ("getxattrs: no support for xattrs");
+  return NULL;
+}
+
+guestfs_int_xattr_list *
+do_lgetxattrs (char *path)
+{
+  reply_with_error ("lgetxattrs: no support for xattrs");
+  return NULL;
+}
+
+int
+do_setxattr (char *xattr, char *val, int vallen, char *path)
+{
+  reply_with_error ("setxattr: no support for xattrs");
+  return -1;
+}
+
+int
+do_lsetxattr (char *xattr, char *val, int vallen, char *path)
+{
+  reply_with_error ("lsetxattr: no support for xattrs");
+  return -1;
+}
+
+int
+do_removexattr (char *xattr, char *path)
+{
+  reply_with_error ("removexattr: no support for xattrs");
+  return -1;
+}
+
+int
+do_lremovexattr (char *xattr, char *path)
+{
+  reply_with_error ("lremovexattr: no support for xattrs");
+  return -1;
+}
+
+#endif /* no xattr.h */
diff --git a/inspector/Makefile.am b/df/Makefile.am
similarity index 66%
copy from inspector/Makefile.am
copy to df/Makefile.am
index a1df2ab..4ff2fb1 100644
--- a/inspector/Makefile.am
+++ b/df/Makefile.am
@@ -1,4 +1,4 @@
-# libguestfs virt-inspector
+# libguestfs virt-df
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -16,33 +16,33 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 EXTRA_DIST = \
-	run-inspector-locally \
-	virt-inspector.pl
+	run-df-locally \
+	virt-df.pl
 
-if HAVE_INSPECTOR
+if HAVE_DF
 
-man_MANS = virt-inspector.1
+man_MANS = virt-df.1
 
-noinst_DATA = @top_builddir@/html/virt-inspector.1.html
+noinst_DATA = @top_builddir@/html/virt-df.1.html
 
-virt-inspector.1: virt-inspector.pl
+virt-df.1: virt-df.pl
 	$(POD2MAN) \
 	  --section 1 \
 	  -c "Virtualization Support" \
 	  --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
 	  $< > $@
 
- at top_builddir@/html/virt-inspector.1.html: virt-inspector.pl
+ at top_builddir@/html/virt-df.1.html: virt-df.pl
 	mkdir -p @top_builddir@/html
 	cd @top_builddir@ && pod2html \
 	  --css 'pod.css' \
-	  --title 'virt-inspector, display OS version, kernel, drivers, mount points, applications, etc. in a virtual machine' \
+	  --title 'virt-df, display free space on virtual filesystems' \
 	  --htmldir html \
-	  --outfile html/virt-inspector.1.html \
-	  inspector/$<
+	  --outfile html/virt-df.1.html \
+	  df/$<
 
 install-data-hook:
 	mkdir -p $(DESTDIR)$(bindir)
-	install -m 0755 virt-inspector.pl $(DESTDIR)$(bindir)/virt-inspector
+	install -m 0755 virt-df.pl $(DESTDIR)$(bindir)/virt-df
 
 endif
diff --git a/inspector/Makefile.in b/df/Makefile.in
similarity index 69%
copy from inspector/Makefile.in
copy to df/Makefile.in
index fa379e6..3ec11dd 100644
--- a/inspector/Makefile.in
+++ b/df/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,7 +15,7 @@
 
 @SET_MAKE@
 
-# libguestfs virt-inspector
+# libguestfs virt-df
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -33,8 +34,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -49,7 +51,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-subdir = inspector
+subdir = df
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
@@ -65,8 +67,30 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
@@ -249,11 +273,11 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = \
-	run-inspector-locally \
-	virt-inspector.pl
+	run-df-locally \
+	virt-df.pl
 
- at HAVE_INSPECTOR_TRUE@man_MANS = virt-inspector.1
- at HAVE_INSPECTOR_TRUE@noinst_DATA = @top_builddir@/html/virt-inspector.1.html
+ at HAVE_DF_TRUE@man_MANS = virt-df.1
+ at HAVE_DF_TRUE@noinst_DATA = @top_builddir@/html/virt-df.1.html
 all: all-am
 
 .SUFFIXES:
@@ -266,9 +290,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  inspector/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  inspector/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign df/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign df/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -286,57 +310,51 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 mostlyclean-libtool:
 	-rm -f *.lo
 
 clean-libtool:
 	-rm -rf .libs _libs
-install-man1: $(man1_MANS) $(man_MANS)
+install-man1: $(man_MANS)
 	@$(NORMAL_INSTALL)
 	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.1*) list="$$list $$i" ;; \
-	  esac; \
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+	  fi; \
 	done; \
-	for i in $$list; do \
-	  if test -f $$i; then file=$$i; \
-	  else file=$(srcdir)/$$i; fi; \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    1*) ;; \
-	    *) ext='1' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
-	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
-	done
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+	done; }
+
 uninstall-man1:
 	@$(NORMAL_UNINSTALL)
-	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.1*) list="$$list $$i" ;; \
-	  esac; \
-	done; \
-	for i in $$list; do \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    1*) ;; \
-	    *) ext='1' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
-	  rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
-	done
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
 tags: TAGS
 TAGS:
 
@@ -345,6 +363,19 @@ CTAGS:
 
 
 distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -360,13 +391,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -397,11 +432,12 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
- at HAVE_INSPECTOR_FALSE@install-data-hook:
+ at HAVE_DF_FALSE@install-data-hook:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool mostlyclean-am
@@ -416,6 +452,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -423,21 +461,30 @@ info-am:
 install-data-am: install-man
 	@$(NORMAL_INSTALL)
 	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man: install-man1
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -475,25 +522,26 @@ uninstall-man: uninstall-man1
 	ps ps-am uninstall uninstall-am uninstall-man uninstall-man1
 
 
- at HAVE_INSPECTOR_TRUE@virt-inspector.1: virt-inspector.pl
- at HAVE_INSPECTOR_TRUE@	$(POD2MAN) \
- at HAVE_INSPECTOR_TRUE@	  --section 1 \
- at HAVE_INSPECTOR_TRUE@	  -c "Virtualization Support" \
- at HAVE_INSPECTOR_TRUE@	  --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
- at HAVE_INSPECTOR_TRUE@	  $< > $@
-
- at HAVE_INSPECTOR_TRUE@@top_builddir@/html/virt-inspector.1.html: virt-inspector.pl
- at HAVE_INSPECTOR_TRUE@	mkdir -p @top_builddir@/html
- at HAVE_INSPECTOR_TRUE@	cd @top_builddir@ && pod2html \
- at HAVE_INSPECTOR_TRUE@	  --css 'pod.css' \
- at HAVE_INSPECTOR_TRUE@	  --title 'virt-inspector, display OS version, kernel, drivers, mount points, applications, etc. in a virtual machine' \
- at HAVE_INSPECTOR_TRUE@	  --htmldir html \
- at HAVE_INSPECTOR_TRUE@	  --outfile html/virt-inspector.1.html \
- at HAVE_INSPECTOR_TRUE@	  inspector/$<
-
- at HAVE_INSPECTOR_TRUE@install-data-hook:
- at HAVE_INSPECTOR_TRUE@	mkdir -p $(DESTDIR)$(bindir)
- at HAVE_INSPECTOR_TRUE@	install -m 0755 virt-inspector.pl $(DESTDIR)$(bindir)/virt-inspector
+ at HAVE_DF_TRUE@virt-df.1: virt-df.pl
+ at HAVE_DF_TRUE@	$(POD2MAN) \
+ at HAVE_DF_TRUE@	  --section 1 \
+ at HAVE_DF_TRUE@	  -c "Virtualization Support" \
+ at HAVE_DF_TRUE@	  --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
+ at HAVE_DF_TRUE@	  $< > $@
+
+ at HAVE_DF_TRUE@@top_builddir@/html/virt-df.1.html: virt-df.pl
+ at HAVE_DF_TRUE@	mkdir -p @top_builddir@/html
+ at HAVE_DF_TRUE@	cd @top_builddir@ && pod2html \
+ at HAVE_DF_TRUE@	  --css 'pod.css' \
+ at HAVE_DF_TRUE@	  --title 'virt-df, display free space on virtual filesystems' \
+ at HAVE_DF_TRUE@	  --htmldir html \
+ at HAVE_DF_TRUE@	  --outfile html/virt-df.1.html \
+ at HAVE_DF_TRUE@	  df/$<
+
+ at HAVE_DF_TRUE@install-data-hook:
+ at HAVE_DF_TRUE@	mkdir -p $(DESTDIR)$(bindir)
+ at HAVE_DF_TRUE@	install -m 0755 virt-df.pl $(DESTDIR)$(bindir)/virt-df
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/inspector/run-inspector-locally b/df/run-df-locally
similarity index 86%
copy from inspector/run-inspector-locally
copy to df/run-df-locally
index 156f3ae..3557443 100755
--- a/inspector/run-inspector-locally
+++ b/df/run-df-locally
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# libguestfs inspector
+# virt-df
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -16,12 +16,12 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-# This script sets up the environment so you can run virt-inspector in place
-# without needing to do 'make install' first. You can also run virt-inspector
+# This script sets up the environment so you can run virt-df in place
+# without needing to do 'make install' first. You can also run virt-df
 # by creating a symlink to this script and putting it in your path.
 #
 # Use it like this:
-#   ./run-inspector-locally [usual virt-inspector args ...]
+#   ./run-df-locally [usual virt-df args ...]
 
 use strict;
 use warnings;
@@ -49,4 +49,4 @@ $ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
 $ENV{LIBGUESTFS_PATH} = $path.'/appliance';
 $ENV{PERL5LIB}        = $path.'/perl/blib/lib:'.$path.'/perl/blib/arch';
 
-exec('perl', $path.'/inspector/virt-inspector.pl', @ARGV);
+exec('perl', $path.'/df/virt-df.pl', @ARGV);
diff --git a/df/virt-df.pl b/df/virt-df.pl
new file mode 100755
index 0000000..4cac896
--- /dev/null
+++ b/df/virt-df.pl
@@ -0,0 +1,342 @@
+#!/usr/bin/perl -w
+# virt-df
+# Copyright (C) 2009 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+use warnings;
+use strict;
+
+use Sys::Guestfs;
+use Sys::Guestfs::Lib qw(open_guest get_partitions resolve_windows_path
+  inspect_all_partitions inspect_partition
+  inspect_operating_systems mount_operating_system inspect_in_detail);
+use Pod::Usage;
+use Getopt::Long;
+use Data::Dumper;
+use File::Temp qw/tempdir/;
+use XML::Writer;
+use Locale::TextDomain 'libguestfs';
+
+=encoding utf8
+
+=head1 NAME
+
+virt-df - Display free space on virtual filesystems
+
+=head1 SYNOPSIS
+
+ virt-df [--options]
+
+ virt-df [--options] domname
+
+ virt-df [--options] disk.img [disk.img ...]
+
+=head1 DESCRIPTION
+
+C<virt-df> is a command line tool to display free space on virtual
+machine filesystems.  Unlike other tools, it doesn't just display the
+amount of space allocated to a virtual machine, but can look inside
+the virtual machine to see how much space is really being used.
+
+It is like the L<df(1)> command, but for virtual machines, except that
+it also works for Windows virtual machines.
+
+If used without any arguments, C<virt-df> checks with libvirt to get a
+list of all active and inactive guests, and performs a C<df>-type
+operation on each one in turn, printing out the results.
+
+If used with any argument(s), C<virt-df> performs a C<df>-type
+operation on either the single named libvirt domain, or on the disk
+image(s) listed on the command line (which must all belong to a single
+VM).  In this mode (with arguments), C<virt-df> will I<only work for a
+single guest>.  If you want to run on multiple guests, then you have
+to invoke C<virt-df> multiple times.
+
+Use the C<--csv> option to get a format which can be easily parsed by
+other programs.  Other options are mostly similar to standard C<df>
+options.  See below for the complete list.
+
+=head1 OPTIONS
+
+=over 4
+
+=cut
+
+my $help;
+
+=item B<--help>
+
+Display brief help.
+
+=cut
+
+my $version;
+
+=item B<--version>
+
+Display version number and exit.
+
+=cut
+
+my $uri;
+
+=item B<--connect URI> | B<-c URI>
+
+If using libvirt, connect to the given I<URI>.  If omitted, then we
+connect to the default libvirt hypervisor.
+
+If you specify guest block devices directly, then libvirt is not used
+at all.
+
+=cut
+
+my $csv;
+
+=item B<--csv>
+
+Write out the results in CSV format (comma-separated values).
+This format can be imported easily into databases and spreadsheets.
+
+=cut
+
+my $human;
+
+=item B<--human-readable> | B<-h>
+
+Print sizes in human-readable format.
+
+=cut
+
+my $inodes;
+
+=item B<--inodes> | B<-i>
+
+Print inodes instead of blocks.
+
+=back
+
+=cut
+
+GetOptions ("help|?" => \$help,
+	    "version" => \$version,
+	    "connect|c=s" => \$uri,
+            "csv" => \$csv,
+            "human-readable|human|h" => \$human,
+            "inodes|i" => \$inodes,
+    ) or pod2usage (2);
+pod2usage (1) if $help;
+if ($version) {
+    my $g = Sys::Guestfs->new ();
+    my %h = $g->version ();
+    print "$h{major}.$h{minor}.$h{release}$h{extra}\n";
+    exit
+}
+
+# Open the guest handle.
+
+if (@ARGV == 0) {
+    my $conn;
+
+    if ($uri) {
+	$conn = Sys::Virt->new (readonly => 1, address => $uri);
+    } else {
+	$conn = Sys::Virt->new (readonly => 1);
+    }
+
+    my @doms = $conn->list_defined_domains ();
+    push @doms, $conn->list_domains ();
+
+    my @domnames = map { $_->get_name () } @doms;
+
+    if (@domnames) {
+	print_title ();
+	foreach (@domnames) {
+	    do_df ($_);
+	}
+    }
+} else {
+    print_title ();
+    do_df (@ARGV);
+}
+
+sub do_df
+{
+    my $g;
+
+    if ($uri) {
+	$g = open_guest (\@_, address => $uri);
+    } else {
+	$g = open_guest (\@_);
+    }
+
+    $g->launch ();
+    $g->wait_ready ();
+
+    my @partitions = get_partitions ($g);
+
+    # Think of a printable name for this domain.  Just choose the
+    # first parameter passed to this function, which will work for
+    # most cases (it'll either be the domain name or the first disk
+    # image name).
+    my $domname = $_[0];
+
+    # Mount each partition in turn, and if mountable, do a statvfs on it.
+    foreach my $partition (@partitions) {
+	my %stat;
+	eval {
+	    $g->mount_ro ($partition, "/");
+	    %stat = $g->statvfs ("/");
+	};
+	if (!$@) {
+	    print_stat ($domname, $partition, \%stat);
+	}
+	$g->umount_all ();
+    }
+}
+
+sub print_stat
+{
+    my $domname = shift;
+    my $partition = shift;
+    my $stat = shift;
+
+    my @cols = ($domname, $partition);
+
+    if (!$inodes) {
+	my $bsize = $stat->{bsize};	# block size
+	my $blocks = $stat->{blocks};	# total number of blocks
+	my $bfree = $stat->{bfree};	# blocks free (total)
+	my $bavail = $stat->{bavail};	# blocks free (for non-root users)
+
+	my $factor = $bsize / 1024;
+
+	push @cols, $blocks*$factor;	# total 1K blocks
+	push @cols, ($blocks-$bfree)*$factor; # total 1K blocks used
+	push @cols, $bavail*$factor;	# total 1K blocks available
+
+	# XXX %used column comes out different from the native 'df'
+	# program.  Need to check how 'df' calculates this.
+	push @cols, 100.0 - 100.0 * $bavail / $blocks;
+
+	if ($human) {
+	    $cols[2] = human_size ($cols[2]);
+	    $cols[3] = human_size ($cols[3]);
+	    $cols[4] = human_size ($cols[4]);
+	}
+    } else {
+	my $files = $stat->{files};	# total number of inodes
+	my $ffree = $stat->{ffree};	# inodes free (total)
+	my $favail = $stat->{favail};	# inodes free (for non-root users)
+
+	push @cols, $files;
+	push @cols, $files-$ffree;
+	push @cols, $ffree;
+
+	# XXX %used column comes out different from the native 'df'
+	# program.  Need to check how 'df' calculates this.
+	push @cols, 100.0 - 100.0 * $favail / $files;
+    }
+
+    print_cols (@cols);
+}
+
+sub print_title
+{
+    my @cols = (__"Virtual Machine", __"Filesystem");
+    if (!$inodes) {
+	if (!$human) {
+	    push @cols, __"1K-blocks";
+	} else {
+	    push @cols, __"Size";
+	}
+	push @cols, __"Used";
+	push @cols, __"Available";
+	push @cols, __"Use%";
+    } else {
+	push @cols, __"Inodes";
+	push @cols, __"IUsed";
+	push @cols, __"IFree";
+	push @cols, __"IUse%";
+    }
+
+    if (!$csv) {
+	# ignore $cols[0] in this mode
+	printf "%-36s%10s %10s %10s %5s\n",
+	  $cols[1], $cols[2], $cols[3], $cols[4], $cols[5];
+    } else {
+	print (join (",", @cols), "\n");
+    }
+}
+
+sub print_cols
+{
+    if (!$csv) {
+	my $label = sprintf "%s:%s", $_[0], $_[1];
+
+	printf ("%-36s", $label);
+	print "\n"," "x32 if length ($label) > 36;
+
+	my $percent = sprintf "%3.1f%%", $_[5];
+	printf ("%10s %10s %10s %5s\n", $_[2], $_[3], $_[4], $percent);
+    } else {
+	printf ("\"%s\",\"%s\",%d,%d,%d,%.1f%%\n", @_);
+    }
+}
+
+# Convert a number of 1K blocks to a human-readable number.
+sub human_size
+{
+    local $_ = shift;
+
+    if ($_ < 1024) {
+	sprintf "%dK", $_;
+    } elsif ($_ < 1024 * 1024) {
+	sprintf "%.1fM", ($_ / 1024);
+    } else {
+	sprintf "%.1fG", ($_ / 1024 / 1024);
+    }
+}
+
+=head1 SEE ALSO
+
+L<guestfs(3)>,
+L<guestfish(1)>,
+L<Sys::Guestfs(3)>,
+L<Sys::Guestfs::Lib(3)>,
+L<Sys::Virt(3)>,
+L<http://libguestfs.org/>.
+
+=head1 AUTHOR
+
+Richard W.M. Jones L<http://et.redhat.com/~rjones/>
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009 Red Hat Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
diff --git a/examples/Makefile.in b/examples/Makefile.in
index 0ef9340..849a606 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -18,8 +19,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -51,6 +53,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 PROGRAMS = $(noinst_PROGRAMS)
 am_hello_OBJECTS = hello-hello.$(OBJEXT)
 hello_OBJECTS = $(am_hello_OBJECTS)
@@ -67,6 +70,7 @@ to_xml_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -276,9 +280,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  examples/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  examples/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign examples/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -296,13 +300,16 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 clean-noinstPROGRAMS:
-	@list='$(noinst_PROGRAMS)'; for p in $$list; do \
-	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  echo " rm -f $$p $$f"; \
-	  rm -f $$p $$f ; \
-	done
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
 hello$(EXEEXT): $(hello_OBJECTS) $(hello_DEPENDENCIES) 
 	@rm -f hello$(EXEEXT)
 	$(hello_LINK) $(hello_OBJECTS) $(hello_LDADD) $(LIBS)
@@ -321,49 +328,49 @@ distclean-compile:
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
 hello-hello.o: hello.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hello_CFLAGS) $(CFLAGS) -MT hello-hello.o -MD -MP -MF $(DEPDIR)/hello-hello.Tpo -c -o hello-hello.o `test -f 'hello.c' || echo '$(srcdir)/'`hello.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/hello-hello.Tpo $(DEPDIR)/hello-hello.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/hello-hello.Tpo $(DEPDIR)/hello-hello.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='hello.c' object='hello-hello.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hello_CFLAGS) $(CFLAGS) -c -o hello-hello.o `test -f 'hello.c' || echo '$(srcdir)/'`hello.c
 
 hello-hello.obj: hello.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hello_CFLAGS) $(CFLAGS) -MT hello-hello.obj -MD -MP -MF $(DEPDIR)/hello-hello.Tpo -c -o hello-hello.obj `if test -f 'hello.c'; then $(CYGPATH_W) 'hello.c'; else $(CYGPATH_W) '$(srcdir)/hello.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/hello-hello.Tpo $(DEPDIR)/hello-hello.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/hello-hello.Tpo $(DEPDIR)/hello-hello.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='hello.c' object='hello-hello.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(hello_CFLAGS) $(CFLAGS) -c -o hello-hello.obj `if test -f 'hello.c'; then $(CYGPATH_W) 'hello.c'; else $(CYGPATH_W) '$(srcdir)/hello.c'; fi`
 
 to_xml-to-xml.o: to-xml.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(to_xml_CFLAGS) $(CFLAGS) -MT to_xml-to-xml.o -MD -MP -MF $(DEPDIR)/to_xml-to-xml.Tpo -c -o to_xml-to-xml.o `test -f 'to-xml.c' || echo '$(srcdir)/'`to-xml.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/to_xml-to-xml.Tpo $(DEPDIR)/to_xml-to-xml.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/to_xml-to-xml.Tpo $(DEPDIR)/to_xml-to-xml.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='to-xml.c' object='to_xml-to-xml.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(to_xml_CFLAGS) $(CFLAGS) -c -o to_xml-to-xml.o `test -f 'to-xml.c' || echo '$(srcdir)/'`to-xml.c
 
 to_xml-to-xml.obj: to-xml.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(to_xml_CFLAGS) $(CFLAGS) -MT to_xml-to-xml.obj -MD -MP -MF $(DEPDIR)/to_xml-to-xml.Tpo -c -o to_xml-to-xml.obj `if test -f 'to-xml.c'; then $(CYGPATH_W) 'to-xml.c'; else $(CYGPATH_W) '$(srcdir)/to-xml.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/to_xml-to-xml.Tpo $(DEPDIR)/to_xml-to-xml.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/to_xml-to-xml.Tpo $(DEPDIR)/to_xml-to-xml.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='to-xml.c' object='to_xml-to-xml.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(to_xml_CFLAGS) $(CFLAGS) -c -o to_xml-to-xml.obj `if test -f 'to-xml.c'; then $(CYGPATH_W) 'to-xml.c'; else $(CYGPATH_W) '$(srcdir)/to-xml.c'; fi`
@@ -386,7 +393,7 @@ tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
@@ -394,29 +401,34 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -437,13 +449,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -472,6 +488,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -493,6 +510,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -501,18 +520,28 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -550,6 +579,7 @@ uninstall-am:
 	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
 	pdf pdf-am ps ps-am tags uninstall uninstall-am
 
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/fish/Makefile.am b/fish/Makefile.am
index 1439a5d..9ec0cf4 100644
--- a/fish/Makefile.am
+++ b/fish/Makefile.am
@@ -17,6 +17,9 @@
 
 bin_PROGRAMS = guestfish
 
+EXTRA_DIST = \
+	rc_protocol.x
+
 guestfish_SOURCES = \
 	alloc.c \
 	cmds.c \
@@ -29,9 +32,30 @@ guestfish_SOURCES = \
 	glob.c \
 	lcd.c \
 	more.c \
+	rc.c \
+	rc_protocol.c \
+	rc_protocol.h \
+	reopen.c \
+	tilde.c \
 	time.c
 
+BUILT_SOURCES = \
+	rc_protocol.c \
+	rc_protocol.h
+
 guestfish_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src -Wall \
 	-DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"'
 guestfish_LDADD = $(top_builddir)/src/libguestfs.la $(LIBREADLINE)
+
+if HAVE_RPCGEN
+rc_protocol.c: rc_protocol.x
+	rm -f $@-t
+	$(RPCGEN) -c -o $@-t $<
+	mv $@-t $@
+
+rc_protocol.h: rc_protocol.x
+	rm -f $@-t
+	$(RPCGEN) -h -o $@-t $<
+	mv $@-t $@
+endif
diff --git a/fish/Makefile.in b/fish/Makefile.in
index a423dc6..f7eaf97 100644
--- a/fish/Makefile.in
+++ b/fish/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -33,8 +34,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -66,15 +68,17 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
 am_guestfish_OBJECTS = guestfish-alloc.$(OBJEXT) \
 	guestfish-cmds.$(OBJEXT) guestfish-completion.$(OBJEXT) \
 	guestfish-destpaths.$(OBJEXT) guestfish-echo.$(OBJEXT) \
 	guestfish-edit.$(OBJEXT) guestfish-fish.$(OBJEXT) \
 	guestfish-glob.$(OBJEXT) guestfish-lcd.$(OBJEXT) \
-	guestfish-more.$(OBJEXT) guestfish-time.$(OBJEXT)
+	guestfish-more.$(OBJEXT) guestfish-rc.$(OBJEXT) \
+	guestfish-rc_protocol.$(OBJEXT) guestfish-reopen.$(OBJEXT) \
+	guestfish-tilde.$(OBJEXT) guestfish-time.$(OBJEXT)
 guestfish_OBJECTS = $(am_guestfish_OBJECTS)
 am__DEPENDENCIES_1 =
 guestfish_DEPENDENCIES = $(top_builddir)/src/libguestfs.la \
@@ -85,6 +89,7 @@ guestfish_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -274,6 +279,9 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+	rc_protocol.x
+
 guestfish_SOURCES = \
 	alloc.c \
 	cmds.c \
@@ -286,14 +294,24 @@ guestfish_SOURCES = \
 	glob.c \
 	lcd.c \
 	more.c \
+	rc.c \
+	rc_protocol.c \
+	rc_protocol.h \
+	reopen.c \
+	tilde.c \
 	time.c
 
+BUILT_SOURCES = \
+	rc_protocol.c \
+	rc_protocol.h
+
 guestfish_CFLAGS = \
 	-I$(top_srcdir)/src -I$(top_builddir)/src -Wall \
 	-DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"'
 
 guestfish_LDADD = $(top_builddir)/src/libguestfs.la $(LIBREADLINE)
-all: all-am
+all: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
 .SUFFIXES: .c .lo .o .obj
@@ -306,9 +324,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  fish/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  fish/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign fish/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign fish/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -326,34 +344,50 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
 	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
-	@list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  if test -f $$p \
-	     || test -f $$p1 \
-	  ; then \
-	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
-	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
-	  else :; fi; \
-	done
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
 
 uninstall-binPROGRAMS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
-	done
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
 
 clean-binPROGRAMS:
-	@list='$(bin_PROGRAMS)'; for p in $$list; do \
-	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
-	  echo " rm -f $$p $$f"; \
-	  rm -f $$p $$f ; \
-	done
+	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
 guestfish$(EXEEXT): $(guestfish_OBJECTS) $(guestfish_DEPENDENCIES) 
 	@rm -f guestfish$(EXEEXT)
 	$(guestfish_LINK) $(guestfish_OBJECTS) $(guestfish_LDADD) $(LIBS)
@@ -374,179 +408,239 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfish-glob.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfish-lcd.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfish-more.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfish-rc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfish-rc_protocol.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfish-reopen.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfish-tilde.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/guestfish-time.Po at am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
 guestfish-alloc.o: alloc.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-alloc.o -MD -MP -MF $(DEPDIR)/guestfish-alloc.Tpo -c -o guestfish-alloc.o `test -f 'alloc.c' || echo '$(srcdir)/'`alloc.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-alloc.Tpo $(DEPDIR)/guestfish-alloc.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-alloc.Tpo $(DEPDIR)/guestfish-alloc.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='alloc.c' object='guestfish-alloc.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-alloc.o `test -f 'alloc.c' || echo '$(srcdir)/'`alloc.c
 
 guestfish-alloc.obj: alloc.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-alloc.obj -MD -MP -MF $(DEPDIR)/guestfish-alloc.Tpo -c -o guestfish-alloc.obj `if test -f 'alloc.c'; then $(CYGPATH_W) 'alloc.c'; else $(CYGPATH_W) '$(srcdir)/alloc.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-alloc.Tpo $(DEPDIR)/guestfish-alloc.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-alloc.Tpo $(DEPDIR)/guestfish-alloc.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='alloc.c' object='guestfish-alloc.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-alloc.obj `if test -f 'alloc.c'; then $(CYGPATH_W) 'alloc.c'; else $(CYGPATH_W) '$(srcdir)/alloc.c'; fi`
 
 guestfish-cmds.o: cmds.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-cmds.o -MD -MP -MF $(DEPDIR)/guestfish-cmds.Tpo -c -o guestfish-cmds.o `test -f 'cmds.c' || echo '$(srcdir)/'`cmds.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-cmds.Tpo $(DEPDIR)/guestfish-cmds.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-cmds.Tpo $(DEPDIR)/guestfish-cmds.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cmds.c' object='guestfish-cmds.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-cmds.o `test -f 'cmds.c' || echo '$(srcdir)/'`cmds.c
 
 guestfish-cmds.obj: cmds.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-cmds.obj -MD -MP -MF $(DEPDIR)/guestfish-cmds.Tpo -c -o guestfish-cmds.obj `if test -f 'cmds.c'; then $(CYGPATH_W) 'cmds.c'; else $(CYGPATH_W) '$(srcdir)/cmds.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-cmds.Tpo $(DEPDIR)/guestfish-cmds.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-cmds.Tpo $(DEPDIR)/guestfish-cmds.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cmds.c' object='guestfish-cmds.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-cmds.obj `if test -f 'cmds.c'; then $(CYGPATH_W) 'cmds.c'; else $(CYGPATH_W) '$(srcdir)/cmds.c'; fi`
 
 guestfish-completion.o: completion.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-completion.o -MD -MP -MF $(DEPDIR)/guestfish-completion.Tpo -c -o guestfish-completion.o `test -f 'completion.c' || echo '$(srcdir)/'`completion.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-completion.Tpo $(DEPDIR)/guestfish-completion.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-completion.Tpo $(DEPDIR)/guestfish-completion.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='completion.c' object='guestfish-completion.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-completion.o `test -f 'completion.c' || echo '$(srcdir)/'`completion.c
 
 guestfish-completion.obj: completion.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-completion.obj -MD -MP -MF $(DEPDIR)/guestfish-completion.Tpo -c -o guestfish-completion.obj `if test -f 'completion.c'; then $(CYGPATH_W) 'completion.c'; else $(CYGPATH_W) '$(srcdir)/completion.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-completion.Tpo $(DEPDIR)/guestfish-completion.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-completion.Tpo $(DEPDIR)/guestfish-completion.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='completion.c' object='guestfish-completion.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-completion.obj `if test -f 'completion.c'; then $(CYGPATH_W) 'completion.c'; else $(CYGPATH_W) '$(srcdir)/completion.c'; fi`
 
 guestfish-destpaths.o: destpaths.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-destpaths.o -MD -MP -MF $(DEPDIR)/guestfish-destpaths.Tpo -c -o guestfish-destpaths.o `test -f 'destpaths.c' || echo '$(srcdir)/'`destpaths.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-destpaths.Tpo $(DEPDIR)/guestfish-destpaths.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-destpaths.Tpo $(DEPDIR)/guestfish-destpaths.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='destpaths.c' object='guestfish-destpaths.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-destpaths.o `test -f 'destpaths.c' || echo '$(srcdir)/'`destpaths.c
 
 guestfish-destpaths.obj: destpaths.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-destpaths.obj -MD -MP -MF $(DEPDIR)/guestfish-destpaths.Tpo -c -o guestfish-destpaths.obj `if test -f 'destpaths.c'; then $(CYGPATH_W) 'destpaths.c'; else $(CYGPATH_W) '$(srcdir)/destpaths.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-destpaths.Tpo $(DEPDIR)/guestfish-destpaths.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-destpaths.Tpo $(DEPDIR)/guestfish-destpaths.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='destpaths.c' object='guestfish-destpaths.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-destpaths.obj `if test -f 'destpaths.c'; then $(CYGPATH_W) 'destpaths.c'; else $(CYGPATH_W) '$(srcdir)/destpaths.c'; fi`
 
 guestfish-echo.o: echo.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-echo.o -MD -MP -MF $(DEPDIR)/guestfish-echo.Tpo -c -o guestfish-echo.o `test -f 'echo.c' || echo '$(srcdir)/'`echo.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-echo.Tpo $(DEPDIR)/guestfish-echo.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-echo.Tpo $(DEPDIR)/guestfish-echo.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='echo.c' object='guestfish-echo.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-echo.o `test -f 'echo.c' || echo '$(srcdir)/'`echo.c
 
 guestfish-echo.obj: echo.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-echo.obj -MD -MP -MF $(DEPDIR)/guestfish-echo.Tpo -c -o guestfish-echo.obj `if test -f 'echo.c'; then $(CYGPATH_W) 'echo.c'; else $(CYGPATH_W) '$(srcdir)/echo.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-echo.Tpo $(DEPDIR)/guestfish-echo.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-echo.Tpo $(DEPDIR)/guestfish-echo.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='echo.c' object='guestfish-echo.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-echo.obj `if test -f 'echo.c'; then $(CYGPATH_W) 'echo.c'; else $(CYGPATH_W) '$(srcdir)/echo.c'; fi`
 
 guestfish-edit.o: edit.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-edit.o -MD -MP -MF $(DEPDIR)/guestfish-edit.Tpo -c -o guestfish-edit.o `test -f 'edit.c' || echo '$(srcdir)/'`edit.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-edit.Tpo $(DEPDIR)/guestfish-edit.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-edit.Tpo $(DEPDIR)/guestfish-edit.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='edit.c' object='guestfish-edit.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-edit.o `test -f 'edit.c' || echo '$(srcdir)/'`edit.c
 
 guestfish-edit.obj: edit.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-edit.obj -MD -MP -MF $(DEPDIR)/guestfish-edit.Tpo -c -o guestfish-edit.obj `if test -f 'edit.c'; then $(CYGPATH_W) 'edit.c'; else $(CYGPATH_W) '$(srcdir)/edit.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-edit.Tpo $(DEPDIR)/guestfish-edit.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-edit.Tpo $(DEPDIR)/guestfish-edit.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='edit.c' object='guestfish-edit.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-edit.obj `if test -f 'edit.c'; then $(CYGPATH_W) 'edit.c'; else $(CYGPATH_W) '$(srcdir)/edit.c'; fi`
 
 guestfish-fish.o: fish.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-fish.o -MD -MP -MF $(DEPDIR)/guestfish-fish.Tpo -c -o guestfish-fish.o `test -f 'fish.c' || echo '$(srcdir)/'`fish.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-fish.Tpo $(DEPDIR)/guestfish-fish.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-fish.Tpo $(DEPDIR)/guestfish-fish.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fish.c' object='guestfish-fish.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-fish.o `test -f 'fish.c' || echo '$(srcdir)/'`fish.c
 
 guestfish-fish.obj: fish.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-fish.obj -MD -MP -MF $(DEPDIR)/guestfish-fish.Tpo -c -o guestfish-fish.obj `if test -f 'fish.c'; then $(CYGPATH_W) 'fish.c'; else $(CYGPATH_W) '$(srcdir)/fish.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-fish.Tpo $(DEPDIR)/guestfish-fish.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-fish.Tpo $(DEPDIR)/guestfish-fish.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fish.c' object='guestfish-fish.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-fish.obj `if test -f 'fish.c'; then $(CYGPATH_W) 'fish.c'; else $(CYGPATH_W) '$(srcdir)/fish.c'; fi`
 
 guestfish-glob.o: glob.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-glob.o -MD -MP -MF $(DEPDIR)/guestfish-glob.Tpo -c -o guestfish-glob.o `test -f 'glob.c' || echo '$(srcdir)/'`glob.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-glob.Tpo $(DEPDIR)/guestfish-glob.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-glob.Tpo $(DEPDIR)/guestfish-glob.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='glob.c' object='guestfish-glob.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-glob.o `test -f 'glob.c' || echo '$(srcdir)/'`glob.c
 
 guestfish-glob.obj: glob.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-glob.obj -MD -MP -MF $(DEPDIR)/guestfish-glob.Tpo -c -o guestfish-glob.obj `if test -f 'glob.c'; then $(CYGPATH_W) 'glob.c'; else $(CYGPATH_W) '$(srcdir)/glob.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-glob.Tpo $(DEPDIR)/guestfish-glob.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-glob.Tpo $(DEPDIR)/guestfish-glob.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='glob.c' object='guestfish-glob.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-glob.obj `if test -f 'glob.c'; then $(CYGPATH_W) 'glob.c'; else $(CYGPATH_W) '$(srcdir)/glob.c'; fi`
 
 guestfish-lcd.o: lcd.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-lcd.o -MD -MP -MF $(DEPDIR)/guestfish-lcd.Tpo -c -o guestfish-lcd.o `test -f 'lcd.c' || echo '$(srcdir)/'`lcd.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-lcd.Tpo $(DEPDIR)/guestfish-lcd.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-lcd.Tpo $(DEPDIR)/guestfish-lcd.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='lcd.c' object='guestfish-lcd.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-lcd.o `test -f 'lcd.c' || echo '$(srcdir)/'`lcd.c
 
 guestfish-lcd.obj: lcd.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-lcd.obj -MD -MP -MF $(DEPDIR)/guestfish-lcd.Tpo -c -o guestfish-lcd.obj `if test -f 'lcd.c'; then $(CYGPATH_W) 'lcd.c'; else $(CYGPATH_W) '$(srcdir)/lcd.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-lcd.Tpo $(DEPDIR)/guestfish-lcd.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-lcd.Tpo $(DEPDIR)/guestfish-lcd.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='lcd.c' object='guestfish-lcd.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-lcd.obj `if test -f 'lcd.c'; then $(CYGPATH_W) 'lcd.c'; else $(CYGPATH_W) '$(srcdir)/lcd.c'; fi`
 
 guestfish-more.o: more.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-more.o -MD -MP -MF $(DEPDIR)/guestfish-more.Tpo -c -o guestfish-more.o `test -f 'more.c' || echo '$(srcdir)/'`more.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-more.Tpo $(DEPDIR)/guestfish-more.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-more.Tpo $(DEPDIR)/guestfish-more.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='more.c' object='guestfish-more.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-more.o `test -f 'more.c' || echo '$(srcdir)/'`more.c
 
 guestfish-more.obj: more.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-more.obj -MD -MP -MF $(DEPDIR)/guestfish-more.Tpo -c -o guestfish-more.obj `if test -f 'more.c'; then $(CYGPATH_W) 'more.c'; else $(CYGPATH_W) '$(srcdir)/more.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-more.Tpo $(DEPDIR)/guestfish-more.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-more.Tpo $(DEPDIR)/guestfish-more.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='more.c' object='guestfish-more.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-more.obj `if test -f 'more.c'; then $(CYGPATH_W) 'more.c'; else $(CYGPATH_W) '$(srcdir)/more.c'; fi`
 
+guestfish-rc.o: rc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-rc.o -MD -MP -MF $(DEPDIR)/guestfish-rc.Tpo -c -o guestfish-rc.o `test -f 'rc.c' || echo '$(srcdir)/'`rc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-rc.Tpo $(DEPDIR)/guestfish-rc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='rc.c' object='guestfish-rc.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-rc.o `test -f 'rc.c' || echo '$(srcdir)/'`rc.c
+
+guestfish-rc.obj: rc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-rc.obj -MD -MP -MF $(DEPDIR)/guestfish-rc.Tpo -c -o guestfish-rc.obj `if test -f 'rc.c'; then $(CYGPATH_W) 'rc.c'; else $(CYGPATH_W) '$(srcdir)/rc.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-rc.Tpo $(DEPDIR)/guestfish-rc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='rc.c' object='guestfish-rc.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-rc.obj `if test -f 'rc.c'; then $(CYGPATH_W) 'rc.c'; else $(CYGPATH_W) '$(srcdir)/rc.c'; fi`
+
+guestfish-rc_protocol.o: rc_protocol.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-rc_protocol.o -MD -MP -MF $(DEPDIR)/guestfish-rc_protocol.Tpo -c -o guestfish-rc_protocol.o `test -f 'rc_protocol.c' || echo '$(srcdir)/'`rc_protocol.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-rc_protocol.Tpo $(DEPDIR)/guestfish-rc_protocol.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='rc_protocol.c' object='guestfish-rc_protocol.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-rc_protocol.o `test -f 'rc_protocol.c' || echo '$(srcdir)/'`rc_protocol.c
+
+guestfish-rc_protocol.obj: rc_protocol.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-rc_protocol.obj -MD -MP -MF $(DEPDIR)/guestfish-rc_protocol.Tpo -c -o guestfish-rc_protocol.obj `if test -f 'rc_protocol.c'; then $(CYGPATH_W) 'rc_protocol.c'; else $(CYGPATH_W) '$(srcdir)/rc_protocol.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-rc_protocol.Tpo $(DEPDIR)/guestfish-rc_protocol.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='rc_protocol.c' object='guestfish-rc_protocol.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-rc_protocol.obj `if test -f 'rc_protocol.c'; then $(CYGPATH_W) 'rc_protocol.c'; else $(CYGPATH_W) '$(srcdir)/rc_protocol.c'; fi`
+
+guestfish-reopen.o: reopen.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-reopen.o -MD -MP -MF $(DEPDIR)/guestfish-reopen.Tpo -c -o guestfish-reopen.o `test -f 'reopen.c' || echo '$(srcdir)/'`reopen.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-reopen.Tpo $(DEPDIR)/guestfish-reopen.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='reopen.c' object='guestfish-reopen.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-reopen.o `test -f 'reopen.c' || echo '$(srcdir)/'`reopen.c
+
+guestfish-reopen.obj: reopen.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-reopen.obj -MD -MP -MF $(DEPDIR)/guestfish-reopen.Tpo -c -o guestfish-reopen.obj `if test -f 'reopen.c'; then $(CYGPATH_W) 'reopen.c'; else $(CYGPATH_W) '$(srcdir)/reopen.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-reopen.Tpo $(DEPDIR)/guestfish-reopen.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='reopen.c' object='guestfish-reopen.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-reopen.obj `if test -f 'reopen.c'; then $(CYGPATH_W) 'reopen.c'; else $(CYGPATH_W) '$(srcdir)/reopen.c'; fi`
+
+guestfish-tilde.o: tilde.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-tilde.o -MD -MP -MF $(DEPDIR)/guestfish-tilde.Tpo -c -o guestfish-tilde.o `test -f 'tilde.c' || echo '$(srcdir)/'`tilde.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-tilde.Tpo $(DEPDIR)/guestfish-tilde.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tilde.c' object='guestfish-tilde.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-tilde.o `test -f 'tilde.c' || echo '$(srcdir)/'`tilde.c
+
+guestfish-tilde.obj: tilde.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-tilde.obj -MD -MP -MF $(DEPDIR)/guestfish-tilde.Tpo -c -o guestfish-tilde.obj `if test -f 'tilde.c'; then $(CYGPATH_W) 'tilde.c'; else $(CYGPATH_W) '$(srcdir)/tilde.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-tilde.Tpo $(DEPDIR)/guestfish-tilde.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='tilde.c' object='guestfish-tilde.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-tilde.obj `if test -f 'tilde.c'; then $(CYGPATH_W) 'tilde.c'; else $(CYGPATH_W) '$(srcdir)/tilde.c'; fi`
+
 guestfish-time.o: time.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-time.o -MD -MP -MF $(DEPDIR)/guestfish-time.Tpo -c -o guestfish-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-time.Tpo $(DEPDIR)/guestfish-time.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-time.Tpo $(DEPDIR)/guestfish-time.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='time.c' object='guestfish-time.o' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-time.o `test -f 'time.c' || echo '$(srcdir)/'`time.c
 
 guestfish-time.obj: time.c
 @am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -MT guestfish-time.obj -MD -MP -MF $(DEPDIR)/guestfish-time.Tpo -c -o guestfish-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/guestfish-time.Tpo $(DEPDIR)/guestfish-time.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/guestfish-time.Tpo $(DEPDIR)/guestfish-time.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='time.c' object='guestfish-time.obj' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(guestfish_CFLAGS) $(CFLAGS) -c -o guestfish-time.obj `if test -f 'time.c'; then $(CYGPATH_W) 'time.c'; else $(CYGPATH_W) '$(srcdir)/time.c'; fi`
@@ -569,7 +663,7 @@ tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
@@ -577,29 +671,34 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -620,24 +719,30 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
 check-am: all-am
-check: check-am
+check: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(PROGRAMS)
 installdirs:
 	for dir in "$(DESTDIR)$(bindir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
-install: install-am
+install: $(BUILT_SOURCES)
+	$(MAKE) $(AM_MAKEFLAGS) install-am
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
@@ -657,10 +762,12 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
 clean: clean-am
 
 clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
@@ -677,6 +784,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -685,18 +794,28 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am: install-binPROGRAMS
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -719,7 +838,7 @@ ps-am:
 
 uninstall-am: uninstall-binPROGRAMS
 
-.MAKE: install-am install-strip
+.MAKE: all check install install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
 	clean-generic clean-libtool ctags distclean distclean-compile \
@@ -735,6 +854,17 @@ uninstall-am: uninstall-binPROGRAMS
 	pdf pdf-am ps ps-am tags uninstall uninstall-am \
 	uninstall-binPROGRAMS
 
+
+ at HAVE_RPCGEN_TRUE@rc_protocol.c: rc_protocol.x
+ at HAVE_RPCGEN_TRUE@	rm -f $@-t
+ at HAVE_RPCGEN_TRUE@	$(RPCGEN) -c -o $@-t $<
+ at HAVE_RPCGEN_TRUE@	mv $@-t $@
+
+ at HAVE_RPCGEN_TRUE@rc_protocol.h: rc_protocol.x
+ at HAVE_RPCGEN_TRUE@	rm -f $@-t
+ at HAVE_RPCGEN_TRUE@	$(RPCGEN) -h -o $@-t $<
+ at HAVE_RPCGEN_TRUE@	mv $@-t $@
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/fish/cmds.c b/fish/cmds.c
index ead91bf..562496c 100644
--- a/fish/cmds.c
+++ b/fish/cmds.c
@@ -23,6 +23,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <inttypes.h>
+#include <ctype.h>
 
 #include <guestfs.h>
 #include "fish.h"
@@ -89,6 +90,7 @@ void list_commands (void)
   printf ("%-20s %s\n", "get-qemu", "get the qemu binary");
   printf ("%-20s %s\n", "get-state", "get the current state");
   printf ("%-20s %s\n", "get-verbose", "get verbose mode");
+  printf ("%-20s %s\n", "getxattrs", "list extended attributes of a file or directory");
   printf ("%-20s %s\n", "glob-expand", "expand a wildcard path");
   printf ("%-20s %s\n", "grub-install", "install GRUB");
   printf ("%-20s %s\n", "head", "return first 10 lines of a file");
@@ -103,10 +105,13 @@ void list_commands (void)
   printf ("%-20s %s\n", "is-ready", "is ready to accept commands");
   printf ("%-20s %s\n", "kill-subprocess", "kill the qemu subprocess");
   printf ("%-20s %s\n", "launch", "launch the qemu subprocess");
+  printf ("%-20s %s\n", "lgetxattrs", "list extended attributes of a file or directory");
   printf ("%-20s %s\n", "list-devices", "list the block devices");
   printf ("%-20s %s\n", "list-partitions", "list the partitions");
   printf ("%-20s %s\n", "ll", "list the files in a directory (long format)");
+  printf ("%-20s %s\n", "lremovexattr", "remove extended attribute of a file or directory");
   printf ("%-20s %s\n", "ls", "list the files in a directory");
+  printf ("%-20s %s\n", "lsetxattr", "set extended attribute of a file or directory");
   printf ("%-20s %s\n", "lstat", "get file information for a symbolic link");
   printf ("%-20s %s\n", "lvcreate", "create an LVM volume group");
   printf ("%-20s %s\n", "lvm-remove-all", "remove all LVM LVs, VGs and PVs");
@@ -141,6 +146,7 @@ void list_commands (void)
   printf ("%-20s %s\n", "pvs-full", "list the LVM physical volumes (PVs)");
   printf ("%-20s %s\n", "read-lines", "read file as lines");
   printf ("%-20s %s\n", "readdir", "read directories entries");
+  printf ("%-20s %s\n", "removexattr", "remove extended attribute of a file or directory");
   printf ("%-20s %s\n", "resize2fs", "resize an ext2/ext3 filesystem");
   printf ("%-20s %s\n", "rm", "remove a file");
   printf ("%-20s %s\n", "rm-rf", "remove a file or directory recursively");
@@ -156,6 +162,7 @@ void list_commands (void)
   printf ("%-20s %s\n", "set-path", "set the search path");
   printf ("%-20s %s\n", "set-qemu", "set the qemu binary");
   printf ("%-20s %s\n", "set-verbose", "set verbose mode");
+  printf ("%-20s %s\n", "setxattr", "set extended attribute of a file or directory");
   printf ("%-20s %s\n", "sfdisk", "create partitions on a block device");
   printf ("%-20s %s\n", "sfdiskM", "create partitions on a block device");
   printf ("%-20s %s\n", "sfdisk-N", "modify a single partition on a block device");
@@ -182,6 +189,7 @@ void list_commands (void)
   printf ("%-20s %s\n", "umount", "unmount a filesystem");
   printf ("%-20s %s\n", "umount-all", "unmount all filesystems");
   printf ("%-20s %s\n", "upload", "upload a file from the local machine");
+  printf ("%-20s %s\n", "version", "get the library version number");
   printf ("%-20s %s\n", "vg-activate", "activate or deactivate some volume groups");
   printf ("%-20s %s\n", "vg-activate-all", "activate or deactivate all volume groups");
   printf ("%-20s %s\n", "vgcreate", "create an LVM volume group");
@@ -194,6 +202,7 @@ void list_commands (void)
   printf ("%-20s %s\n", "write-file", "create a file");
   printf ("%-20s %s\n", "zero", "write zeroes to the device");
   printf ("%-20s %s\n", "zerofree", "zero unused inodes and disk blocks on ext2/3 filesystem");
+  printf ("%-20s %s\n", "zfile", "determine file type inside a compressed file");
   printf ("    Use -h <cmd> / help <cmd> to show detailed help for a command.\n");
 }
 
@@ -271,6 +280,9 @@ void display_command (const char *cmd)
   if (strcasecmp (cmd, "get_pid") == 0 || strcasecmp (cmd, "get-pid") == 0 || strcasecmp (cmd, "pid") == 0)
     pod2text ("get-pid - get PID of qemu subprocess", " get-pid\n\nReturn the process ID of the qemu subprocess.  If there is no\nqemu subprocess, then this will return an error.\n\nThis is an internal call used for debugging and testing.\n\nYou can use 'pid' as an alias for this command.");
   else
+  if (strcasecmp (cmd, "version") == 0)
+    pod2text ("version - get the library version number", " version\n\nReturn the libguestfs version number that the program is linked\nagainst.\n\nNote that because of dynamic linking this is not necessarily\nthe version of libguestfs that you compiled against.  You can\ncompile the program, and then at runtime dynamically link\nagainst a completely different C<libguestfs.so> library.\n\nThis call was added in version C<1.0.58>.  In previous\nversions of libguestfs there was no way to get the version\nnumber.  From C code you can use ELF weak linking tricks to find out if\nthis symbol exists (if it doesn't, then it's an earlier version).\n\nThe call returns a structure with four elements.  The first\nthree (C<major>, C<minor> and C<release>) are numbers and\ncorrespond to the usual version triplet.  The fourth element\n(C<extra>) is a string and is normally empty, but may be\nused for distro-specific information.\n\nTo construct the original version string:\nC<$major.$minor.$release$extra>\n\nI<Note:> Don't use this call to test for availability\nof features.  Distro backports makes this unreliable.");
+  else
   if (strcasecmp (cmd, "mount") == 0)
     pod2text ("mount - mount a guest disk at a position in the filesystem", " mount <device> <mountpoint>\n\nMount a guest disk at a position in the filesystem.  Block devices\nare named C</dev/sda>, C</dev/sdb> and so on, as they were added to\nthe guest.  If those block devices contain partitions, they will have\nthe usual names (eg. C</dev/sda1>).  Also LVM C</dev/VG/LV>-style\nnames can be used.\n\nThe rules are the same as for L<mount(2)>:  A filesystem must\nfirst be mounted on C</> before others can be mounted.  Other\nfilesystems can only be mounted on directories which already\nexist.\n\nThe mounted filesystem is writable, if we have sufficient permissions\non the underlying device.\n\nThe filesystem options C<sync> and C<noatime> are set with this\ncall, in order to improve reliability.");
   else
@@ -688,6 +700,27 @@ void display_command (const char *cmd)
   if (strcasecmp (cmd, "sfdiskM") == 0)
     pod2text ("sfdiskM - create partitions on a block device", " sfdiskM <device> <lines>\n\nThis is a simplified interface to the C<sfdisk>\ncommand, where partition sizes are specified in megabytes\nonly (rounded to the nearest cylinder) and you don't need\nto specify the cyls, heads and sectors parameters which\nwere rarely if ever used anyway.\n\nSee also C<sfdisk> and the L<sfdisk(8)> manpage.\n\nB<This command is dangerous.  Without careful use you\ncan easily destroy all your data>.");
   else
+  if (strcasecmp (cmd, "zfile") == 0)
+    pod2text ("zfile - determine file type inside a compressed file", " zfile <method> <path>\n\nThis command runs C<file> after first decompressing C<path>\nusing C<method>.\n\nC<method> must be one of C<gzip>, C<compress> or C<bzip2>.\n\nSee also: C<file>");
+  else
+  if (strcasecmp (cmd, "getxattrs") == 0)
+    pod2text ("getxattrs - list extended attributes of a file or directory", " getxattrs <path>\n\nThis call lists the extended attributes of the file or directory\nC<path>.\n\nAt the system call level, this is a combination of the\nL<listxattr(2)> and L<getxattr(2)> calls.\n\nSee also: C<lgetxattrs>, L<attr(5)>.");
+  else
+  if (strcasecmp (cmd, "lgetxattrs") == 0)
+    pod2text ("lgetxattrs - list extended attributes of a file or directory", " lgetxattrs <path>\n\nThis is the same as C<getxattrs>, but if C<path>\nis a symbolic link, then it returns the extended attributes\nof the link itself.");
+  else
+  if (strcasecmp (cmd, "setxattr") == 0)
+    pod2text ("setxattr - set extended attribute of a file or directory", " setxattr <xattr> <val> <vallen> <path>\n\nThis call sets the extended attribute named C<xattr>\nof the file C<path> to the value C<val> (of length C<vallen>).\nThe value is arbitrary 8 bit data.\n\nSee also: C<lsetxattr>, L<attr(5)>.");
+  else
+  if (strcasecmp (cmd, "lsetxattr") == 0)
+    pod2text ("lsetxattr - set extended attribute of a file or directory", " lsetxattr <xattr> <val> <vallen> <path>\n\nThis is the same as C<setxattr>, but if C<path>\nis a symbolic link, then it sets an extended attribute\nof the link itself.");
+  else
+  if (strcasecmp (cmd, "removexattr") == 0)
+    pod2text ("removexattr - remove extended attribute of a file or directory", " removexattr <xattr> <path>\n\nThis call removes the extended attribute named C<xattr>\nof the file C<path>.\n\nSee also: C<lremovexattr>, L<attr(5)>.");
+  else
+  if (strcasecmp (cmd, "lremovexattr") == 0)
+    pod2text ("lremovexattr - remove extended attribute of a file or directory", " lremovexattr <xattr> <path>\n\nThis is the same as C<removexattr>, but if C<path>\nis a symbolic link, then it removes an extended attribute\nof the link itself.");
+  else
     display_builtin_command (cmd);
 }
 
@@ -870,6 +903,44 @@ static void print_dirent_list (struct guestfs_dirent_list *dirents)
     print_dirent (&dirents->val[i]);
 }
 
+static void print_version (struct guestfs_version *version)
+{
+  printf ("major: %" PRIi64 "\n", version->major);
+  printf ("minor: %" PRIi64 "\n", version->minor);
+  printf ("release: %" PRIi64 "\n", version->release);
+  printf ("extra: %s\n", version->extra);
+}
+
+static void print_version_list (struct guestfs_version_list *versions)
+{
+  int i;
+
+  for (i = 0; i < versions->len; ++i)
+    print_version (&versions->val[i]);
+}
+
+static void print_xattr (struct guestfs_xattr *xattr)
+{
+  int i;
+
+  printf ("attrname: %s\n", xattr->attrname);
+  printf ("attrval: ");
+  for (i = 0; i < xattr->attrval_len; ++i)
+    if (isprint (xattr->attrval[i]))
+      printf ("%c", xattr->attrval[i]);
+    else
+      printf ("\\x%02x", xattr->attrval[i]);
+  printf ("\n");
+}
+
+static void print_xattr_list (struct guestfs_xattr_list *xattrs)
+{
+  int i;
+
+  for (i = 0; i < xattrs->len; ++i)
+    print_xattr (&xattrs->val[i]);
+}
+
 static int run_launch (const char *cmd, int argc, char *argv[])
 {
   int r;
@@ -1204,6 +1275,21 @@ static int run_get_pid (const char *cmd, int argc, char *argv[])
   return 0;
 }
 
+static int run_version (const char *cmd, int argc, char *argv[])
+{
+  struct guestfs_version *r;
+  if (argc != 0) {
+    fprintf (stderr, "%s should have 0 parameter(s)\n", cmd);
+    fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+    return -1;
+  }
+  r = guestfs_version (g);
+  if (r == NULL) return -1;
+  print_version (r);
+  guestfs_free_version (r);
+  return 0;
+}
+
 static int run_mount (const char *cmd, int argc, char *argv[])
 {
   int r;
@@ -3432,6 +3518,131 @@ static int run_sfdiskM (const char *cmd, int argc, char *argv[])
   return r;
 }
 
+static int run_zfile (const char *cmd, int argc, char *argv[])
+{
+  char *r;
+  const char *method;
+  const char *path;
+  if (argc != 2) {
+    fprintf (stderr, "%s should have 2 parameter(s)\n", cmd);
+    fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+    return -1;
+  }
+  method = argv[0];
+  path = argv[1];
+  r = guestfs_zfile (g, method, path);
+  if (r == NULL) return -1;
+  printf ("%s\n", r);
+  free (r);
+  return 0;
+}
+
+static int run_getxattrs (const char *cmd, int argc, char *argv[])
+{
+  struct guestfs_xattr_list *r;
+  const char *path;
+  if (argc != 1) {
+    fprintf (stderr, "%s should have 1 parameter(s)\n", cmd);
+    fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+    return -1;
+  }
+  path = argv[0];
+  r = guestfs_getxattrs (g, path);
+  if (r == NULL) return -1;
+  print_xattr_list (r);
+  guestfs_free_xattr_list (r);
+  return 0;
+}
+
+static int run_lgetxattrs (const char *cmd, int argc, char *argv[])
+{
+  struct guestfs_xattr_list *r;
+  const char *path;
+  if (argc != 1) {
+    fprintf (stderr, "%s should have 1 parameter(s)\n", cmd);
+    fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+    return -1;
+  }
+  path = argv[0];
+  r = guestfs_lgetxattrs (g, path);
+  if (r == NULL) return -1;
+  print_xattr_list (r);
+  guestfs_free_xattr_list (r);
+  return 0;
+}
+
+static int run_setxattr (const char *cmd, int argc, char *argv[])
+{
+  int r;
+  const char *xattr;
+  const char *val;
+  int vallen;
+  const char *path;
+  if (argc != 4) {
+    fprintf (stderr, "%s should have 4 parameter(s)\n", cmd);
+    fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+    return -1;
+  }
+  xattr = argv[0];
+  val = argv[1];
+  vallen = atoi (argv[2]);
+  path = argv[3];
+  r = guestfs_setxattr (g, xattr, val, vallen, path);
+  return r;
+}
+
+static int run_lsetxattr (const char *cmd, int argc, char *argv[])
+{
+  int r;
+  const char *xattr;
+  const char *val;
+  int vallen;
+  const char *path;
+  if (argc != 4) {
+    fprintf (stderr, "%s should have 4 parameter(s)\n", cmd);
+    fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+    return -1;
+  }
+  xattr = argv[0];
+  val = argv[1];
+  vallen = atoi (argv[2]);
+  path = argv[3];
+  r = guestfs_lsetxattr (g, xattr, val, vallen, path);
+  return r;
+}
+
+static int run_removexattr (const char *cmd, int argc, char *argv[])
+{
+  int r;
+  const char *xattr;
+  const char *path;
+  if (argc != 2) {
+    fprintf (stderr, "%s should have 2 parameter(s)\n", cmd);
+    fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+    return -1;
+  }
+  xattr = argv[0];
+  path = argv[1];
+  r = guestfs_removexattr (g, xattr, path);
+  return r;
+}
+
+static int run_lremovexattr (const char *cmd, int argc, char *argv[])
+{
+  int r;
+  const char *xattr;
+  const char *path;
+  if (argc != 2) {
+    fprintf (stderr, "%s should have 2 parameter(s)\n", cmd);
+    fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd);
+    return -1;
+  }
+  xattr = argv[0];
+  path = argv[1];
+  r = guestfs_lremovexattr (g, xattr, path);
+  return r;
+}
+
 int run_action (const char *cmd, int argc, char *argv[])
 {
   if (strcasecmp (cmd, "launch") == 0 || strcasecmp (cmd, "run") == 0)
@@ -3506,6 +3717,9 @@ int run_action (const char *cmd, int argc, char *argv[])
   if (strcasecmp (cmd, "get_pid") == 0 || strcasecmp (cmd, "get-pid") == 0 || strcasecmp (cmd, "pid") == 0)
     return run_get_pid (cmd, argc, argv);
   else
+  if (strcasecmp (cmd, "version") == 0)
+    return run_version (cmd, argc, argv);
+  else
   if (strcasecmp (cmd, "mount") == 0)
     return run_mount (cmd, argc, argv);
   else
@@ -3923,6 +4137,27 @@ int run_action (const char *cmd, int argc, char *argv[])
   if (strcasecmp (cmd, "sfdiskM") == 0)
     return run_sfdiskM (cmd, argc, argv);
   else
+  if (strcasecmp (cmd, "zfile") == 0)
+    return run_zfile (cmd, argc, argv);
+  else
+  if (strcasecmp (cmd, "getxattrs") == 0)
+    return run_getxattrs (cmd, argc, argv);
+  else
+  if (strcasecmp (cmd, "lgetxattrs") == 0)
+    return run_lgetxattrs (cmd, argc, argv);
+  else
+  if (strcasecmp (cmd, "setxattr") == 0)
+    return run_setxattr (cmd, argc, argv);
+  else
+  if (strcasecmp (cmd, "lsetxattr") == 0)
+    return run_lsetxattr (cmd, argc, argv);
+  else
+  if (strcasecmp (cmd, "removexattr") == 0)
+    return run_removexattr (cmd, argc, argv);
+  else
+  if (strcasecmp (cmd, "lremovexattr") == 0)
+    return run_lremovexattr (cmd, argc, argv);
+  else
     {
       fprintf (stderr, "%s: unknown command\n", cmd);
       return -1;
diff --git a/fish/completion.c b/fish/completion.c
index 5d16b99..f4dd976 100644
--- a/fish/completion.c
+++ b/fish/completion.c
@@ -70,6 +70,7 @@ static const char *const commands[] = {
   "get-memsize",
   "get-pid",
   "pid",
+  "version",
   "mount",
   "sync",
   "touch",
@@ -211,6 +212,13 @@ static const char *const commands[] = {
   "umask",
   "readdir",
   "sfdiskM",
+  "zfile",
+  "getxattrs",
+  "lgetxattrs",
+  "setxattr",
+  "lsetxattr",
+  "removexattr",
+  "lremovexattr",
   NULL
 };
 
diff --git a/fish/fish.c b/fish/fish.c
index 25483a1..f5d538d 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -68,6 +68,10 @@ guestfs_h *g;
 int read_only = 0;
 int quit = 0;
 int verbose = 0;
+int echo_commands = 0;
+int remote_control_listen = 0;
+int remote_control = 0;
+int exit_on_error = 1;
 
 int
 launch (guestfs_h *_g)
@@ -108,10 +112,13 @@ usage (void)
 	     "  -D|--no-dest-paths   Don't tab-complete paths from guest fs\n"
 	     "  -f|--file file       Read commands from file\n"
 	     "  -i|--inspector       Run virt-inspector to get disk mountpoints\n"
+	     "  --listen             Listen for remote commands\n"
 	     "  -m|--mount dev[:mnt] Mount dev on mnt (if omitted, /)\n"
 	     "  -n|--no-sync         Don't autosync\n"
+	     "  --remote[=pid]       Send commands to remote guestfish\n"
 	     "  -r|--ro              Mount read-only\n"
 	     "  -v|--verbose         Verbose messages\n"
+	     "  -x                   Echo each command before executing it\n"
 	     "  -V|--version         Display version and exit\n"
 	     "For more information,  see the manpage guestfish(1).\n"));
 }
@@ -119,16 +126,18 @@ usage (void)
 int
 main (int argc, char *argv[])
 {
-  static const char *options = "a:f:h::im:nrv?V";
+  static const char *options = "a:Df:h::im:nrv?Vx";
   static struct option long_options[] = {
     { "add", 1, 0, 'a' },
     { "cmd-help", 2, 0, 'h' },
     { "file", 1, 0, 'f' },
     { "help", 0, 0, '?' },
     { "inspector", 0, 0, 'i' },
+    { "listen", 0, 0, 0 },
     { "mount", 1, 0, 'm' },
     { "no-dest-paths", 0, 0, 'D' },
     { "no-sync", 0, 0, 'n' },
+    { "remote", 2, 0, 0 },
     { "ro", 0, 0, 'r' },
     { "verbose", 0, 0, 'v' },
     { "version", 0, 0, 'V' },
@@ -139,7 +148,9 @@ main (int argc, char *argv[])
   struct mp *mps = NULL;
   struct mp *mp;
   char *p, *file = NULL;
-  int c, inspector = 0;
+  int c;
+  int inspector = 0;
+  int option_index;
   struct sigaction sa;
 
   initialize_readline ();
@@ -174,10 +185,33 @@ main (int argc, char *argv[])
     guestfs_set_path (g, "appliance:" GUESTFS_DEFAULT_PATH);
 
   for (;;) {
-    c = getopt_long (argc, argv, options, long_options, NULL);
+    c = getopt_long (argc, argv, options, long_options, &option_index);
     if (c == -1) break;
 
     switch (c) {
+    case 0:			/* options which are long only */
+      if (strcmp (long_options[option_index].name, "listen") == 0)
+	remote_control_listen = 1;
+      else if (strcmp (long_options[option_index].name, "remote") == 0) {
+	if (optarg) {
+	  if (sscanf (optarg, "%d", &remote_control) != 1) {
+	    fprintf (stderr, _("guestfish: --listen=PID: PID was not a number: %s\n"), optarg);
+	    exit (1);
+	  }
+	} else {
+	  p = getenv ("GUESTFISH_PID");
+	  if (!p || sscanf (p, "%d", &remote_control) != 1) {
+	    fprintf (stderr, _("guestfish: remote: $GUESTFISH_PID must be set to the PID of the remote process\n"));
+	    exit (1);
+	  }
+	}
+      } else {
+	fprintf (stderr, _("guestfish: unknown long option: %s (%d)\n"),
+		 long_options[option_index].name, option_index);
+	exit (1);
+      }
+      break;
+
     case 'a':
       if (access (optarg, R_OK) != 0) {
 	perror (optarg);
@@ -252,6 +286,10 @@ main (int argc, char *argv[])
       printf ("guestfish %s\n", PACKAGE_VERSION);
       exit (0);
 
+    case 'x':
+      echo_commands = 1;
+      break;
+
     case '?':
       usage ();
       exit (0);
@@ -268,8 +306,8 @@ main (int argc, char *argv[])
     char cmd[1024];
     int r;
 
-    if (drvs || mps) {
-      fprintf (stderr, _("guestfish: cannot use -i option with -a or -m\n"));
+    if (drvs || mps || remote_control_listen || remote_control) {
+      fprintf (stderr, _("guestfish: cannot use -i option with -a, -m, --listen or --remote\n"));
       exit (1);
     }
     if (optind >= argc) {
@@ -321,6 +359,24 @@ main (int argc, char *argv[])
     mount_mps (mps);
   }
 
+  /* Remote control? */
+  if (remote_control_listen && remote_control) {
+    fprintf (stderr, _("guestfish: cannot use --listen and --remote options at the same time\n"));
+    exit (1);
+  }
+
+  if (remote_control_listen) {
+    if (optind < argc) {
+      fprintf (stderr, _("guestfish: extra parameters on the command line with --listen flag\n"));
+      exit (1);
+    }
+    if (file) {
+      fprintf (stderr, _("guestfish: cannot use --listen and --file options at the same time\n"));
+      exit (1);
+    }
+    rc_listen ();
+  }
+
   /* -f (file) parameter? */
   if (file) {
     close (0);
@@ -458,7 +514,7 @@ script (int prompt)
   char *argv[64];
   int i, len;
   int global_exit_on_error = !prompt;
-  int exit_on_error;
+  int tilde_candidate;
 
   if (prompt)
     printf (_("\n"
@@ -532,6 +588,8 @@ script (int prompt)
 
     /* Get the parameters. */
     while (*p && i < sizeof argv / sizeof argv[0]) {
+      tilde_candidate = 0;
+
       /* Parameters which start with quotes or pipes are treated
        * specially.  Bare parameters are delimited by whitespace.
        */
@@ -592,6 +650,11 @@ script (int prompt)
 	*(pend-1) = '\0';
 	*/
       } else if (*p != ' ' && *p != '\t') {
+	/* If the first character is a ~ then note that this parameter
+	 * is a candidate for ~username expansion.  NB this does not
+	 * apply to quoted parameters.
+	 */
+	tilde_candidate = *p == '~';
 	len = strcspn (p, " \t");
 	if (p[len]) {
 	  p[len] = '\0';
@@ -604,7 +667,11 @@ script (int prompt)
 	abort ();
       }
 
-      argv[i++] = p;
+      if (!tilde_candidate)
+	argv[i] = p;
+      else
+	argv[i] = try_tilde_expansion (p);
+      i++;
       p = pend;
 
       if (*p)
@@ -635,6 +702,8 @@ cmdline (char *argv[], int optind, int argc)
   const char *cmd;
   char **params;
 
+  exit_on_error = 1;
+
   if (optind >= argc) return;
 
   cmd = argv[optind++];
@@ -663,7 +732,14 @@ issue_command (const char *cmd, char *argv[], const char *pipecmd)
   int argc;
   int stdout_saved_fd = -1;
   int pid = 0;
-  int r;
+  int i, r;
+
+  if (echo_commands) {
+    printf ("%s", cmd);
+    for (i = 0; argv[i] != NULL; ++i)
+      printf (" %s", argv[i]);
+    printf ("\n");
+  }
 
   /* For | ... commands.  Annoyingly we can't use popen(3) here. */
   if (pipecmd) {
@@ -698,7 +774,12 @@ issue_command (const char *cmd, char *argv[], const char *pipecmd)
   for (argc = 0; argv[argc] != NULL; ++argc)
     ;
 
-  if (strcasecmp (cmd, "help") == 0) {
+  /* If --remote was set, then send this command to a remote process. */
+  if (remote_control)
+    r = rc_remote (remote_control, cmd, argc, argv, exit_on_error);
+
+  /* Otherwise execute it locally. */
+  else if (strcasecmp (cmd, "help") == 0) {
     if (argc == 0)
       list_commands ();
     else
@@ -727,6 +808,8 @@ issue_command (const char *cmd, char *argv[], const char *pipecmd)
   else if (strcasecmp (cmd, "more") == 0 ||
 	   strcasecmp (cmd, "less") == 0)
     r = do_more (cmd, argc, argv);
+  else if (strcasecmp (cmd, "reopen") == 0)
+    r = do_reopen (cmd, argc, argv);
   else if (strcasecmp (cmd, "time") == 0)
     r = do_time (cmd, argc, argv);
   else
@@ -767,6 +850,10 @@ list_builtin_commands (void)
   printf ("%-20s %s\n",
 	  "glob", _("expand wildcards in command"));
   printf ("%-20s %s\n",
+	  "more", _("view a file in the pager"));
+  printf ("%-20s %s\n",
+	  "reopen", _("close and reopen libguestfs handle"));
+  printf ("%-20s %s\n",
 	  "time", _("measure time taken to run command"));
 
   /* actions are printed after this (see list_commands) */
@@ -829,6 +916,10 @@ display_builtin_command (const char *cmd)
 	      "    Glob runs <command> with wildcards expanded in any\n"
 	      "    command args.  Note that the command is run repeatedly\n"
 	      "    once for each expanded argument.\n"));
+  else if (strcasecmp (cmd, "help") == 0)
+    printf (_("help - display a list of commands or help on a command\n"
+	      "     help cmd\n"
+	      "     help\n"));
   else if (strcasecmp (cmd, "more") == 0 ||
 	   strcasecmp (cmd, "less") == 0)
     printf (_("more - view a file in the pager\n"
@@ -844,15 +935,18 @@ display_builtin_command (const char *cmd)
 	      "\n"
 	      "    NOTE: This will not work reliably for large files\n"
 	      "    (> 2 MB) or binary files containing \\0 bytes.\n"));
-  else if (strcasecmp (cmd, "help") == 0)
-    printf (_("help - display a list of commands or help on a command\n"
-	      "     help cmd\n"
-	      "     help\n"));
   else if (strcasecmp (cmd, "quit") == 0 ||
 	   strcasecmp (cmd, "exit") == 0 ||
 	   strcasecmp (cmd, "q") == 0)
     printf (_("quit - quit guestfish\n"
 	      "     quit\n"));
+  else if (strcasecmp (cmd, "reopen") == 0)
+    printf (_("reopen - close and reopen the libguestfs handle\n"
+	      "     reopen\n"
+	      "\n"
+	      "Close and reopen the libguestfs handle.  It is not necessary to use\n"
+	      "this normally, because the handle is closed properly when guestfish\n"
+	      "exits.  However this is occasionally useful for testing.\n"));
   else if (strcasecmp (cmd, "time") == 0)
     printf (_("time - measure time taken to run command\n"
 	      "    time <command> [<args> ...]\n"
diff --git a/fish/fish.h b/fish/fish.h
index cad8073..59f2e10 100644
--- a/fish/fish.h
+++ b/fish/fish.h
@@ -1,4 +1,4 @@
-/* libguestfs - the guestfsd daemon
+/* libguestfs - guestfish shell
  * Copyright (C) 2009 Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -77,9 +77,20 @@ extern int do_glob (const char *cmd, int argc, char *argv[]);
 /* in more.c */
 extern int do_more (const char *cmd, int argc, char *argv[]);
 
+/* in rc.c (remote control) */
+extern void rc_listen (void);
+extern int rc_remote (int pid, const char *cmd, int argc, char *argv[],
+		      int exit_on_error);
+
+/* in reopen.c */
+extern int do_reopen (const char *cmd, int argc, char *argv[]);
+
 /* in time.c */
 extern int do_time (const char *cmd, int argc, char *argv[]);
 
+/* in tilde.c */
+extern char *try_tilde_expansion (char *path);
+
 /* This should just list all the built-in commands so they can
  * be added to the generated auto-completion code.
  */
@@ -92,6 +103,7 @@ extern int do_time (const char *cmd, int argc, char *argv[]);
   "lcd",				\
   "glob",				\
   "more", "less",			\
+  "reopen",				\
   "time"
 
 #endif /* FISH_H */
diff --git a/fish/rc.c b/fish/rc.c
new file mode 100644
index 0000000..0d67a62
--- /dev/null
+++ b/fish/rc.c
@@ -0,0 +1,272 @@
+/* guestfish - the filesystem interactive shell
+ * Copyright (C) 2009 Red Hat Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/un.h>
+#include <signal.h>
+
+#include <rpc/types.h>
+#include <rpc/xdr.h>
+
+#include "fish.h"
+#include "rc_protocol.h"
+
+#define UNIX_PATH_MAX 108
+
+static void
+create_sockpath (pid_t pid, char *sockpath, int len, struct sockaddr_un *addr)
+{
+  char dir[128];
+  uid_t euid = geteuid ();
+
+  snprintf (dir, sizeof dir, "/tmp/.guestfish-%d", euid);
+  mkdir (dir, 0700);
+
+  snprintf (sockpath, len, "/tmp/.guestfish-%d/socket-%d", euid, pid);
+
+  addr->sun_family = AF_UNIX;
+  strcpy (addr->sun_path, sockpath);
+}
+
+/* Remote control server. */
+void
+rc_listen (void)
+{
+  char sockpath[128];
+  pid_t pid;
+  struct sockaddr_un addr;
+  int sock, s, i, fd;
+  FILE *fp;
+  XDR xdr, xdr2;
+  guestfish_hello hello;
+  guestfish_call call;
+  guestfish_reply reply;
+  char **argv;
+  int argc;
+
+  memset (&hello, 0, sizeof hello);
+  memset (&call, 0, sizeof call);
+
+  pid = fork ();
+  if (pid == -1) {
+    perror ("fork");
+    exit (1);
+  }
+
+  if (pid > 0) {
+    /* Parent process. */
+    printf ("export GUESTFISH_PID=%d\n", pid);
+    fflush (stdout);
+    _exit (0);
+  }
+
+  /* Child process.
+   *
+   * Create the listening socket for accepting commands.
+   *
+   * Unfortunately there is a small but unavoidable race here.  We
+   * don't know the PID until after we've forked, so we cannot be
+   * sure the socket is created from the point of view of the parent
+   * (if the child is very slow).
+   */
+  pid = getpid ();
+  create_sockpath (pid, sockpath, sizeof sockpath, &addr);
+
+  sock = socket (AF_UNIX, SOCK_STREAM, 0);
+  if (sock == -1) {
+    perror ("socket");
+    exit (1);
+  }
+  unlink (sockpath);
+  if (bind (sock, (struct sockaddr *) &addr, sizeof addr) == -1) {
+    perror (sockpath);
+    exit (1);
+  }
+  if (listen (sock, 4) == -1) {
+    perror ("listen");
+    exit (1);
+  }
+
+  /* Now close stdout and substitute /dev/null.  This is necessary
+   * so that eval `guestfish --listen` doesn't block forever.
+   */
+  fd = open ("/dev/null", O_WRONLY);
+  if (fd == -1)
+    perror ("/dev/null");
+  else {
+    dup2 (fd, 1);
+    close (fd);
+  }
+
+  /* Read commands and execute them. */
+  while (!quit) {
+    s = accept (sock, NULL, NULL);
+    if (s == -1)
+      perror ("accept");
+    else {
+      fp = fdopen (s, "r+");
+      xdrstdio_create (&xdr, fp, XDR_DECODE);
+
+      if (!xdr_guestfish_hello (&xdr, &hello)) {
+	fprintf (stderr, _("guestfish: protocol error: could not read 'hello' message\n"));
+	goto error;
+      }
+
+      if (strcmp (hello.vers, PACKAGE_VERSION) != 0) {
+	fprintf (stderr, _("guestfish: protocol error: version mismatch, server version '%s' does not match client version '%s'.  The two versions must match exactly.\n"),
+		 PACKAGE_VERSION,
+		 hello.vers);
+	xdr_free ((xdrproc_t) xdr_guestfish_hello, (char *) &hello);
+	goto error;
+      }
+      xdr_free ((xdrproc_t) xdr_guestfish_hello, (char *) &hello);
+
+      while (xdr_guestfish_call (&xdr, &call)) {
+	/* We have to extend and NULL-terminate the argv array. */
+	argc = call.args.args_len;
+	argv = realloc (call.args.args_val, (argc+1) * sizeof (char *));
+	if (argv == NULL) {
+	  perror ("realloc");
+	  exit (1);
+	}
+	call.args.args_val = argv;
+	argv[argc] = NULL;
+
+	if (verbose) {
+	  fprintf (stderr, "guestfish(%d): %s", pid, call.cmd);
+	  for (i = 0; i < argc; ++i)
+	    fprintf (stderr, " %s", argv[i]);
+	  fprintf (stderr, "\n");
+	}
+
+	/* Run the command. */
+	reply.r = issue_command (call.cmd, argv, NULL);
+
+	xdr_free ((xdrproc_t) xdr_guestfish_call, (char *) &call);
+
+	/* Send the reply. */
+	xdrstdio_create (&xdr2, fp, XDR_ENCODE);
+	(void) xdr_guestfish_reply (&xdr2, &reply);
+	xdr_destroy (&xdr2);
+
+	/* Exit on error? */
+	if (call.exit_on_error && reply.r == -1) {
+	  unlink (sockpath);
+	  exit (1);
+	}
+      }
+
+    error:
+      xdr_destroy (&xdr);	/* NB. This doesn't close 'fp'. */
+      fclose (fp);		/* Closes the underlying socket 's'. */
+    }
+  }
+
+  unlink (sockpath);
+  exit (0);
+}
+
+/* Remote control client. */
+int
+rc_remote (int pid, const char *cmd, int argc, char *argv[],
+	   int exit_on_error)
+{
+  guestfish_hello hello;
+  guestfish_call call;
+  guestfish_reply reply;
+  char sockpath[128];
+  struct sockaddr_un addr;
+  int sock;
+  FILE *fp;
+  XDR xdr;
+
+  memset (&reply, 0, sizeof reply);
+
+  /* This is fine as long as we never try to xdr_free this struct. */
+  hello.vers = (char *) PACKAGE_VERSION;
+
+  /* Check the other end is still running. */
+  if (kill (pid, 0) == -1) {
+    fprintf (stderr, _("guestfish: remote: looks like the server is not running\n"));
+    return -1;
+  }
+
+  create_sockpath (pid, sockpath, sizeof sockpath, &addr);
+
+  sock = socket (AF_UNIX, SOCK_STREAM, 0);
+  if (sock == -1) {
+    perror ("socket");
+    return -1;
+  }
+
+  if (connect (sock, (struct sockaddr *) &addr, sizeof addr) == -1) {
+    perror (sockpath);
+    fprintf (stderr, _("guestfish: remote: looks like the server is not running\n"));
+    close (sock);
+    return -1;
+  }
+
+  /* Send the greeting. */
+  fp = fdopen (sock, "r+");
+  xdrstdio_create (&xdr, fp, XDR_ENCODE);
+
+  if (!xdr_guestfish_hello (&xdr, &hello)) {
+    fprintf (stderr, _("guestfish: protocol error: could not send initial greeting to server\n"));
+    fclose (fp);
+    xdr_destroy (&xdr);
+    return -1;
+  }
+
+  /* Send the command.  The server supports reading multiple commands
+   * per connection, but this code only ever sends one command.
+   */
+  call.cmd = (char *) cmd;
+  call.args.args_len = argc;
+  call.args.args_val = argv;
+  call.exit_on_error = exit_on_error;
+  if (!xdr_guestfish_call (&xdr, &call)) {
+    fprintf (stderr, _("guestfish: protocol error: could not send initial greeting to server\n"));
+    fclose (fp);
+    xdr_destroy (&xdr);
+    return -1;
+  }
+  xdr_destroy (&xdr);
+
+  /* Wait for the reply. */
+  xdrstdio_create (&xdr, fp, XDR_DECODE);
+
+  if (!xdr_guestfish_reply (&xdr, &reply)) {
+    fprintf (stderr, _("guestfish: protocol error: could not decode reply from server\n"));
+    fclose (fp);
+    xdr_destroy (&xdr);
+    return -1;
+  }
+
+  fclose (fp);
+  xdr_destroy (&xdr);
+
+  return reply.r;
+}
diff --git a/fish/rc_protocol.c b/fish/rc_protocol.c
new file mode 100644
index 0000000..451932f
--- /dev/null
+++ b/fish/rc_protocol.c
@@ -0,0 +1,51 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#include "rc_protocol.h"
+
+bool_t
+xdr_str (XDR *xdrs, str *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, objp, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfish_hello (XDR *xdrs, guestfish_hello *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->vers, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfish_call (XDR *xdrs, guestfish_call *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->cmd, ~0))
+		 return FALSE;
+	 if (!xdr_array (xdrs, (char **)&objp->args.args_val, (u_int *) &objp->args.args_len, ~0,
+		sizeof (str), (xdrproc_t) xdr_str))
+		 return FALSE;
+	 if (!xdr_bool (xdrs, &objp->exit_on_error))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfish_reply (XDR *xdrs, guestfish_reply *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_int (xdrs, &objp->r))
+		 return FALSE;
+	return TRUE;
+}
diff --git a/fish/rc_protocol.h b/fish/rc_protocol.h
new file mode 100644
index 0000000..0233b91
--- /dev/null
+++ b/fish/rc_protocol.h
@@ -0,0 +1,59 @@
+/*
+ * Please do not edit this file.
+ * It was generated using rpcgen.
+ */
+
+#ifndef _RC_PROTOCOL_H_RPCGEN
+#define _RC_PROTOCOL_H_RPCGEN
+
+#include <rpc/rpc.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+typedef char *str;
+
+struct guestfish_hello {
+	char *vers;
+};
+typedef struct guestfish_hello guestfish_hello;
+
+struct guestfish_call {
+	char *cmd;
+	struct {
+		u_int args_len;
+		str *args_val;
+	} args;
+	bool_t exit_on_error;
+};
+typedef struct guestfish_call guestfish_call;
+
+struct guestfish_reply {
+	int r;
+};
+typedef struct guestfish_reply guestfish_reply;
+
+/* the xdr functions */
+
+#if defined(__STDC__) || defined(__cplusplus)
+extern  bool_t xdr_str (XDR *, str*);
+extern  bool_t xdr_guestfish_hello (XDR *, guestfish_hello*);
+extern  bool_t xdr_guestfish_call (XDR *, guestfish_call*);
+extern  bool_t xdr_guestfish_reply (XDR *, guestfish_reply*);
+
+#else /* K&R C */
+extern bool_t xdr_str ();
+extern bool_t xdr_guestfish_hello ();
+extern bool_t xdr_guestfish_call ();
+extern bool_t xdr_guestfish_reply ();
+
+#endif /* K&R C */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_RC_PROTOCOL_H_RPCGEN */
diff --git a/daemon/sleep.c b/fish/rc_protocol.x
similarity index 53%
copy from daemon/sleep.c
copy to fish/rc_protocol.x
index 3b5d395..9d8f0e9 100644
--- a/daemon/sleep.c
+++ b/fish/rc_protocol.x
@@ -1,4 +1,4 @@
-/* libguestfs - the guestfsd daemon
+/* libguestfs - guestfish remote control protocol -*- c -*-
  * Copyright (C) 2009 Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -11,25 +11,26 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <config.h>
+typedef string str<>;
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
+struct guestfish_hello {
+  /* Client and server version strings must match exactly.  We change
+   * this protocol whenever we want to.
+   */
+  string vers<>;
+};
 
-#include "../src/guestfs_protocol.h"
-#include "daemon.h"
-#include "actions.h"
+struct guestfish_call {
+  string cmd<>;
+  str args<>;
+  bool exit_on_error;
+};
 
-int
-do_sleep (int secs)
-{
-  /* According to the man page, this syscall never fails. */
-  (void) sleep (secs);
-  return 0;
-}
+struct guestfish_reply {
+  int r;			/* 0 or -1 only. */
+};
diff --git a/fish/time.c b/fish/reopen.c
similarity index 51%
copy from fish/time.c
copy to fish/reopen.c
index aae9afe..f2d35c7 100644
--- a/fish/time.c
+++ b/fish/reopen.c
@@ -26,29 +26,45 @@
 #include "fish.h"
 
 int
-do_time (const char *cmd, int argc, char *argv[])
+do_reopen (const char *cmd, int argc, char *argv[])
 {
-  struct timeval start_t, end_t;
-  int64_t start_us, end_us, elapsed_us;
+  guestfs_h *g2;
+  int r;
+  const char *p;
 
-  if (argc < 1) {
-    fprintf (stderr, _("use 'time command [args...]'\n"));
+  if (argc > 0) {
+    fprintf (stderr, _("'reopen' command takes no parameters\n"));
     return -1;
   }
 
-  gettimeofday (&start_t, NULL);
-
-  if (issue_command (argv[0], &argv[1], NULL) == -1)
+  /* Open the new handle first, so we can copy the settings from the
+   * old one to the new one, and also so if it fails we still have an
+   * open handle.
+   */
+  g2 = guestfs_create ();
+  if (g2 == NULL) {
+    fprintf (stderr, _("reopen: guestfs_create: failed to create handle\n"));
     return -1;
+  }
+
+  /* Now copy some of the settings from the old handle.  The settings
+   * we copy are those which are set by guestfish itself.
+   */
+  r = guestfs_get_verbose (g);
+  if (r >= 0)
+    guestfs_set_verbose (g2, r);
+
+  r = guestfs_get_autosync (g);
+  if (r >= 0)
+    guestfs_set_autosync (g2, r);
 
-  gettimeofday (&end_t, NULL);
+  p = guestfs_get_path (g);
+  if (p)
+    guestfs_set_path (g2, p);
 
-  start_us = (int64_t) start_t.tv_sec * 1000000 + start_t.tv_usec;
-  end_us = (int64_t) end_t.tv_sec * 1000000 + end_t.tv_usec;
-  elapsed_us = end_us - start_us;
-  printf ("elapsed time: %d.%02d seconds\n",
-	  (int) (elapsed_us / 1000000),
-	  (int) ((elapsed_us / 10000) % 100));
+  /* Close the original handle. */
+  guestfs_close (g);
+  g = g2;
 
   return 0;
 }
diff --git a/fish/tilde.c b/fish/tilde.c
new file mode 100644
index 0000000..13e6cd8
--- /dev/null
+++ b/fish/tilde.c
@@ -0,0 +1,121 @@
+/* guestfish - the filesystem interactive shell
+ * Copyright (C) 2009 Red Hat Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <assert.h>
+#include <pwd.h>
+#include <sys/types.h>
+
+#include "fish.h"
+
+static char *expand_home (const char *);
+static const char *find_home_for_username (const char *, int);
+
+/* This is called from the script loop if we find a candidate for
+ * ~username (tilde-expansion).
+ */
+char *
+try_tilde_expansion (char *str)
+{
+  assert (str[0] == '~');
+
+  /* Expand current user's home directory.  By simple experimentation
+   * I found out that bash always uses $HOME.
+   */
+  if (str[1] == '\0')		/* ~ */
+    return expand_home (NULL);
+  else if (str[1] == '/')	/* ~/... */
+    return expand_home (&str[1]);
+
+  /* Try expanding the part up to the following '\0' or '/' as a
+   * username from the password file.
+   */
+  else {
+    int len;
+    const char *home, *rest;
+
+    len = strcspn (&str[1], "/");
+    rest = &str[1+len];
+
+    home = find_home_for_username (&str[1], len);
+
+    if (home) {
+      len = strlen (home) + strlen (rest);
+      str = malloc (len);
+      if (str == NULL) {
+	perror ("malloc");
+	exit (1);
+      }
+      strcpy (str, home);
+      strcat (str, rest);
+      return str;
+    }
+  }
+
+  /* No match, return the orignal string. */
+  return str;
+}
+
+/* Return $HOME + append string. */
+static char *
+expand_home (const char *append)
+{
+  const char *home;
+  int len;
+  char *str;
+
+  home = getenv ("HOME");
+  if (!home) home = "~";
+
+  len = strlen (home) + (append ? strlen (append) : 0);
+  str = malloc (len);
+  if (str == NULL) {
+    perror ("malloc");
+    exit (1);
+  }
+
+  strcpy (str, home);
+  if (append)
+    strcat (str, append);
+
+  return str;
+}
+
+/* Lookup username (of length ulen), return home directory if found,
+ * or NULL if not found.
+ */
+static const char *
+find_home_for_username (const char *username, int ulen)
+{
+  struct passwd *pw;
+
+  setpwent ();
+  while ((pw = getpwent ()) != NULL) {
+    if (strlen (pw->pw_name) == ulen &&
+	strncmp (username, pw->pw_name, ulen) == 0)
+      return pw->pw_dir;
+  }
+
+  return NULL;
+}
diff --git a/guestfish-actions.pod b/guestfish-actions.pod
index 47bc05d..629d051 100644
--- a/guestfish-actions.pod
+++ b/guestfish-actions.pod
@@ -742,6 +742,18 @@ For more information on states, see L<guestfs(3)>.
 
 This returns the verbose messages flag.
 
+=head2 getxattrs
+
+ getxattrs path
+
+This call lists the extended attributes of the file or directory
+C<path>.
+
+At the system call level, this is a combination of the
+L<listxattr(2)> and L<getxattr(2)> calls.
+
+See also: C<lgetxattrs>, L<attr(5)>.
+
 =head2 glob-expand
 
  glob-expand pattern
@@ -888,6 +900,14 @@ using L<qemu(1)>.
 You should call this after configuring the handle
 (eg. adding drives) but before performing any actions.
 
+=head2 lgetxattrs
+
+ lgetxattrs path
+
+This is the same as C<getxattrs>, but if C<path>
+is a symbolic link, then it returns the extended attributes
+of the link itself.
+
 =head2 list-devices
 
  list-devices
@@ -917,6 +937,14 @@ there is no cwd) in the format of 'ls -la'.
 This command is mostly useful for interactive sessions.  It
 is I<not> intended that you try to parse the output string.
 
+=head2 lremovexattr
+
+ lremovexattr xattr path
+
+This is the same as C<removexattr>, but if C<path>
+is a symbolic link, then it removes an extended attribute
+of the link itself.
+
 =head2 ls
 
  ls directory
@@ -928,6 +956,14 @@ hidden files are shown.
 This command is mostly useful for interactive sessions.  Programs
 should probably use C<readdir> instead.
 
+=head2 lsetxattr
+
+ lsetxattr xattr val vallen path
+
+This is the same as C<setxattr>, but if C<path>
+is a symbolic link, then it sets an extended attribute
+of the link itself.
+
 =head2 lstat
 
  lstat path
@@ -1258,6 +1294,15 @@ This function is primarily intended for use by programs.  To
 get a simple list of names, use C<ls>.  To get a printable
 directory for human consumption, use C<ll>.
 
+=head2 removexattr
+
+ removexattr xattr path
+
+This call removes the extended attribute named C<xattr>
+of the file C<path>.
+
+See also: C<lremovexattr>, L<attr(5)>.
+
 =head2 resize2fs
 
  resize2fs device
@@ -1426,6 +1471,16 @@ If C<verbose> is true, this turns on verbose messages (to C<stderr>).
 Verbose messages are disabled unless the environment variable
 C<LIBGUESTFS_DEBUG> is defined and set to C<1>.
 
+=head2 setxattr
+
+ setxattr xattr val vallen path
+
+This call sets the extended attribute named C<xattr>
+of the file C<path> to the value C<val> (of length C<vallen>).
+The value is arbitrary 8 bit data.
+
+See also: C<lsetxattr>, L<attr(5)>.
+
 =head2 sfdisk
 
  sfdisk device cyls heads sectors 'lines ...'
@@ -1741,6 +1796,35 @@ See also C<download>.
 
 Use C<-> instead of a filename to read/write from stdin/stdout.
 
+=head2 version
+
+ version
+
+Return the libguestfs version number that the program is linked
+against.
+
+Note that because of dynamic linking this is not necessarily
+the version of libguestfs that you compiled against.  You can
+compile the program, and then at runtime dynamically link
+against a completely different C<libguestfs.so> library.
+
+This call was added in version C<1.0.58>.  In previous
+versions of libguestfs there was no way to get the version
+number.  From C code you can use ELF weak linking tricks to find out if
+this symbol exists (if it doesn't, then it's an earlier version).
+
+The call returns a structure with four elements.  The first
+three (C<major>, C<minor> and C<release>) are numbers and
+correspond to the usual version triplet.  The fourth element
+(C<extra>) is a string and is normally empty, but may be
+used for distro-specific information.
+
+To construct the original version string:
+C<$major.$minor.$release$extra>
+
+I<Note:> Don't use this call to test for availability
+of features.  Distro backports makes this unreliable.
+
 =head2 vg-activate
 
  vg-activate true|false 'volgroups ...'
@@ -1872,3 +1956,14 @@ mounted.
 It is possible that using this program can damage the filesystem
 or data on the filesystem.
 
+=head2 zfile
+
+ zfile method path
+
+This command runs C<file> after first decompressing C<path>
+using C<method>.
+
+C<method> must be one of C<gzip>, C<compress> or C<bzip2>.
+
+See also: C<file>
+
diff --git a/guestfish.pod b/guestfish.pod
index 4341e2a..32a3090 100644
--- a/guestfish.pod
+++ b/guestfish.pod
@@ -66,6 +66,11 @@ Remove C</boot/grub/menu.lst> (in reality not such a great idea):
  sfdisk /dev/sda 0 0 0 ,
  mkfs ext2 /dev/sda1
 
+=head2 Remote control
+
+ eval `guestfish --listen`
+ guestfish --remote cmd
+
 =head1 DESCRIPTION
 
 Guestfish is a shell and command-line tool for examining and modifying
@@ -92,6 +97,13 @@ Displays detailed help on a single command C<cmd>.
 
 Add a block device or virtual machine image to the shell.
 
+=item B<-D> | B<--no-dest-paths>
+
+Don't tab-complete paths on the guest filesystem.  It is useful to be
+able to hit the tab key to complete paths on the guest filesystem, but
+this causes extra "hidden" guestfs calls to be made, so this option is
+here to allow this feature to be disabled.
+
 =item B<-f file> | B<--file file>
 
 Read commands from C<file>.  To write pure guestfish
@@ -118,11 +130,17 @@ Typical usage is either:
 
  guestfish -i /dev/Guests/MyGuest
 
-You cannot use I<-a> or I<-m> in conjunction with this option, and
-options other than I<--ro> might not behave correctly.
+You cannot use I<-a>, I<-m>, I<--listen> or I<--remote> in conjunction
+with this option, and options other than I<--ro> might not behave
+correctly.
 
 See also: L<virt-inspector(1)>.
 
+=item B<--listen>
+
+Fork into the background and listen for remote commands.  See section
+I<REMOTE CONTROL GUESTFISH OVER A SOCKET> below.
+
 =item B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>
 
 Mount the named partition or logical volume on the given mountpoint.
@@ -139,6 +157,11 @@ automatically launched.
 Disable autosync.  This is enabled by default.  See the discussion
 of autosync in the L<guestfs(3)> manpage.
 
+=item B<--remote[=pid]>
+
+Send remote commands to C<$GUESTFISH_PID> or C<pid>.  See section
+I<REMOTE CONTROL GUESTFISH OVER A SOCKET> below.
+
 =item B<-r> | B<--ro>
 
 This changes the C<-m> option so that mounts are done read-only
@@ -149,17 +172,14 @@ This changes the C<-m> option so that mounts are done read-only
 Enable very verbose messages.  This is particularly useful if you find
 a bug.
 
-=item B<-D> | B<--no-dest-paths>
-
-Don't tab-complete paths on the guest filesystem.  It is useful to be
-able to hit the tab key to complete paths on the guest filesystem, but
-this causes extra "hidden" guestfs calls to be made, so this option is
-here to allow this feature to be disabled.
-
 =item B<-V> | B<--version>
 
 Display the guestfish / libguestfs version number and exit.
 
+=item B<-x>
+
+Echo each command before executing it.
+
 =back
 
 =head1 COMMANDS ON COMMAND LINE
@@ -308,6 +328,20 @@ to quote it, eg:
 
  echo "|"
 
+=head1 HOME DIRECTORIES
+
+If a parameter starts with the character C<~> then the tilde may be
+expanded as a home directory path (either C<~> for the current user's
+home directory, or C<~user> for another user).
+
+Note that home directory expansion happens for users known I<on the
+host>, not in the guest filesystem.
+
+To use a literal argument which begins with a tilde, you have to quote
+it, eg:
+
+ echo "~"
+
 =head1 EXIT ON ERROR BEHAVIOUR
 
 By default, guestfish will ignore any errors when in interactive mode
@@ -319,6 +353,58 @@ If you prefix a command with a I<-> character, then that command will
 not cause guestfish to exit, even if that (one) command returns an
 error.
 
+=head1 REMOTE CONTROL GUESTFISH OVER A SOCKET
+
+Guestfish can be remote-controlled over a socket.  This is useful
+particularly in shell scripts where you want to make several different
+changes to a filesystem, but you don't want the overhead of starting
+up a guestfish process each time.
+
+Start a guestfish server process using:
+
+ eval `guestfish --listen`
+
+and then send it commands by doing:
+
+ guestfish --remote cmd [...]
+
+To cause the server to exit, send it the exit command:
+
+ guestfish --remote exit
+
+Note that the server will normally exit if there is an error in a
+command.  You can change this in the usual way.  See section I<EXIT ON
+ERROR BEHAVIOUR>.
+
+=head2 CONTROLLING MULTIPLE GUESTFISH PROCESSES
+
+The C<eval> statement sets the environment variable C<$GUESTFISH_PID>,
+which is how the C<--remote> option knows where to send the commands.
+You can have several guestfish listener processes running using:
+
+ eval `guestfish --listen`
+ pid1=$GUESTFISH_PID
+ eval `guestfish --listen`
+ pid2=$GUESTFISH_PID
+ ...
+ guestfish --remote=$pid1 cmd
+ guestfish --remote=$pid2 cmd
+
+=head2 STANDARD OUTPUT DURING REMOTE CONTROL
+
+Because of limitations in the C<eval> statement, stdout from the
+listener is currently redirected to C</dev/null>.
+
+Stderr is unchanged.
+
+=head2 REMOTE CONTROL DETAILS
+
+Remote control happens over a Unix domain socket called
+C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective
+user ID of the process, and C<$PID> is the process ID of the server.
+
+Guestfish client and server versions must match exactly.
+
 =head1 GUESTFISH COMMANDS
 
 The commands in this section are guestfish convenience commands, in
@@ -419,6 +505,14 @@ NOTE: This will not work reliably for large files
 
 This exits guestfish.  You can also use C<^D> key.
 
+=head2 reopen
+
+ reopen
+
+Close and reopen the libguestfs handle.  It is not necessary to use
+this normally, because the handle is closed properly when guestfish
+exits.  However this is occasionally useful for testing.
+
 =head2 time
 
  time command args...
@@ -439,6 +533,12 @@ can be useful for benchmarking operations.
 The C<edit> command uses C<$EDITOR> as the editor.  If not
 set, it uses C<vi>.
 
+=item GUESTFISH_PID
+
+Used with the I<--remote> option to specify the remote guestfish
+process to control.  See section I<REMOTE CONTROL GUESTFISH OVER A
+SOCKET>.
+
 =item HOME
 
 If compiled with GNU readline support, then the command history
diff --git a/guestfs-actions.pod b/guestfs-actions.pod
index c7618a3..27151d1 100644
--- a/guestfs-actions.pod
+++ b/guestfs-actions.pod
@@ -956,6 +956,24 @@ This returns the verbose messages flag.
 
 This function returns a C truth value on success or -1 on error.
 
+=head2 guestfs_getxattrs
+
+ struct guestfs_xattr_list *guestfs_getxattrs (guestfs_h *handle,
+		const char *path);
+
+This call lists the extended attributes of the file or directory
+C<path>.
+
+At the system call level, this is a combination of the
+L<listxattr(2)> and L<getxattr(2)> calls.
+
+See also: C<guestfs_lgetxattrs>, L<attr(5)>.
+
+This function returns a C<struct guestfs_xattr_list *>
+(see E<lt>guestfs-structs.hE<gt>),
+or NULL if there was an error.
+I<The caller must call C<guestfs_free_xattr_list> after use>.
+
 =head2 guestfs_glob_expand
 
  char **guestfs_glob_expand (guestfs_h *handle,
@@ -1149,6 +1167,20 @@ You should call this after configuring the handle
 
 This function returns 0 on success or -1 on error.
 
+=head2 guestfs_lgetxattrs
+
+ struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *handle,
+		const char *path);
+
+This is the same as C<guestfs_getxattrs>, but if C<path>
+is a symbolic link, then it returns the extended attributes
+of the link itself.
+
+This function returns a C<struct guestfs_xattr_list *>
+(see E<lt>guestfs-structs.hE<gt>),
+or NULL if there was an error.
+I<The caller must call C<guestfs_free_xattr_list> after use>.
+
 =head2 guestfs_list_devices
 
  char **guestfs_list_devices (guestfs_h *handle);
@@ -1190,6 +1222,18 @@ is I<not> intended that you try to parse the output string.
 This function returns a string, or NULL on error.
 I<The caller must free the returned string after use>.
 
+=head2 guestfs_lremovexattr
+
+ int guestfs_lremovexattr (guestfs_h *handle,
+		const char *xattr,
+		const char *path);
+
+This is the same as C<guestfs_removexattr>, but if C<path>
+is a symbolic link, then it removes an extended attribute
+of the link itself.
+
+This function returns 0 on success or -1 on error.
+
 =head2 guestfs_ls
 
  char **guestfs_ls (guestfs_h *handle,
@@ -1206,6 +1250,20 @@ This function returns a NULL-terminated array of strings
 (like L<environ(3)>), or NULL if there was an error.
 I<The caller must free the strings and the array after use>.
 
+=head2 guestfs_lsetxattr
+
+ int guestfs_lsetxattr (guestfs_h *handle,
+		const char *xattr,
+		const char *val,
+		int vallen,
+		const char *path);
+
+This is the same as C<guestfs_setxattr>, but if C<path>
+is a symbolic link, then it sets an extended attribute
+of the link itself.
+
+This function returns 0 on success or -1 on error.
+
 =head2 guestfs_lstat
 
  struct guestfs_stat *guestfs_lstat (guestfs_h *handle,
@@ -1677,6 +1735,19 @@ This function returns a C<struct guestfs_dirent_list *>
 or NULL if there was an error.
 I<The caller must call C<guestfs_free_dirent_list> after use>.
 
+=head2 guestfs_removexattr
+
+ int guestfs_removexattr (guestfs_h *handle,
+		const char *xattr,
+		const char *path);
+
+This call removes the extended attribute named C<xattr>
+of the file C<path>.
+
+See also: C<guestfs_lremovexattr>, L<attr(5)>.
+
+This function returns 0 on success or -1 on error.
+
 =head2 guestfs_resize2fs
 
  int guestfs_resize2fs (guestfs_h *handle,
@@ -1914,6 +1985,22 @@ C<LIBGUESTFS_DEBUG> is defined and set to C<1>.
 
 This function returns 0 on success or -1 on error.
 
+=head2 guestfs_setxattr
+
+ int guestfs_setxattr (guestfs_h *handle,
+		const char *xattr,
+		const char *val,
+		int vallen,
+		const char *path);
+
+This call sets the extended attribute named C<xattr>
+of the file C<path> to the value C<val> (of length C<vallen>).
+The value is arbitrary 8 bit data.
+
+See also: C<guestfs_lsetxattr>, L<attr(5)>.
+
+This function returns 0 on success or -1 on error.
+
 =head2 guestfs_sfdisk
 
  int guestfs_sfdisk (guestfs_h *handle,
@@ -2334,6 +2421,39 @@ See also C<guestfs_download>.
 
 This function returns 0 on success or -1 on error.
 
+=head2 guestfs_version
+
+ struct guestfs_version *guestfs_version (guestfs_h *handle);
+
+Return the libguestfs version number that the program is linked
+against.
+
+Note that because of dynamic linking this is not necessarily
+the version of libguestfs that you compiled against.  You can
+compile the program, and then at runtime dynamically link
+against a completely different C<libguestfs.so> library.
+
+This call was added in version C<1.0.58>.  In previous
+versions of libguestfs there was no way to get the version
+number.  From C code you can use ELF weak linking tricks to find out if
+this symbol exists (if it doesn't, then it's an earlier version).
+
+The call returns a structure with four elements.  The first
+three (C<major>, C<minor> and C<release>) are numbers and
+correspond to the usual version triplet.  The fourth element
+(C<extra>) is a string and is normally empty, but may be
+used for distro-specific information.
+
+To construct the original version string:
+C<$major.$minor.$release$extra>
+
+I<Note:> Don't use this call to test for availability
+of features.  Distro backports makes this unreliable.
+
+This function returns a C<struct guestfs_version *>,
+or NULL if there was an error.
+I<The caller must call C<guestfs_free_version> after use>.
+
 =head2 guestfs_vg_activate
 
  int guestfs_vg_activate (guestfs_h *handle,
@@ -2520,3 +2640,19 @@ or data on the filesystem.
 
 This function returns 0 on success or -1 on error.
 
+=head2 guestfs_zfile
+
+ char *guestfs_zfile (guestfs_h *handle,
+		const char *method,
+		const char *path);
+
+This command runs C<file> after first decompressing C<path>
+using C<method>.
+
+C<method> must be one of C<gzip>, C<compress> or C<bzip2>.
+
+See also: C<guestfs_file>
+
+This function returns a string, or NULL on error.
+I<The caller must free the returned string after use>.
+
diff --git a/guestfs-structs.pod b/guestfs-structs.pod
index 020e0be..28cdfac 100644
--- a/guestfs-structs.pod
+++ b/guestfs-structs.pod
@@ -172,3 +172,37 @@
  void guestfs_free_dirent (struct guestfs_free_dirent *);
  void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);
 
+=head2 guestfs_version
+
+ struct guestfs_version {
+   int64_t major;
+   int64_t minor;
+   int64_t release;
+   char *extra;
+ };
+ 
+ struct guestfs_version_list {
+   uint32_t len; /* Number of elements in list. */
+   struct guestfs_version *val; /* Elements. */
+ };
+ 
+ void guestfs_free_version (struct guestfs_free_version *);
+ void guestfs_free_version_list (struct guestfs_free_version_list *);
+
+=head2 guestfs_xattr
+
+ struct guestfs_xattr {
+   char *attrname;
+   /* The next two fields describe a byte array. */
+   uint32_t attrval_len;
+   char *attrval;
+ };
+ 
+ struct guestfs_xattr_list {
+   uint32_t len; /* Number of elements in list. */
+   struct guestfs_xattr *val; /* Elements. */
+ };
+ 
+ void guestfs_free_xattr (struct guestfs_free_xattr *);
+ void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);
+
diff --git a/haskell/Guestfs.hs b/haskell/Guestfs.hs
index 611a8b6..ccbbee1 100644
--- a/haskell/Guestfs.hs
+++ b/haskell/Guestfs.hs
@@ -133,7 +133,11 @@ module Guestfs (
   mknod_b,
   mknod_c,
   umask,
-  sfdiskM
+  sfdiskM,
+  setxattr,
+  lsetxattr,
+  removexattr,
+  lremovexattr
   ) where
 import Foreign
 import Foreign.C
@@ -1504,3 +1508,51 @@ sfdiskM h device lines = do
       fail err
     else return ()
 
+foreign import ccall unsafe "guestfs_setxattr" c_setxattr
+  :: GuestfsP -> CString -> CString -> CInt -> CString -> IO (CInt)
+
+setxattr :: GuestfsH -> String -> String -> Int -> String -> IO ()
+setxattr h xattr val vallen path = do
+  r <- withCString xattr $ \xattr -> withCString val $ \val -> withCString path $ \path -> withForeignPtr h (\p -> c_setxattr p xattr val (fromIntegral vallen) path)
+  if (r == -1)
+    then do
+      err <- last_error h
+      fail err
+    else return ()
+
+foreign import ccall unsafe "guestfs_lsetxattr" c_lsetxattr
+  :: GuestfsP -> CString -> CString -> CInt -> CString -> IO (CInt)
+
+lsetxattr :: GuestfsH -> String -> String -> Int -> String -> IO ()
+lsetxattr h xattr val vallen path = do
+  r <- withCString xattr $ \xattr -> withCString val $ \val -> withCString path $ \path -> withForeignPtr h (\p -> c_lsetxattr p xattr val (fromIntegral vallen) path)
+  if (r == -1)
+    then do
+      err <- last_error h
+      fail err
+    else return ()
+
+foreign import ccall unsafe "guestfs_removexattr" c_removexattr
+  :: GuestfsP -> CString -> CString -> IO (CInt)
+
+removexattr :: GuestfsH -> String -> String -> IO ()
+removexattr h xattr path = do
+  r <- withCString xattr $ \xattr -> withCString path $ \path -> withForeignPtr h (\p -> c_removexattr p xattr path)
+  if (r == -1)
+    then do
+      err <- last_error h
+      fail err
+    else return ()
+
+foreign import ccall unsafe "guestfs_lremovexattr" c_lremovexattr
+  :: GuestfsP -> CString -> CString -> IO (CInt)
+
+lremovexattr :: GuestfsH -> String -> String -> IO ()
+lremovexattr h xattr path = do
+  r <- withCString xattr $ \xattr -> withCString path $ \path -> withForeignPtr h (\p -> c_lremovexattr p xattr path)
+  if (r == -1)
+    then do
+      err <- last_error h
+      fail err
+    else return ()
+
diff --git a/haskell/Makefile.in b/haskell/Makefile.in
index c3c30ed..f5f36b7 100644
--- a/haskell/Makefile.in
+++ b/haskell/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -32,8 +33,9 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -64,8 +66,11 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -264,9 +269,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  haskell/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  haskell/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign haskell/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign haskell/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -284,6 +289,7 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -301,6 +307,7 @@ check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
 	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
@@ -312,10 +319,10 @@ check-TESTS: $(TESTS)
 	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
@@ -323,17 +330,18 @@ check-TESTS: $(TESTS)
 	      case " $(XFAIL_TESTS) " in \
 	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
 	  if test "$$all" -eq 1; then \
 	    tests="test"; \
@@ -375,11 +383,15 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    echo "$$grn$$dashes"; \
+	  else \
+	    echo "$$red$$dashes"; \
+	  fi; \
 	  echo "$$banner"; \
 	  test -z "$$skipped" || echo "$$skipped"; \
 	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  echo "$$dashes$$std"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
@@ -399,13 +411,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -436,6 +452,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -454,6 +471,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -462,18 +481,28 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -494,7 +523,7 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
 
 .PHONY: all all-am check check-TESTS check-am clean clean-generic \
 	clean-libtool distclean distclean-generic distclean-libtool \
@@ -520,6 +549,7 @@ uninstall-am:
 
 @HAVE_HASKELL_TRUE at Guestfs050LVCreate: Guestfs050LVCreate.hs Guestfs.hs
 @HAVE_HASKELL_TRUE@	$(GHC)  $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/images/Makefile.in b/images/Makefile.in
index 570ed6d..040de42 100644
--- a/images/Makefile.in
+++ b/images/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -33,8 +34,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -65,6 +67,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
 DATA = $(noinst_DATA)
@@ -285,9 +288,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  images/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  images/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign images/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign images/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -305,6 +308,7 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -334,13 +338,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -369,6 +377,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -387,6 +396,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -395,18 +406,28 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -481,6 +502,7 @@ $(builddir)/initrd: empty known-1 known-2 known-3
 	rm -f $@ $@-t
 	for f in $^; do echo $$f; done | cpio -o -H newc | gzip --best > $@-t
 	mv $@-t $@
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/inspector/Makefile.in b/inspector/Makefile.in
index fa379e6..91a18ff 100644
--- a/inspector/Makefile.in
+++ b/inspector/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -33,8 +34,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -65,8 +67,30 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
@@ -266,9 +290,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  inspector/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  inspector/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign inspector/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign inspector/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -286,57 +310,51 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 mostlyclean-libtool:
 	-rm -f *.lo
 
 clean-libtool:
 	-rm -rf .libs _libs
-install-man1: $(man1_MANS) $(man_MANS)
+install-man1: $(man_MANS)
 	@$(NORMAL_INSTALL)
 	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.1*) list="$$list $$i" ;; \
-	  esac; \
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+	  fi; \
 	done; \
-	for i in $$list; do \
-	  if test -f $$i; then file=$$i; \
-	  else file=$(srcdir)/$$i; fi; \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    1*) ;; \
-	    *) ext='1' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
-	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
-	done
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+	done; }
+
 uninstall-man1:
 	@$(NORMAL_UNINSTALL)
-	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.1*) list="$$list $$i" ;; \
-	  esac; \
-	done; \
-	for i in $$list; do \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    1*) ;; \
-	    *) ext='1' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
-	  rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
-	done
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
 tags: TAGS
 TAGS:
 
@@ -345,6 +363,19 @@ CTAGS:
 
 
 distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -360,13 +391,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -397,6 +432,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -416,6 +452,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -423,21 +461,30 @@ info-am:
 install-data-am: install-man
 	@$(NORMAL_INSTALL)
 	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man: install-man1
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -494,6 +541,7 @@ uninstall-man: uninstall-man1
 @HAVE_INSPECTOR_TRUE at install-data-hook:
 @HAVE_INSPECTOR_TRUE@	mkdir -p $(DESTDIR)$(bindir)
 @HAVE_INSPECTOR_TRUE@	install -m 0755 virt-inspector.pl $(DESTDIR)$(bindir)/virt-inspector
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/inspector/virt-inspector.pl b/inspector/virt-inspector.pl
index 3557a38..3754ced 100755
--- a/inspector/virt-inspector.pl
+++ b/inspector/virt-inspector.pl
@@ -20,16 +20,16 @@ use warnings;
 use strict;
 
 use Sys::Guestfs;
+use Sys::Guestfs::Lib qw(open_guest get_partitions resolve_windows_path
+  inspect_all_partitions inspect_partition
+  inspect_operating_systems mount_operating_system inspect_in_detail);
 use Pod::Usage;
 use Getopt::Long;
 use Data::Dumper;
-use File::Temp qw/tempdir/;
 use XML::Writer;
+use Locale::TextDomain 'libguestfs';
 
 # Optional:
-eval "use Sys::Virt;";
-eval "use XML::XPath;";
-eval "use XML::XPath::XMLParser;";
 eval "use YAML::Any;";
 
 =encoding utf8
@@ -89,6 +89,14 @@ Display brief help.
 
 =cut
 
+my $version;
+
+=item B<--version>
+
+Display version number and exit.
+
+=cut
+
 my $uri;
 
 =item B<--connect URI> | B<-c URI>
@@ -102,18 +110,6 @@ then libvirt is not used at all.
 
 =cut
 
-my $force;
-
-=item B<--force>
-
-Force reading a particular guest even if it appears to be active.  In
-earlier versions of virt-inspector, this could be dangerous (for
-example, corrupting the guest's disk image).  However in more recent
-versions, it should not cause corruption, but might cause
-virt-inspector to crash or produce incorrect results.
-
-=cut
-
 my $output = "text";
 
 =back
@@ -185,8 +181,8 @@ default.
 =cut
 
 GetOptions ("help|?" => \$help,
+	    "version" => \$version,
 	    "connect|c=s" => \$uri,
-	    "force" => \$force,
 	    "text" => sub { $output = "text" },
 	    "none" => sub { $output = "none" },
 	    "xml" => sub { $output = "xml" },
@@ -200,81 +196,26 @@ GetOptions ("help|?" => \$help,
 	    "windows-registry" => \$windows_registry,
     ) or pod2usage (2);
 pod2usage (1) if $help;
-pod2usage ("$0: no image or VM names given") if @ARGV == 0;
-
-# Domain name or guest image(s)?
-
-my @images;
-if (-e $ARGV[0]) {
-    @images = @ARGV;
-
-    foreach (@images) {
-	if (! -r $_) {
-	    die "guest image $_ does not exist or is not readable\n"
-	}
-    }
+if ($version) {
+    my $g = Sys::Guestfs->new ();
+    my %h = $g->version ();
+    print "$h{major}.$h{minor}.$h{release}$h{extra}\n";
+    exit
+}
+pod2usage (__"virt-inspector: no image or VM names given") if @ARGV == 0;
+
+my $rw = 0;
+$rw = 1 if $output eq "fish";
+my $g;
+if ($uri) {
+    $g = open_guest (\@ARGV, rw => $rw, address => $uri);
 } else {
-    die "virt-inspector: no libvirt support (install Sys::Virt, XML::XPath and XML::XPath::XMLParser)\n"
-	unless exists $INC{"Sys/Virt.pm"} &&
-	exists $INC{"XML/XPath.pm"} &&
-	exists $INC{"XML/XPath/XMLParser.pm"};
-
-    pod2usage ("$0: too many domains listed on command line") if @ARGV > 1;
-
-    my $vmm;
-    if (defined $uri) {
-	$vmm = Sys::Virt->new (uri => $uri, readonly => 1);
-    } else {
-	$vmm = Sys::Virt->new (readonly => 1);
-    }
-    die "cannot connect to libvirt $uri\n" unless $vmm;
-
-    my @doms = $vmm->list_defined_domains ();
-    my $isitinactive = "an inactive libvirt domain";
-    if ($output ne "fish") {
-	# In the special case where we want read-only access to
-	# a domain, allow the user to specify an active domain too.
-	push @doms, $vmm->list_domains ();
-	$isitinactive = "a libvirt domain";
-    }
-    my $dom;
-    foreach (@doms) {
-	if ($_->get_name () eq $ARGV[0]) {
-	    $dom = $_;
-	    last;
-	}
-    }
-    die "$ARGV[0] is not the name of $isitinactive\n" unless $dom;
-
-    # Get the names of the image(s).
-    my $xml = $dom->get_xml_description ();
-
-    my $p = XML::XPath->new (xml => $xml);
-    my @disks = $p->findnodes ('//devices/disk/source/@dev');
-    @images = map { $_->getData } @disks;
+    $g = open_guest (\@ARGV, rw => $rw);
 }
 
-# We've now got the list of @images, so feed them to libguestfs.
-my $g = Sys::Guestfs->new ();
-$g->add_drive_ro ($_) foreach @images;
 $g->launch ();
 $g->wait_ready ();
 
-# We want to get the list of LVs and partitions (ie. anything that
-# could contain a filesystem).  Discard any partitions which are PVs.
-my @partitions = $g->list_partitions ();
-my @pvs = $g->pvs ();
-sub is_pv {
-    my $t = shift;
-    foreach (@pvs) {
-	return 1 if $_ eq $t;
-    }
-    0;
-}
- at partitions = grep { ! is_pv ($_) } @partitions;
-
-my @lvs = $g->lvs ();
-
 =head1 OUTPUT FORMAT
 
  Operating system(s)
@@ -318,629 +259,42 @@ right place.  For example:
 =cut
 
 # List of possible filesystems.
-my @devices = sort (@lvs, @partitions);
+my @partitions = get_partitions ($g);
 
 # Now query each one to build up a picture of what's in it.
-my %fses = map { $_ => check_fs ($_) } @devices;
-
-# Now the complex checking code itself.
-# check_fs takes a device name (LV or partition name) and returns
-# a hashref containing everything we can find out about the device.
-sub check_fs {
-    local $_;
-    my $dev = shift;		# LV or partition name.
-
-    my %r;			# Result hash.
-
-    # First try 'file(1)' on it.
-    my $file = $g->file ($dev);
-    if ($file =~ /ext2 filesystem data/) {
-	$r{fstype} = "ext2";
-	$r{fsos} = "linux";
-    } elsif ($file =~ /ext3 filesystem data/) {
-	$r{fstype} = "ext3";
-	$r{fsos} = "linux";
-    } elsif ($file =~ /ext4 filesystem data/) {
-	$r{fstype} = "ext4";
-	$r{fsos} = "linux";
-    } elsif ($file =~ m{Linux/i386 swap file}) {
-	$r{fstype} = "swap";
-	$r{fsos} = "linux";
-	$r{is_swap} = 1;
-    }
-
-    # If it's ext2/3/4, then we want the UUID and label.
-    if (exists $r{fstype} && $r{fstype} =~ /^ext/) {
-	$r{uuid} = $g->get_e2uuid ($dev);
-	$r{label} = $g->get_e2label ($dev);
-    }
-
-    # Try mounting it, fnarrr.
-    if (!$r{is_swap}) {
-	$r{is_mountable} = 1;
-	eval { $g->mount_ro ($dev, "/") };
-	if ($@) {
-	    # It's not mountable, probably empty or some format
-	    # we don't understand.
-	    $r{is_mountable} = 0;
-	    goto OUT;
-	}
-
-	# Grub /boot?
-	if ($g->is_file ("/grub/menu.lst") ||
-	    $g->is_file ("/grub/grub.conf")) {
-	    $r{content} = "linux-grub";
-	    check_grub (\%r);
-	    goto OUT;
-	}
-
-	# Linux root?
-	if ($g->is_dir ("/etc") && $g->is_dir ("/bin") &&
-	    $g->is_file ("/etc/fstab")) {
-	    $r{content} = "linux-root";
-	    $r{is_root} = 1;
-	    check_linux_root (\%r);
-	    goto OUT;
-	}
-
-	# Linux /usr/local.
-	if ($g->is_dir ("/etc") && $g->is_dir ("/bin") &&
-	    $g->is_dir ("/share") && !$g->exists ("/local") &&
-	    !$g->is_file ("/etc/fstab")) {
-	    $r{content} = "linux-usrlocal";
-	    goto OUT;
-	}
-
-	# Linux /usr.
-	if ($g->is_dir ("/etc") && $g->is_dir ("/bin") &&
-	    $g->is_dir ("/share") && $g->exists ("/local") &&
-	    !$g->is_file ("/etc/fstab")) {
-	    $r{content} = "linux-usr";
-	    goto OUT;
-	}
-
-	# Windows root?
-	if ($g->is_file ("/AUTOEXEC.BAT") ||
-	    $g->is_file ("/autoexec.bat") ||
-	    $g->is_dir ("/Program Files") ||
-	    $g->is_dir ("/WINDOWS") ||
-	    $g->is_file ("/boot.ini") ||
-	    $g->is_file ("/ntldr")) {
-	    $r{fstype} = "ntfs"; # XXX this is a guess
-	    $r{fsos} = "windows";
-	    $r{content} = "windows-root";
-	    $r{is_root} = 1;
-	    check_windows_root (\%r);
-	    goto OUT;
-	}
-    }
-
-  OUT:
-    $g->umount_all ();
-    return \%r;
-}
-
-sub check_linux_root
-{
-    local $_;
-    my $r = shift;
-
-    # Look into /etc to see if we recognise the operating system.
-    if ($g->is_file ("/etc/redhat-release")) {
-	$_ = $g->cat ("/etc/redhat-release");
-	if (/Fedora release (\d+\.\d+)/) {
-	    $r->{osdistro} = "fedora";
-	    $r->{osversion} = "$1"
-	} elsif (/(Red Hat Enterprise Linux|CentOS|Scientific Linux).*release (\d+).*Update (\d+)/) {
-	    $r->{osdistro} = "redhat";
-	    $r->{osversion} = "$2.$3";
-        } elsif (/(Red Hat Enterprise Linux|CentOS|Scientific Linux).*release (\d+(?:\.(\d+))?)/) {
-	    $r->{osdistro} = "redhat";
-	    $r->{osversion} = "$2";
-	} else {
-	    $r->{osdistro} = "redhat";
-	}
-    } elsif ($g->is_file ("/etc/debian_version")) {
-	$_ = $g->cat ("/etc/debian_version");
-	if (/(\d+\.\d+)/) {
-	    $r->{osdistro} = "debian";
-	    $r->{osversion} = "$1";
-	} else {
-	    $r->{osdistro} = "debian";
-	}
-    }
-
-    # Parse the contents of /etc/fstab.  This is pretty vital so
-    # we can determine where filesystems are supposed to be mounted.
-    eval "\$_ = \$g->cat ('/etc/fstab');";
-    if (!$@ && $_) {
-	my @lines = split /\n/;
-	my @fstab;
-	foreach (@lines) {
-	    my @fields = split /[ \t]+/;
-	    if (@fields >= 2) {
-		my $spec = $fields[0]; # first column (dev/label/uuid)
-		my $file = $fields[1]; # second column (mountpoint)
-		if ($spec =~ m{^/} ||
-		    $spec =~ m{^LABEL=} ||
-		    $spec =~ m{^UUID=} ||
-		    $file eq "swap") {
-		    push @fstab, [$spec, $file]
-		}
-	    }
-	}
-	$r->{fstab} = \@fstab if @fstab;
-    }
-}
-
-# We only support NT.  The control file /boot.ini contains a list of
-# Windows installations and their %systemroot%s in a simple text
-# format.
-#
-# XXX We could parse this better.  This won't work if /boot.ini is on
-# a different drive from the %systemroot%, and in other unusual cases.
-
-sub check_windows_root
-{
-    local $_;
-    my $r = shift;
-
-    my $boot_ini = resolve_windows_path ("/", "boot.ini");
-    $r->{boot_ini} = $boot_ini;
-
-    if (defined $r->{boot_ini}) {
-	$_ = $g->cat ($boot_ini);
-	my @lines = split /\n/;
-	my $section;
-	my $systemroot;
-	foreach (@lines) {
-	    if (m/\[.*\]/) {
-		$section = $1;
-	    } elsif (m/^default=.*?\\(\w+)$/i) {
-		$systemroot = $1;
-		last;
-	    } elsif (m/\\(\w+)=/) {
-		$systemroot = $1;
-		last;
-	    }
-	}
-
-	if (defined $systemroot) {
-	    $r->{systemroot} = resolve_windows_path ("/", $systemroot);
-	    if (defined $r->{systemroot} && $windows_registry) {
-		check_windows_registry ($r, $r->{systemroot});
-	    }
-	}
-    }
-}
+my %fses =
+    inspect_all_partitions ($g, \@partitions,
+      use_windows_registry => $windows_registry);
 
-sub check_windows_registry
-{
-    local $_;
-    my $r = shift;
-    my $systemroot = shift;
-
-    # Download the system registry files.  Only download the
-    # interesting ones, and we don't bother with user profiles at all.
-    my $system32 = resolve_windows_path ($systemroot, "system32");
-    if (defined $system32) {
-	my $config = resolve_windows_path ($system32, "config");
-	if (defined $config) {
-	    my $software = resolve_windows_path ($config, "software");
-	    if (defined $software) {
-		load_windows_registry ($r, $software,
-				       "HKEY_LOCAL_MACHINE\\SOFTWARE");
-	    }
-	    my $system = resolve_windows_path ($config, "system");
-	    if (defined $system) {
-		load_windows_registry ($r, $system,
-				       "HKEY_LOCAL_MACHINE\\System");
-	    }
-	}
-    }
-}
+#print "fses -----------\n";
+#print Dumper(\%fses);
 
-sub load_windows_registry
-{
-    local $_;
-    my $r = shift;
-    my $regfile = shift;
-    my $prefix = shift;
-
-    my $dir = tempdir (CLEANUP => 1);
-
-    $g->download ($regfile, "$dir/reg");
-
-    # 'reged' command is particularly noisy.  Redirect stdout and
-    # stderr to /dev/null temporarily.
-    open SAVEOUT, ">&STDOUT";
-    open SAVEERR, ">&STDERR";
-    open STDOUT, ">/dev/null";
-    open STDERR, ">/dev/null";
-
-    my @cmd = ("reged", "-x", "$dir/reg", "$prefix", "\\", "$dir/out");
-    my $res = system (@cmd);
-
-    close STDOUT;
-    close STDERR;
-    open STDOUT, ">&SAVEOUT";
-    open STDERR, ">&SAVEERR";
-    close SAVEOUT;
-    close SAVEERR;
-
-    unless ($res == 0) {
-	warn "reged command failed: $?";
-	return;
-    }
+my $oses = inspect_operating_systems ($g, \%fses);
 
-    # Some versions of reged segfault on inputs.  If that happens we
-    # may get no / partial output file.  Anyway, if it exists, load
-    # it.
-    my $content;
-    unless (open F, "$dir/out") {
-	warn "no output from reged command: $!";
-	return;
-    }
-    { local $/ = undef; $content = <F>; }
-    close F;
+#print "oses -----------\n";
+#print Dumper($oses);
 
-    my @registry = ();
-    @registry = @{$r->{registry}} if exists $r->{registry};
-    push @registry, $content;
-    $r->{registry} = \@registry;
-}
-
-# Because of case sensitivity, the actual path might have a different
-# name, and ntfs-3g is always case sensitive.  Find out what the real
-# path is.  Returns the correct full path, or undef.
-sub resolve_windows_path
-{
-    local $_;
-    my $parent = shift;		# Must exist, with correct case.
-    my $dir = shift;
-
-    foreach ($g->ls ($parent)) {
-	if (lc ($_) eq lc ($dir)) {
-	    if ($parent eq "/") {
-		return "/$_"
-	    } else {
-		return "$parent/$_"
-	    }
-	}
-    }
-
-    undef;
-}
-
-sub check_grub
-{
-    local $_;
-    my $r = shift;
-
-    # Grub version, if we care.
-}
-
-#print Dumper (\%fses);
-
-#----------------------------------------------------------------------
-# Now find out how many operating systems we've got.  Usually just one.
-
-my %oses = ();
-
-foreach (sort keys %fses) {
-    if ($fses{$_}->{is_root}) {
-	my %r = (
-	    root => $fses{$_},
-	    root_device => $_
-	);
-	get_os_version (\%r);
-	assign_mount_points (\%r);
-	$oses{$_} = \%r;
-    }
-}
-
-sub get_os_version
-{
-    local $_;
-    my $r = shift;
-
-    $r->{os} = $r->{root}->{fsos} if exists $r->{root}->{fsos};
-    $r->{distro} = $r->{root}->{osdistro} if exists $r->{root}->{osdistro};
-    $r->{version} = $r->{root}->{osversion} if exists $r->{root}->{osversion};
-}
-
-sub assign_mount_points
-{
-    local $_;
-    my $r = shift;
-
-    $r->{mounts} = { "/" => $r->{root_device} };
-    $r->{filesystems} = { $r->{root_device} => $r->{root} };
-
-    # Use /etc/fstab if we have it to mount the rest.
-    if (exists $r->{root}->{fstab}) {
-	my @fstab = @{$r->{root}->{fstab}};
-	foreach (@fstab) {
-	    my ($spec, $file) = @$_;
-
-	    my ($dev, $fs) = find_filesystem ($spec);
-	    if ($dev) {
-		$r->{mounts}->{$file} = $dev;
-		$r->{filesystems}->{$dev} = $fs;
-		if (exists $fs->{used}) {
-		    $fs->{used}++
-		} else {
-		    $fs->{used} = 1
-	        }
-                $fs->{spec} = $spec;
-	    }
-	}
-    }
-}
-
-# Find filesystem by device name, LABEL=.. or UUID=..
-sub find_filesystem
-{
-    local $_ = shift;
-
-    if (/^LABEL=(.*)/) {
-	my $label = $1;
-	foreach (sort keys %fses) {
-	    if (exists $fses{$_}->{label} &&
-		$fses{$_}->{label} eq $label) {
-		return ($_, $fses{$_});
-	    }
-	}
-	warn "unknown filesystem label $label\n";
-	return ();
-    } elsif (/^UUID=(.*)/) {
-	my $uuid = $1;
-	foreach (sort keys %fses) {
-	    if (exists $fses{$_}->{uuid} &&
-		$fses{$_}->{uuid} eq $uuid) {
-		return ($_, $fses{$_});
-	    }
-	}
-	warn "unknown filesystem UUID $uuid\n";
-	return ();
-    } else {
-	return ($_, $fses{$_}) if exists $fses{$_};
-
-        # The following is to handle the case where an fstab entry specifies a
-        # specific device rather than its label or uuid, and the libguestfs
-        # appliance has named the device differently due to the use of a
-        # different driver.
-        # This will work as long as the underlying drivers recognise devices in
-        # the same order.
-	if (m{^/dev/hd(.*)} && exists $fses{"/dev/sd$1"}) {
-	    return ("/dev/sd$1", $fses{"/dev/sd$1"});
-	}
-	if (m{^/dev/xvd(.*)} && exists $fses{"/dev/sd$1"}) {
-	    return ("/dev/sd$1", $fses{"/dev/sd$1"});
-	}
-
-	return () if m{/dev/cdrom};
-
-	warn "unknown filesystem $_\n";
-	return ();
-    }
-}
-
-#print Dumper(\%oses);
-
-#----------------------------------------------------------------------
 # Mount up the disks so we can check for applications
 # and kernels.  Skip this if the output is "*fish" because
 # we don't need to know.
 
 if ($output !~ /.*fish$/) {
     my $root_dev;
-    foreach $root_dev (sort keys %oses) {
-	my $mounts = $oses{$root_dev}->{mounts};
-	# Have to mount / first.  Luckily '/' is early in the ASCII
-	# character set, so this should be OK.
-	foreach (sort keys %$mounts) {
-	    $g->mount_ro ($mounts->{$_}, $_)
-		if $_ ne "swap" && ($_ eq '/' || $g->is_dir ($_));
-	}
-
-	check_for_applications ($root_dev);
-	check_for_kernels ($root_dev);
-	if ($oses{$root_dev}->{os} eq "linux") {
-	    check_for_modprobe_aliases ($root_dev);
-	    check_for_initrd ($root_dev);
-	}
-
+    foreach $root_dev (sort keys %$oses) {
+	my $os = $oses->{$root_dev};
+	mount_operating_system ($g, $os);
+	inspect_in_detail ($g, $os);
 	$g->umount_all ();
     }
 }
 
-sub check_for_applications
-{
-    local $_;
-    my $root_dev = shift;
-
-    my @apps;
-
-    my $os = $oses{$root_dev}->{os};
-    if ($os eq "linux") {
-	my $distro = $oses{$root_dev}->{distro};
-	if (defined $distro && ($distro eq "redhat" || $distro eq "fedora")) {
-	    my @lines = $g->command_lines
-		(["rpm",
-		  "-q", "-a",
-		  "--qf", "%{name} %{epoch} %{version} %{release} %{arch}\n"]);
-	    foreach (@lines) {
-		if (m/^(.*) (.*) (.*) (.*) (.*)$/) {
-		    my $epoch = $2;
-		    $epoch = "" if $epoch eq "(none)";
-		    my $app = {
-			name => $1,
-			epoch => $epoch,
-			version => $3,
-			release => $4,
-			arch => $5
-		    };
-		    push @apps, $app
-		}
-	    }
-	}
-    } elsif ($os eq "windows") {
-	# XXX
-	# I worked out a general plan for this, but haven't
-	# implemented it yet.  We can iterate over /Program Files
-	# looking for *.EXE files, which we download, then use
-	# i686-pc-mingw32-windres on, to find the VERSIONINFO
-	# section, which has a lot of useful information.
-    }
-
-    $oses{$root_dev}->{apps} = \@apps;
-}
-
-sub check_for_kernels
-{
-    local $_;
-    my $root_dev = shift;
-
-    my @kernels;
-
-    my $os = $oses{$root_dev}->{os};
-    if ($os eq "linux") {
-	# Installed kernels will have a corresponding /lib/modules/<version>
-	# directory, which is the easiest way to find out what kernels
-	# are installed, and what modules are available.
-	foreach ($g->ls ("/lib/modules")) {
-	    if ($g->is_dir ("/lib/modules/$_")) {
-		my %kernel;
-		$kernel{version} = $_;
-
-		# List modules.
-		my @modules;
-		foreach ($g->find ("/lib/modules/$_")) {
-		    if (m,/([^/]+)\.ko$, || m,([^/]+)\.o$,) {
-			push @modules, $1;
-		    }
-		}
-
-		$kernel{modules} = \@modules;
-
-		push @kernels, \%kernel;
-	    }
-	}
-
-    } elsif ($os eq "windows") {
-	# XXX
-    }
-
-    $oses{$root_dev}->{kernels} = \@kernels;
-}
-
-# Check /etc/modprobe.conf to see if there are any specified
-# drivers associated with network (ethX) or hard drives.  Normally
-# one might find something like:
-#
-#  alias eth0 xennet
-#  alias scsi_hostadapter xenblk
-#
-# XXX This doesn't look beyond /etc/modprobe.conf, eg. in /etc/modprobe.d/
-
-sub check_for_modprobe_aliases
-{
-    local $_;
-    my $root_dev = shift;
-
-    # Initialise augeas
-    my $success = 0;
-    $success = $g->aug_init("/", 16);
-
-    # Register /etc/modules.conf and /etc/conf.modules to the Modprobe lens
-    my @results;
-    @results = $g->aug_match("/augeas/load/Modprobe/incl");
-
-    # Calculate the next index of /augeas/load/Modprobe/incl
-    my $i = 1;
-    foreach ( @results ) {
-        next unless m{/augeas/load/Modprobe/incl\[(\d*)]};
-        $i = $1 + 1 if ($1 == $i);
-    }
-
-    $success = $g->aug_set("/augeas/load/Modprobe/incl[$i]",
-                           "/etc/modules.conf");
-    $i++;
-    $success = $g->aug_set("/augeas/load/Modprobe/incl[$i]",
-                                  "/etc/conf.modules");
-
-    # Make augeas reload
-    $success = $g->aug_load();
-
-    my %modprobe_aliases;
-
-    for my $pattern qw(/files/etc/conf.modules/alias
-                       /files/etc/modules.conf/alias
-                       /files/etc/modprobe.conf/alias
-                       /files/etc/modprobe.d/*/alias) {
-        @results = $g->aug_match($pattern);
-
-        for my $path ( @results ) {
-            $path =~ m{^/files(.*)/alias(?:\[\d*\])?$}
-                or die("$path doesn't match augeas pattern");
-            my $file = $1;
-
-            my $alias;
-            $alias = $g->aug_get($path);
-
-            my $modulename;
-            $modulename = $g->aug_get($path.'/modulename');
-
-            my %aliasinfo;
-            $aliasinfo{modulename} = $modulename;
-            $aliasinfo{augeas} = $path;
-            $aliasinfo{file} = $file;
-
-            $modprobe_aliases{$alias} = \%aliasinfo;
-        }
-    }
-
-    $oses{$root_dev}->{modprobe_aliases} = \%modprobe_aliases;
-}
-
-# Get a listing of device drivers in any initrd corresponding to a
-# kernel.  This is an indication of what can possibly be booted.
-
-sub check_for_initrd
-{
-    local $_;
-    my $root_dev = shift;
-
-    my %initrd_modules;
-
-    foreach my $initrd ($g->ls ("/boot")) {
-	if ($initrd =~ m/^initrd-(.*)\.img$/ && $g->is_file ("/boot/$initrd")) {
-	    my $version = $1;
-	    my @modules;
-
-	    eval {
-		@modules = $g->initrd_list ("/boot/$initrd");
-	    };
-	    unless ($@) {
-		@modules = grep { m,([^/]+)\.ko$, || m,([^/]+)\.o$, } @modules;
-		$initrd_modules{$version} = \@modules
-	    } else {
-		warn "/boot/$initrd: could not read initrd format"
-	    }
-	}
-    }
-
-    $oses{$root_dev}->{initrd_modules} = \%initrd_modules;
-}
-
 #----------------------------------------------------------------------
 # Output.
 
 if ($output eq "fish" || $output eq "ro-fish") {
-    my @osdevs = keys %oses;
+    my @osdevs = keys %$oses;
     # This only works if there is a single OS.
-    die "--fish output is only possible with a single OS\n" if @osdevs != 1;
+    die __"--fish output is only possible with a single OS\n" if @osdevs != 1;
 
     my $root_dev = $osdevs[0];
 
@@ -948,28 +302,28 @@ if ($output eq "fish" || $output eq "ro-fish") {
 	print "--ro ";
     }
 
-    print "-a $_ " foreach @images;
+    print "-a $_ " foreach @ARGV;
 
-    my $mounts = $oses{$root_dev}->{mounts};
+    my $mounts = $oses->{$root_dev}->{mounts};
     # Have to mount / first.  Luckily '/' is early in the ASCII
     # character set, so this should be OK.
     foreach (sort keys %$mounts) {
-	print "-m $mounts->{$_}:$_ " if $_ ne "swap";
+	print "-m $mounts->{$_}:$_ " if $_ ne "swap" && $_ ne "none";
     }
     print "\n"
 }
 
 # Perl output.
 elsif ($output eq "perl") {
-    print Dumper(\%oses);
+    print Dumper(%$oses);
 }
 
 # YAML output
 elsif ($output eq "yaml") {
-    die "virt-inspector: no YAML support\n"
+    die __"virt-inspector: no YAML support\n"
 	unless exists $INC{"YAML/Any.pm"};
 
-    print Dump(\%oses);
+    print Dump(%$oses);
 }
 
 # Plain text output (the default).
@@ -989,7 +343,7 @@ elsif ($output eq "query") {
 
 sub output_text
 {
-    output_text_os ($oses{$_}) foreach sort keys %oses;
+    output_text_os ($oses->{$_}) foreach sort keys %$oses;
 }
 
 sub output_text_os
@@ -1001,13 +355,13 @@ sub output_text_os
     print $os->{version}, " " if exists $os->{version};
     print "on ", $os->{root_device}, ":\n";
 
-    print "  Mountpoints:\n";
+    print __"  Mountpoints:\n";
     my $mounts = $os->{mounts};
     foreach (sort keys %$mounts) {
 	printf "    %-30s %s\n", $mounts->{$_}, $_
     }
 
-    print "  Filesystems:\n";
+    print __"  Filesystems:\n";
     my $filesystems = $os->{filesystems};
     foreach (sort keys %$filesystems) {
 	print "    $_:\n";
@@ -1025,7 +379,7 @@ sub output_text_os
 	my %aliases = %{$os->{modprobe_aliases}};
 	my @keys = sort keys %aliases;
 	if (@keys) {
-	    print "  Modprobe aliases:\n";
+	    print __"  Modprobe aliases:\n";
 	    foreach (@keys) {
 		printf "    %-30s %s\n", $_, $aliases{$_}->{modulename}
 	    }
@@ -1036,7 +390,7 @@ sub output_text_os
 	my %modvers = %{$os->{initrd_modules}};
 	my @keys = sort keys %modvers;
 	if (@keys) {
-	    print "  Initrd modules:\n";
+	    print __"  Initrd modules:\n";
 	    foreach (@keys) {
 		my @modules = @{$modvers{$_}};
 		print "    $_:\n";
@@ -1045,13 +399,13 @@ sub output_text_os
 	}
     }
 
-    print "  Applications:\n";
+    print __"  Applications:\n";
     my @apps =  @{$os->{apps}};
     foreach (@apps) {
 	print "    $_->{name} $_->{version}\n"
     }
 
-    print "  Kernels:\n";
+    print __"  Kernels:\n";
     my @kernels = @{$os->{kernels}};
     foreach (@kernels) {
 	print "    $_->{version}\n";
@@ -1062,7 +416,7 @@ sub output_text_os
     }
 
     if (exists $os->{root}->{registry}) {
-	print "  Windows Registry entries:\n";
+	print __"  Windows Registry entries:\n";
 	# These are just lumps of text - dump them out.
 	foreach (@{$os->{root}->{registry}}) {
 	    print "$_\n";
@@ -1075,7 +429,7 @@ sub output_xml
     my $xml = new XML::Writer(DATA_MODE => 1, DATA_INDENT => 2);
 
     $xml->startTag("operatingsystems");
-    output_xml_os ($oses{$_}, $xml) foreach sort keys %oses;
+    output_xml_os ($oses->{$_}, $xml) foreach sort keys %$oses;
     $xml->endTag("operatingsystems");
 
     $xml->end();
@@ -1238,8 +592,8 @@ Answer C<yes> if Microsoft Windows is installed in the guest.
 sub output_query_windows
 {
     my $windows = "no";
-    foreach my $os (keys %oses) {
-	$windows="yes" if $oses{$os}->{os} eq "windows";
+    foreach my $os (keys %$oses) {
+	$windows="yes" if $oses->{$os}->{os} eq "windows";
     }
     print "windows=$windows\n";
 }
@@ -1253,8 +607,8 @@ Answer C<yes> if a Linux kernel is installed in the guest.
 sub output_query_linux
 {
     my $linux = "no";
-    foreach my $os (keys %oses) {
-	$linux="yes" if $oses{$os}->{os} eq "linux";
+    foreach my $os (keys %$oses) {
+	$linux="yes" if $oses->{$os}->{os} eq "linux";
     }
     print "linux=$linux\n";
 }
@@ -1268,8 +622,8 @@ Answer C<yes> if the guest contains Red Hat Enterprise Linux.
 sub output_query_rhel
 {
     my $rhel = "no";
-    foreach my $os (keys %oses) {
-	$rhel="yes" if $oses{$os}->{os} eq "linux" && $oses{$os}->{distro} eq "redhat";
+    foreach my $os (keys %$oses) {
+	$rhel="yes" if $oses->{$os}->{os} eq "linux" && $oses->{$os}->{distro} eq "redhat";
     }
     print "rhel=$rhel\n";
 }
@@ -1283,8 +637,8 @@ Answer C<yes> if the guest contains the Fedora Linux distribution.
 sub output_query_fedora
 {
     my $fedora = "no";
-    foreach my $os (keys %oses) {
-	$fedora="yes" if $oses{$os}->{os} eq "linux" && $oses{$os}->{distro} eq "fedora";
+    foreach my $os (keys %$oses) {
+	$fedora="yes" if $oses->{$os}->{os} eq "linux" && $oses->{$os}->{distro} eq "fedora";
     }
     print "fedora=$fedora\n";
 }
@@ -1298,8 +652,8 @@ Answer C<yes> if the guest contains the Debian Linux distribution.
 sub output_query_debian
 {
     my $debian = "no";
-    foreach my $os (keys %oses) {
-	$debian="yes" if $oses{$os}->{os} eq "linux" && $oses{$os}->{distro} eq "debian";
+    foreach my $os (keys %$oses) {
+	$debian="yes" if $oses->{$os}->{os} eq "linux" && $oses->{$os}->{distro} eq "debian";
     }
     print "debian=$debian\n";
 }
@@ -1317,8 +671,8 @@ sub output_query_fullvirt
     # The assumption is full-virt, unless all installed kernels
     # are identified as paravirt.
     # XXX Fails on Windows guests.
-    foreach my $os (keys %oses) {
-	foreach my $kernel (@{$oses{$os}->{kernels}}) {
+    foreach my $os (keys %$oses) {
+	foreach my $kernel (@{$oses->{$os}->{kernels}}) {
 	    my $is_pv = $kernel->{version} =~ m/xen/;
 	    unless ($is_pv) {
 		print "fullvirt=yes\n";
@@ -1339,8 +693,8 @@ guest).
 
 sub output_query_xen_domU_kernel
 {
-    foreach my $os (keys %oses) {
-	foreach my $kernel (@{$oses{$os}->{kernels}}) {
+    foreach my $os (keys %$oses) {
+	foreach my $kernel (@{$oses->{$os}->{kernels}}) {
 	    my $is_xen = $kernel->{version} =~ m/xen/;
 	    if ($is_xen) {
 		print "xen_domU_kernel=yes\n";
@@ -1362,8 +716,8 @@ reasons).
 
 sub output_query_xen_pv_drivers
 {
-    foreach my $os (keys %oses) {
-	foreach my $kernel (@{$oses{$os}->{kernels}}) {
+    foreach my $os (keys %$oses) {
+	foreach my $kernel (@{$oses->{$os}->{kernels}}) {
 	    foreach my $module (@{$kernel->{modules}}) {
 		if ($module =~ m/xen-/) {
 		    print "xen_pv_drivers=yes\n";
@@ -1385,8 +739,8 @@ performance of KVM.
 
 sub output_query_virtio_drivers
 {
-    foreach my $os (keys %oses) {
-	foreach my $kernel (@{$oses{$os}->{kernels}}) {
+    foreach my $os (keys %$oses) {
+	foreach my $kernel (@{$oses->{$os}->{kernels}}) {
 	    foreach my $module (@{$kernel->{modules}}) {
 		if ($module =~ m/virtio_/) {
 		    print "virtio_drivers=yes\n";
@@ -1405,6 +759,7 @@ sub output_query_virtio_drivers
 L<guestfs(3)>,
 L<guestfish(1)>,
 L<Sys::Guestfs(3)>,
+L<Sys::Guestfs::Lib(3)>,
 L<Sys::Virt(3)>,
 L<http://libguestfs.org/>.
 
@@ -1415,6 +770,8 @@ from L<http://home.eunet.no/~pnordahl/ntpasswd/>.
 
 Richard W.M. Jones L<http://et.redhat.com/~rjones/>
 
+Matthew Booth L<mbooth at redhat.com>
+
 =head1 COPYRIGHT
 
 Copyright (C) 2009 Red Hat Inc.
diff --git a/java/Makefile.am b/java/Makefile.am
index f0db493..1352394 100644
--- a/java/Makefile.am
+++ b/java/Makefile.am
@@ -20,16 +20,12 @@ builddir ?= $(top_builddir)/java
 
 java_prefix = com/redhat/et/libguestfs
 
+# Pull in automatically generated built sources
+include $(builddir)/Makefile.inc
+
 java_sources = \
-	$(java_prefix)/LibGuestFSException.java \
-	$(java_prefix)/IntBool.java \
-	$(java_prefix)/PV.java \
-	$(java_prefix)/VG.java \
-	$(java_prefix)/LV.java \
-	$(java_prefix)/Stat.java \
-	$(java_prefix)/StatVFS.java \
-	$(java_prefix)/Dirent.java \
-	$(java_prefix)/GuestFS.java
+	$(java_built_sources) \
+	com/redhat/et/libguestfs/LibGuestFSException.java
 
 java_tests = \
 	Bindtests.java \
@@ -41,9 +37,10 @@ EXTRA_DIST = \
 	$(java_sources) \
 	$(java_tests) \
 	run-bindtests \
-	run-java-tests
+	run-java-tests \
+	Makefile.inc
 
-CLEANFILES = doc-stamp
+CLEANFILES = doc-stamp $(builddir)/com/redhat/et/libguestfs/*.class com_redhat_et_libguestfs_GuestFS.h *.class *.jar api/com/redhat/et/libguestfs/*.html api/*
 
 if HAVE_JAVA
 
diff --git a/java/Makefile.in b/java/Makefile.in
index cca7485..e76203d 100644
--- a/java/Makefile.in
+++ b/java/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -35,8 +36,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -67,15 +69,30 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = "$(DESTDIR)$(libdir)" \
 	"$(DESTDIR)$(libguestfs_jardir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
 @HAVE_JAVA_TRUE at libguestfs_jni_la_DEPENDENCIES =  \
 @HAVE_JAVA_TRUE@	$(top_builddir)/src/libguestfs.la
@@ -93,6 +110,7 @@ SCRIPTS = $(noinst_SCRIPTS)
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -104,10 +122,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libguestfs_jni_la_SOURCES)
 DIST_SOURCES = $(am__libguestfs_jni_la_SOURCES_DIST)
-libguestfs_jarDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(libguestfs_jar_DATA) $(noinst_DATA)
 ETAGS = etags
 CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -286,15 +305,8 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 java_prefix = com/redhat/et/libguestfs
 java_sources = \
-	$(java_prefix)/LibGuestFSException.java \
-	$(java_prefix)/IntBool.java \
-	$(java_prefix)/PV.java \
-	$(java_prefix)/VG.java \
-	$(java_prefix)/LV.java \
-	$(java_prefix)/Stat.java \
-	$(java_prefix)/StatVFS.java \
-	$(java_prefix)/Dirent.java \
-	$(java_prefix)/GuestFS.java
+	$(java_built_sources) \
+	com/redhat/et/libguestfs/LibGuestFSException.java
 
 java_tests = \
 	Bindtests.java \
@@ -306,9 +318,10 @@ EXTRA_DIST = \
 	$(java_sources) \
 	$(java_tests) \
 	run-bindtests \
-	run-java-tests
+	run-java-tests \
+	Makefile.inc
 
-CLEANFILES = doc-stamp
+CLEANFILES = doc-stamp $(builddir)/com/redhat/et/libguestfs/*.class com_redhat_et_libguestfs_GuestFS.h *.class *.jar api/com/redhat/et/libguestfs/*.html api/*
 
 # Java source.
 @HAVE_JAVA_TRUE at libguestfs_jardir = $(JAR_INSTALL_DIR)
@@ -351,9 +364,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  java/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  java/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign java/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign java/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -371,23 +384,28 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
 	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
 	  if test -f $$p; then \
-	    f=$(am__strip_dir) \
-	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
-	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+	    list2="$$list2 $$p"; \
 	  else :; fi; \
-	done
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
 
 uninstall-libLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  p=$(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
 	done
 
 clean-libLTLIBRARIES:
@@ -411,31 +429,31 @@ distclean-compile:
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
 libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.lo: com_redhat_et_libguestfs_GuestFS.c
- at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_jni_la_CFLAGS) $(CFLAGS) -MT libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.lo -MD -MP -MF $(DEPDIR)/libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.Tpo -c -o libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.lo `test -f 'com_redhat_et_libguestfs_GuestFS.c' || echo '$(srcdir)/'`com_redhat_et_libguestfs_GuestFS.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.Tpo $(DEPDIR)/libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.Plo
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_jni_la_CFLAGS) $(CFLAGS) -MT libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.lo -MD -MP -MF $(DEPDIR)/libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.Tpo -c -o libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.lo `test -f 'com_redhat_et_libguestfs_GuestFS.c' || echo '$(srcdir)/'`com_redhat_et_libguestfs_GuestFS.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.Tpo $(DEPDIR)/libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='com_redhat_et_libguestfs_GuestFS.c' object='libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_jni_la_CFLAGS) $(CFLAGS) -c -o libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.lo `test -f 'com_redhat_et_libguestfs_GuestFS.c' || echo '$(srcdir)/'`com_redhat_et_libguestfs_GuestFS.c
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_jni_la_CFLAGS) $(CFLAGS) -c -o libguestfs_jni_la-com_redhat_et_libguestfs_GuestFS.lo `test -f 'com_redhat_et_libguestfs_GuestFS.c' || echo '$(srcdir)/'`com_redhat_et_libguestfs_GuestFS.c
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -445,20 +463,23 @@ clean-libtool:
 install-libguestfs_jarDATA: $(libguestfs_jar_DATA)
 	@$(NORMAL_INSTALL)
 	test -z "$(libguestfs_jardir)" || $(MKDIR_P) "$(DESTDIR)$(libguestfs_jardir)"
-	@list='$(libguestfs_jar_DATA)'; for p in $$list; do \
+	@list='$(libguestfs_jar_DATA)'; test -n "$(libguestfs_jardir)" || list=; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(libguestfs_jarDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(libguestfs_jardir)/$$f'"; \
-	  $(libguestfs_jarDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(libguestfs_jardir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libguestfs_jardir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(libguestfs_jardir)" || exit $$?; \
 	done
 
 uninstall-libguestfs_jarDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(libguestfs_jar_DATA)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(libguestfs_jardir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(libguestfs_jardir)/$$f"; \
-	done
+	@list='$(libguestfs_jar_DATA)'; test -n "$(libguestfs_jardir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(libguestfs_jardir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(libguestfs_jardir)" && rm -f $$files
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -472,7 +493,7 @@ tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
@@ -480,29 +501,34 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -511,6 +537,7 @@ check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
 	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
@@ -522,10 +549,10 @@ check-TESTS: $(TESTS)
 	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
@@ -533,17 +560,18 @@ check-TESTS: $(TESTS)
 	      case " $(XFAIL_TESTS) " in \
 	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
 	  if test "$$all" -eq 1; then \
 	    tests="test"; \
@@ -585,11 +613,15 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    echo "$$grn$$dashes"; \
+	  else \
+	    echo "$$red$$dashes"; \
+	  fi; \
 	  echo "$$banner"; \
 	  test -z "$$skipped" || echo "$$skipped"; \
 	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  echo "$$dashes$$std"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
@@ -609,13 +641,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -650,6 +686,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -673,6 +710,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -680,21 +719,30 @@ info-am:
 install-data-am: install-libguestfs_jarDATA
 	@$(NORMAL_INSTALL)
 	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am: install-libLTLIBRARIES
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -717,7 +765,8 @@ ps-am:
 
 uninstall-am: uninstall-libLTLIBRARIES uninstall-libguestfs_jarDATA
 
-.MAKE: install-am install-data-am install-strip
+.MAKE: all check check-am install install-am install-data-am \
+	install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
 	clean-generic clean-libLTLIBRARIES clean-libtool ctags \
@@ -738,6 +787,9 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-libguestfs_jarDATA
 
 # Old RHEL 5 autoconf doesn't have builddir.
 builddir ?= $(top_builddir)/java
+
+# Pull in automatically generated built sources
+include $(builddir)/Makefile.inc
 @HAVE_JAVA_TRUE@$(libguestfs_jar_class_files): %.class: %.java
 @HAVE_JAVA_TRUE@	$(JAVAC) $(JAVAC_FLAGS) -d $(builddir) -classpath @srcdir@:$(builddir) -sourcepath @srcdir@:$(builddir) $<
 
@@ -768,6 +820,7 @@ builddir ?= $(top_builddir)/java
 # Tell version 3.79 and up of GNU make to not build goals in this
 # directory in parallel.
 .NOTPARALLEL:
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/java/Makefile.inc b/java/Makefile.inc
new file mode 100644
index 0000000..063cd43
--- /dev/null
+++ b/java/Makefile.inc
@@ -0,0 +1 @@
+java_built_sources = com/redhat/et/libguestfs/IntBool.java com/redhat/et/libguestfs/PV.java com/redhat/et/libguestfs/VG.java com/redhat/et/libguestfs/LV.java com/redhat/et/libguestfs/Stat.java com/redhat/et/libguestfs/StatVFS.java com/redhat/et/libguestfs/Dirent.java com/redhat/et/libguestfs/Version.java com/redhat/et/libguestfs/XAttr.java com/redhat/et/libguestfs/GuestFS.java
diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java
index 46ef1c8..79a8a1e 100644
--- a/java/com/redhat/et/libguestfs/GuestFS.java
+++ b/java/com/redhat/et/libguestfs/GuestFS.java
@@ -900,6 +900,48 @@ public HashMap<String,String> test0rhashtableerr ()
     throws LibGuestFSException;
 
   /**
+   * get the library version number
+   * <p>
+   * Return the libguestfs version number that the program is
+   * linked against.
+   * <p>
+   * Note that because of dynamic linking this is not
+   * necessarily the version of libguestfs that you compiled
+   * against. You can compile the program, and then at
+   * runtime dynamically link against a completely different
+   * "libguestfs.so" library.
+   * <p>
+   * This call was added in version 1.0.58. In previous
+   * versions of libguestfs there was no way to get the
+   * version number. From C code you can use ELF weak linking
+   * tricks to find out if this symbol exists (if it doesn't,
+   * then it's an earlier version).
+   * <p>
+   * The call returns a structure with four elements. The
+   * first three ("major", "minor" and "release") are numbers
+   * and correspond to the usual version triplet. The fourth
+   * element ("extra") is a string and is normally empty, but
+   * may be used for distro-specific information.
+   * <p>
+   * To construct the original version string:
+   * "$major.$minor.$release$extra"
+   * <p>
+   * *Note:* Don't use this call to test for availability of
+   * features. Distro backports makes this unreliable.
+   * <p>
+   * @throws LibGuestFSException
+   */
+  public Version version ()
+    throws LibGuestFSException
+  {
+    if (g == 0)
+      throw new LibGuestFSException ("version: handle is closed");
+    return _version (g);
+  }
+  private native Version _version (long g)
+    throws LibGuestFSException;
+
+  /**
    * mount a guest disk at a position in the filesystem
    * <p>
    * Mount a guest disk at a position in the filesystem.
@@ -4047,4 +4089,147 @@ public HashMap<String,String> test0rhashtableerr ()
   private native void _sfdiskM (long g, String device, String[] lines)
     throws LibGuestFSException;
 
+  /**
+   * determine file type inside a compressed file
+   * <p>
+   * This command runs "file" after first decompressing
+   * "path" using "method".
+   * <p>
+   * "method" must be one of "gzip", "compress" or "bzip2".
+   * <p>
+   * See also: "g.file"
+   * <p>
+   * @throws LibGuestFSException
+   */
+  public String zfile (String method, String path)
+    throws LibGuestFSException
+  {
+    if (g == 0)
+      throw new LibGuestFSException ("zfile: handle is closed");
+    return _zfile (g, method, path);
+  }
+  private native String _zfile (long g, String method, String path)
+    throws LibGuestFSException;
+
+  /**
+   * list extended attributes of a file or directory
+   * <p>
+   * This call lists the extended attributes of the file or
+   * directory "path".
+   * <p>
+   * At the system call level, this is a combination of the
+   * listxattr(2) and getxattr(2) calls.
+   * <p>
+   * See also: "g.lgetxattrs", attr(5).
+   * <p>
+   * @throws LibGuestFSException
+   */
+  public XAttr[] getxattrs (String path)
+    throws LibGuestFSException
+  {
+    if (g == 0)
+      throw new LibGuestFSException ("getxattrs: handle is closed");
+    return _getxattrs (g, path);
+  }
+  private native XAttr[] _getxattrs (long g, String path)
+    throws LibGuestFSException;
+
+  /**
+   * list extended attributes of a file or directory
+   * <p>
+   * This is the same as "g.getxattrs", but if "path" is a
+   * symbolic link, then it returns the extended attributes
+   * of the link itself.
+   * <p>
+   * @throws LibGuestFSException
+   */
+  public XAttr[] lgetxattrs (String path)
+    throws LibGuestFSException
+  {
+    if (g == 0)
+      throw new LibGuestFSException ("lgetxattrs: handle is closed");
+    return _lgetxattrs (g, path);
+  }
+  private native XAttr[] _lgetxattrs (long g, String path)
+    throws LibGuestFSException;
+
+  /**
+   * set extended attribute of a file or directory
+   * <p>
+   * This call sets the extended attribute named "xattr" of
+   * the file "path" to the value "val" (of length "vallen").
+   * The value is arbitrary 8 bit data.
+   * <p>
+   * See also: "g.lsetxattr", attr(5).
+   * <p>
+   * @throws LibGuestFSException
+   */
+  public void setxattr (String xattr, String val, int vallen, String path)
+    throws LibGuestFSException
+  {
+    if (g == 0)
+      throw new LibGuestFSException ("setxattr: handle is closed");
+    _setxattr (g, xattr, val, vallen, path);
+  }
+  private native void _setxattr (long g, String xattr, String val, int vallen, String path)
+    throws LibGuestFSException;
+
+  /**
+   * set extended attribute of a file or directory
+   * <p>
+   * This is the same as "g.setxattr", but if "path" is a
+   * symbolic link, then it sets an extended attribute of the
+   * link itself.
+   * <p>
+   * @throws LibGuestFSException
+   */
+  public void lsetxattr (String xattr, String val, int vallen, String path)
+    throws LibGuestFSException
+  {
+    if (g == 0)
+      throw new LibGuestFSException ("lsetxattr: handle is closed");
+    _lsetxattr (g, xattr, val, vallen, path);
+  }
+  private native void _lsetxattr (long g, String xattr, String val, int vallen, String path)
+    throws LibGuestFSException;
+
+  /**
+   * remove extended attribute of a file or directory
+   * <p>
+   * This call removes the extended attribute named "xattr"
+   * of the file "path".
+   * <p>
+   * See also: "g.lremovexattr", attr(5).
+   * <p>
+   * @throws LibGuestFSException
+   */
+  public void removexattr (String xattr, String path)
+    throws LibGuestFSException
+  {
+    if (g == 0)
+      throw new LibGuestFSException ("removexattr: handle is closed");
+    _removexattr (g, xattr, path);
+  }
+  private native void _removexattr (long g, String xattr, String path)
+    throws LibGuestFSException;
+
+  /**
+   * remove extended attribute of a file or directory
+   * <p>
+   * This is the same as "g.removexattr", but if "path" is a
+   * symbolic link, then it removes an extended attribute of
+   * the link itself.
+   * <p>
+   * @throws LibGuestFSException
+   */
+  public void lremovexattr (String xattr, String path)
+    throws LibGuestFSException
+  {
+    if (g == 0)
+      throw new LibGuestFSException ("lremovexattr: handle is closed");
+    _lremovexattr (g, xattr, path);
+  }
+  private native void _lremovexattr (long g, String xattr, String path)
+    throws LibGuestFSException;
+
 }
diff --git a/java/com/redhat/et/libguestfs/Dirent.java b/java/com/redhat/et/libguestfs/Version.java
similarity index 87%
copy from java/com/redhat/et/libguestfs/Dirent.java
copy to java/com/redhat/et/libguestfs/Version.java
index f6ef3d8..869dc06 100644
--- a/java/com/redhat/et/libguestfs/Dirent.java
+++ b/java/com/redhat/et/libguestfs/Version.java
@@ -22,13 +22,14 @@
 package com.redhat.et.libguestfs;
 
 /**
- * Libguestfs Dirent structure.
+ * Libguestfs Version structure.
  *
  * @author rjones
  * @see GuestFS
  */
-public class Dirent {
-  public long ino;
-  public char ftyp;
-  public String name;
+public class Version {
+  public long major;
+  public long minor;
+  public long release;
+  public String extra;
 }
diff --git a/java/com/redhat/et/libguestfs/IntBool.java b/java/com/redhat/et/libguestfs/XAttr.java
similarity index 90%
copy from java/com/redhat/et/libguestfs/IntBool.java
copy to java/com/redhat/et/libguestfs/XAttr.java
index 07ccfdc..995141e 100644
--- a/java/com/redhat/et/libguestfs/IntBool.java
+++ b/java/com/redhat/et/libguestfs/XAttr.java
@@ -22,12 +22,12 @@
 package com.redhat.et.libguestfs;
 
 /**
- * Libguestfs IntBool structure.
+ * Libguestfs XAttr structure.
  *
  * @author rjones
  * @see GuestFS
  */
-public class IntBool {
-  public int i;
-  public int b;
+public class XAttr {
+  public String attrname;
+  public String attrval;
 }
diff --git a/java/com_redhat_et_libguestfs_GuestFS.c b/java/com_redhat_et_libguestfs_GuestFS.c
index c93377d..9fcbc33 100644
--- a/java/com_redhat_et_libguestfs_GuestFS.c
+++ b/java/com_redhat_et_libguestfs_GuestFS.c
@@ -1045,6 +1045,35 @@ Java_com_redhat_et_libguestfs_GuestFS__1get_1pid
   return (jint) r;
 }
 
+JNIEXPORT jobject JNICALL
+Java_com_redhat_et_libguestfs_GuestFS__1version
+  (JNIEnv *env, jobject obj, jlong jg)
+{
+  guestfs_h *g = (guestfs_h *) (long) jg;
+  jobject jr;
+  jclass cl;
+  jfieldID fl;
+  struct guestfs_version *r;
+
+  r = guestfs_version (g);
+  if (r == NULL) {
+    throw_exception (env, guestfs_last_error (g));
+    return NULL;
+  }
+  cl = (*env)->FindClass (env, "com/redhat/et/libguestfs/Version");
+  jr = (*env)->AllocObject (env, cl);
+  fl = (*env)->GetFieldID (env, cl, "major", "J");
+  (*env)->SetLongField (env, jr, fl, r->major);
+  fl = (*env)->GetFieldID (env, cl, "minor", "J");
+  (*env)->SetLongField (env, jr, fl, r->minor);
+  fl = (*env)->GetFieldID (env, cl, "release", "J");
+  (*env)->SetLongField (env, jr, fl, r->release);
+  fl = (*env)->GetFieldID (env, cl, "extra", "Ljava/lang/String;");
+  (*env)->SetObjectField (env, jr, fl, (*env)->NewStringUTF (env, r->extra));
+  free (r);
+  return jr;
+}
+
 JNIEXPORT void JNICALL
 Java_com_redhat_et_libguestfs_GuestFS__1mount
   (JNIEnv *env, jobject obj, jlong jg, jstring jdevice, jstring jmountpoint)
@@ -4316,3 +4345,197 @@ Java_com_redhat_et_libguestfs_GuestFS__1sfdiskM
   }
 }
 
+JNIEXPORT jstring JNICALL
+Java_com_redhat_et_libguestfs_GuestFS__1zfile
+  (JNIEnv *env, jobject obj, jlong jg, jstring jmethod, jstring jpath)
+{
+  guestfs_h *g = (guestfs_h *) (long) jg;
+  jstring jr;
+  char *r;
+  const char *method;
+  const char *path;
+
+  method = (*env)->GetStringUTFChars (env, jmethod, NULL);
+  path = (*env)->GetStringUTFChars (env, jpath, NULL);
+  r = guestfs_zfile (g, method, path);
+  (*env)->ReleaseStringUTFChars (env, jmethod, method);
+  (*env)->ReleaseStringUTFChars (env, jpath, path);
+  if (r == NULL) {
+    throw_exception (env, guestfs_last_error (g));
+    return NULL;
+  }
+  jr = (*env)->NewStringUTF (env, r);
+  free (r);
+  return jr;
+}
+
+JNIEXPORT jobjectArray JNICALL
+Java_com_redhat_et_libguestfs_GuestFS__1getxattrs
+  (JNIEnv *env, jobject obj, jlong jg, jstring jpath)
+{
+  guestfs_h *g = (guestfs_h *) (long) jg;
+  jobjectArray jr;
+  jclass cl;
+  jfieldID fl;
+  jobject jfl;
+  struct guestfs_xattr_list *r;
+  const char *path;
+  int i;
+
+  path = (*env)->GetStringUTFChars (env, jpath, NULL);
+  r = guestfs_getxattrs (g, path);
+  (*env)->ReleaseStringUTFChars (env, jpath, path);
+  if (r == NULL) {
+    throw_exception (env, guestfs_last_error (g));
+    return NULL;
+  }
+  cl = (*env)->FindClass (env, "com/redhat/et/libguestfs/XAttr");
+  jr = (*env)->NewObjectArray (env, r->len, cl, NULL);
+  for (i = 0; i < r->len; ++i) {
+    jfl = (*env)->AllocObject (env, cl);
+    fl = (*env)->GetFieldID (env, cl, "attrname", "Ljava/lang/String;");
+    (*env)->SetObjectField (env, jfl, fl, (*env)->NewStringUTF (env, r->val[i].attrname));
+    {
+      int len = r->val[i].attrval_len;
+      char s[len+1];
+      memcpy (s, r->val[i].attrval, len);
+      s[len] = 0;
+      fl = (*env)->GetFieldID (env, cl, "attrval", "Ljava/lang/String;");
+      (*env)->SetObjectField (env, jfl, fl, (*env)->NewStringUTF (env, s));
+    }
+    (*env)->SetObjectArrayElement (env, jfl, i, jfl);
+  }
+  guestfs_free_xattr_list (r);
+  return jr;
+}
+
+JNIEXPORT jobjectArray JNICALL
+Java_com_redhat_et_libguestfs_GuestFS__1lgetxattrs
+  (JNIEnv *env, jobject obj, jlong jg, jstring jpath)
+{
+  guestfs_h *g = (guestfs_h *) (long) jg;
+  jobjectArray jr;
+  jclass cl;
+  jfieldID fl;
+  jobject jfl;
+  struct guestfs_xattr_list *r;
+  const char *path;
+  int i;
+
+  path = (*env)->GetStringUTFChars (env, jpath, NULL);
+  r = guestfs_lgetxattrs (g, path);
+  (*env)->ReleaseStringUTFChars (env, jpath, path);
+  if (r == NULL) {
+    throw_exception (env, guestfs_last_error (g));
+    return NULL;
+  }
+  cl = (*env)->FindClass (env, "com/redhat/et/libguestfs/XAttr");
+  jr = (*env)->NewObjectArray (env, r->len, cl, NULL);
+  for (i = 0; i < r->len; ++i) {
+    jfl = (*env)->AllocObject (env, cl);
+    fl = (*env)->GetFieldID (env, cl, "attrname", "Ljava/lang/String;");
+    (*env)->SetObjectField (env, jfl, fl, (*env)->NewStringUTF (env, r->val[i].attrname));
+    {
+      int len = r->val[i].attrval_len;
+      char s[len+1];
+      memcpy (s, r->val[i].attrval, len);
+      s[len] = 0;
+      fl = (*env)->GetFieldID (env, cl, "attrval", "Ljava/lang/String;");
+      (*env)->SetObjectField (env, jfl, fl, (*env)->NewStringUTF (env, s));
+    }
+    (*env)->SetObjectArrayElement (env, jfl, i, jfl);
+  }
+  guestfs_free_xattr_list (r);
+  return jr;
+}
+
+JNIEXPORT void JNICALL
+Java_com_redhat_et_libguestfs_GuestFS__1setxattr
+  (JNIEnv *env, jobject obj, jlong jg, jstring jxattr, jstring jval, jint jvallen, jstring jpath)
+{
+  guestfs_h *g = (guestfs_h *) (long) jg;
+  int r;
+  const char *xattr;
+  const char *val;
+  int vallen;
+  const char *path;
+
+  xattr = (*env)->GetStringUTFChars (env, jxattr, NULL);
+  val = (*env)->GetStringUTFChars (env, jval, NULL);
+  vallen = jvallen;
+  path = (*env)->GetStringUTFChars (env, jpath, NULL);
+  r = guestfs_setxattr (g, xattr, val, vallen, path);
+  (*env)->ReleaseStringUTFChars (env, jxattr, xattr);
+  (*env)->ReleaseStringUTFChars (env, jval, val);
+  (*env)->ReleaseStringUTFChars (env, jpath, path);
+  if (r == -1) {
+    throw_exception (env, guestfs_last_error (g));
+    return ;
+  }
+}
+
+JNIEXPORT void JNICALL
+Java_com_redhat_et_libguestfs_GuestFS__1lsetxattr
+  (JNIEnv *env, jobject obj, jlong jg, jstring jxattr, jstring jval, jint jvallen, jstring jpath)
+{
+  guestfs_h *g = (guestfs_h *) (long) jg;
+  int r;
+  const char *xattr;
+  const char *val;
+  int vallen;
+  const char *path;
+
+  xattr = (*env)->GetStringUTFChars (env, jxattr, NULL);
+  val = (*env)->GetStringUTFChars (env, jval, NULL);
+  vallen = jvallen;
+  path = (*env)->GetStringUTFChars (env, jpath, NULL);
+  r = guestfs_lsetxattr (g, xattr, val, vallen, path);
+  (*env)->ReleaseStringUTFChars (env, jxattr, xattr);
+  (*env)->ReleaseStringUTFChars (env, jval, val);
+  (*env)->ReleaseStringUTFChars (env, jpath, path);
+  if (r == -1) {
+    throw_exception (env, guestfs_last_error (g));
+    return ;
+  }
+}
+
+JNIEXPORT void JNICALL
+Java_com_redhat_et_libguestfs_GuestFS__1removexattr
+  (JNIEnv *env, jobject obj, jlong jg, jstring jxattr, jstring jpath)
+{
+  guestfs_h *g = (guestfs_h *) (long) jg;
+  int r;
+  const char *xattr;
+  const char *path;
+
+  xattr = (*env)->GetStringUTFChars (env, jxattr, NULL);
+  path = (*env)->GetStringUTFChars (env, jpath, NULL);
+  r = guestfs_removexattr (g, xattr, path);
+  (*env)->ReleaseStringUTFChars (env, jxattr, xattr);
+  (*env)->ReleaseStringUTFChars (env, jpath, path);
+  if (r == -1) {
+    throw_exception (env, guestfs_last_error (g));
+    return ;
+  }
+}
+
+JNIEXPORT void JNICALL
+Java_com_redhat_et_libguestfs_GuestFS__1lremovexattr
+  (JNIEnv *env, jobject obj, jlong jg, jstring jxattr, jstring jpath)
+{
+  guestfs_h *g = (guestfs_h *) (long) jg;
+  int r;
+  const char *xattr;
+  const char *path;
+
+  xattr = (*env)->GetStringUTFChars (env, jxattr, NULL);
+  path = (*env)->GetStringUTFChars (env, jpath, NULL);
+  r = guestfs_lremovexattr (g, xattr, path);
+  (*env)->ReleaseStringUTFChars (env, jxattr, xattr);
+  (*env)->ReleaseStringUTFChars (env, jpath, path);
+  if (r == -1) {
+    throw_exception (env, guestfs_last_error (g));
+    return ;
+  }
+}
+
diff --git a/java/com_redhat_et_libguestfs_GuestFS.h b/java/com_redhat_et_libguestfs_GuestFS.h
index 440dd3c..03755c0 100644
--- a/java/com_redhat_et_libguestfs_GuestFS.h
+++ b/java/com_redhat_et_libguestfs_GuestFS.h
@@ -1,1517 +1,214 @@
 /* DO NOT EDIT THIS FILE - it is machine generated */
+
 #include <jni.h>
-/* Header for class com_redhat_et_libguestfs_GuestFS */
 
-#ifndef _Included_com_redhat_et_libguestfs_GuestFS
-#define _Included_com_redhat_et_libguestfs_GuestFS
+#ifndef __com_redhat_et_libguestfs_GuestFS__
+#define __com_redhat_et_libguestfs_GuestFS__
+
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _create
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1create
-  (JNIEnv *, jobject);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _close
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1close
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0
- * Signature: (JLjava/lang/String;Ljava/lang/String;[Ljava/lang/String;ZILjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0
-  (JNIEnv *, jobject, jlong, jstring, jstring, jobjectArray, jboolean, jint, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rint
- * Signature: (JLjava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rint
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rinterr
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rinterr
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rint64
- * Signature: (JLjava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rint64
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rint64err
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rint64err
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rbool
- * Signature: (JLjava/lang/String;)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rbool
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rboolerr
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rboolerr
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rconststring
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rconststring
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rconststringerr
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rconststringerr
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rstring
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstring
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rstringerr
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstringerr
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rstringlist
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstringlist
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rstringlisterr
- * Signature: (J)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstringlisterr
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rstruct
- * Signature: (JLjava/lang/String;)Lcom/redhat/et/libguestfs/PV;
- */
-JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstruct
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rstructerr
- * Signature: (J)Lcom/redhat/et/libguestfs/PV;
- */
-JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstructerr
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rstructlist
- * Signature: (JLjava/lang/String;)[Lcom/redhat/et/libguestfs/PV;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstructlist
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rstructlisterr
- * Signature: (J)[Lcom/redhat/et/libguestfs/PV;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstructlisterr
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rhashtable
- * Signature: (JLjava/lang/String;)Ljava/util/HashMap;
- */
-JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rhashtable
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _test0rhashtableerr
- * Signature: (J)Ljava/util/HashMap;
- */
-JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rhashtableerr
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _launch
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1launch
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _wait_ready
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1wait_1ready
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _kill_subprocess
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1kill_1subprocess
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _add_drive
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1add_1drive
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _add_cdrom
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1add_1cdrom
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _add_drive_ro
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1add_1drive_1ro
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _config
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1config
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _set_qemu
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1qemu
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _get_qemu
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1qemu
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _set_path
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1path
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _get_path
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1path
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _set_append
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1append
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _get_append
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1append
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _set_autosync
- * Signature: (JZ)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1autosync
-  (JNIEnv *, jobject, jlong, jboolean);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _get_autosync
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1autosync
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _set_verbose
- * Signature: (JZ)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1verbose
-  (JNIEnv *, jobject, jlong, jboolean);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _get_verbose
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1verbose
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _is_ready
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1ready
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _is_config
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1config
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _is_launching
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1launching
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _is_busy
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1busy
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _get_state
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1state
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _set_busy
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1busy
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _set_ready
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1ready
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _end_busy
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1end_1busy
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _set_memsize
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1memsize
-  (JNIEnv *, jobject, jlong, jint);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _get_memsize
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1memsize
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _get_pid
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1pid
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mount
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _sync
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sync
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _touch
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1touch
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _cat
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1cat
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _ll
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1ll
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _ls
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1ls
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _list_devices
- * Signature: (J)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1list_1devices
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _list_partitions
- * Signature: (J)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1list_1partitions
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _pvs
- * Signature: (J)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1pvs
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _vgs
- * Signature: (J)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vgs
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _lvs
- * Signature: (J)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvs
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _pvs_full
- * Signature: (J)[Lcom/redhat/et/libguestfs/PV;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1pvs_1full
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _vgs_full
- * Signature: (J)[Lcom/redhat/et/libguestfs/VG;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vgs_1full
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _lvs_full
- * Signature: (J)[Lcom/redhat/et/libguestfs/LV;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvs_1full
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _read_lines
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1read_1lines
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_init
- * Signature: (JLjava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1init
-  (JNIEnv *, jobject, jlong, jstring, jint);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_close
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1close
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_defvar
- * Signature: (JLjava/lang/String;Ljava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1defvar
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_defnode
- * Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/redhat/et/libguestfs/IntBool;
- */
-JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1defnode
-  (JNIEnv *, jobject, jlong, jstring, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_get
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1get
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_set
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1set
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_insert
- * Signature: (JLjava/lang/String;Ljava/lang/String;Z)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1insert
-  (JNIEnv *, jobject, jlong, jstring, jstring, jboolean);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_rm
- * Signature: (JLjava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1rm
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_mv
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1mv
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_match
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1match
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_save
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1save
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_load
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1load
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _aug_ls
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1ls
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _rm
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1rm
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _rmdir
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1rmdir
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _rm_rf
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1rm_1rf
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mkdir
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkdir
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mkdir_p
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkdir_1p
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _chmod
- * Signature: (JILjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1chmod
-  (JNIEnv *, jobject, jlong, jint, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _chown
- * Signature: (JIILjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1chown
-  (JNIEnv *, jobject, jlong, jint, jint, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _exists
- * Signature: (JLjava/lang/String;)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1exists
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _is_file
- * Signature: (JLjava/lang/String;)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1file
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _is_dir
- * Signature: (JLjava/lang/String;)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1dir
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _pvcreate
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1pvcreate
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _vgcreate
- * Signature: (JLjava/lang/String;[Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vgcreate
-  (JNIEnv *, jobject, jlong, jstring, jobjectArray);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _lvcreate
- * Signature: (JLjava/lang/String;Ljava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvcreate
-  (JNIEnv *, jobject, jlong, jstring, jstring, jint);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mkfs
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkfs
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _sfdisk
- * Signature: (JLjava/lang/String;III[Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdisk
-  (JNIEnv *, jobject, jlong, jstring, jint, jint, jint, jobjectArray);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _write_file
- * Signature: (JLjava/lang/String;Ljava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1write_1file
-  (JNIEnv *, jobject, jlong, jstring, jstring, jint);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _umount
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1umount
-  (JNIEnv *, jobject, jlong, jstring);
 
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mounts
- * Signature: (J)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mounts
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _umount_all
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1umount_1all
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _lvm_remove_all
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvm_1remove_1all
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _file
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1file
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _command
- * Signature: (J[Ljava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1command
-  (JNIEnv *, jobject, jlong, jobjectArray);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _command_lines
- * Signature: (J[Ljava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1command_1lines
-  (JNIEnv *, jobject, jlong, jobjectArray);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _stat
- * Signature: (JLjava/lang/String;)Lcom/redhat/et/libguestfs/Stat;
- */
-JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1stat
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _lstat
- * Signature: (JLjava/lang/String;)Lcom/redhat/et/libguestfs/Stat;
- */
-JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lstat
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _statvfs
- * Signature: (JLjava/lang/String;)Lcom/redhat/et/libguestfs/StatVFS;
- */
-JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1statvfs
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _tune2fs_l
- * Signature: (JLjava/lang/String;)Ljava/util/HashMap;
- */
-JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tune2fs_1l
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _blockdev_setro
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1setro
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _blockdev_setrw
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1setrw
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _blockdev_getro
- * Signature: (JLjava/lang/String;)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1getro
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _blockdev_getss
- * Signature: (JLjava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1getss
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _blockdev_getbsz
- * Signature: (JLjava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1getbsz
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _blockdev_setbsz
- * Signature: (JLjava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1setbsz
-  (JNIEnv *, jobject, jlong, jstring, jint);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _blockdev_getsz
- * Signature: (JLjava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1getsz
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _blockdev_getsize64
- * Signature: (JLjava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1getsize64
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _blockdev_flushbufs
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1flushbufs
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _blockdev_rereadpt
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1rereadpt
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _upload
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1upload
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _download
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1download
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _checksum
- * Signature: (JLjava/lang/String;Ljava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1checksum
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _tar_in
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tar_1in
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _tar_out
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tar_1out
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _tgz_in
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tgz_1in
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _tgz_out
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tgz_1out
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mount_ro
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount_1ro
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mount_options
- * Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount_1options
-  (JNIEnv *, jobject, jlong, jstring, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mount_vfs
- * Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount_1vfs
-  (JNIEnv *, jobject, jlong, jstring, jstring, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _debug
- * Signature: (JLjava/lang/String;[Ljava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1debug
-  (JNIEnv *, jobject, jlong, jstring, jobjectArray);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _lvremove
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvremove
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _vgremove
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vgremove
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _pvremove
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1pvremove
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _set_e2label
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1e2label
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _get_e2label
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1e2label
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _set_e2uuid
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1e2uuid
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _get_e2uuid
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1e2uuid
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _fsck
- * Signature: (JLjava/lang/String;Ljava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1fsck
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _zero
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1zero
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _grub_install
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1grub_1install
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _cp
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1cp
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _cp_a
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1cp_1a
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mv
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mv
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _drop_caches
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1drop_1caches
-  (JNIEnv *, jobject, jlong, jint);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _dmesg
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1dmesg
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _ping_daemon
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1ping_1daemon
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _equal
- * Signature: (JLjava/lang/String;Ljava/lang/String;)Z
- */
-JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1equal
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _strings
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1strings
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _strings_e
- * Signature: (JLjava/lang/String;Ljava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1strings_1e
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _hexdump
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1hexdump
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _zerofree
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1zerofree
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _pvresize
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1pvresize
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _sfdisk_N
- * Signature: (JLjava/lang/String;IIIILjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdisk_1N
-  (JNIEnv *, jobject, jlong, jstring, jint, jint, jint, jint, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _sfdisk_l
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdisk_1l
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _sfdisk_kernel_geometry
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdisk_1kernel_1geometry
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _sfdisk_disk_geometry
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdisk_1disk_1geometry
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _vg_activate_all
- * Signature: (JZ)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vg_1activate_1all
-  (JNIEnv *, jobject, jlong, jboolean);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _vg_activate
- * Signature: (JZ[Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vg_1activate
-  (JNIEnv *, jobject, jlong, jboolean, jobjectArray);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _lvresize
- * Signature: (JLjava/lang/String;I)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvresize
-  (JNIEnv *, jobject, jlong, jstring, jint);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _resize2fs
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1resize2fs
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _find
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1find
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _e2fsck_f
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1e2fsck_1f
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _sleep
- * Signature: (JI)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sleep
-  (JNIEnv *, jobject, jlong, jint);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _ntfs_3g_probe
- * Signature: (JZLjava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1ntfs_13g_1probe
-  (JNIEnv *, jobject, jlong, jboolean, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _sh
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sh
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _sh_lines
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sh_1lines
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _glob_expand
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1glob_1expand
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _scrub_device
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1scrub_1device
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _scrub_file
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1scrub_1file
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _scrub_freespace
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1scrub_1freespace
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mkdtemp
- * Signature: (JLjava/lang/String;)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkdtemp
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _wc_l
- * Signature: (JLjava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1wc_1l
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _wc_w
- * Signature: (JLjava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1wc_1w
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _wc_c
- * Signature: (JLjava/lang/String;)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1wc_1c
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _head
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1head
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _head_n
- * Signature: (JILjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1head_1n
-  (JNIEnv *, jobject, jlong, jint, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _tail
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tail
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _tail_n
- * Signature: (JILjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tail_1n
-  (JNIEnv *, jobject, jlong, jint, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _df
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1df
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _df_h
- * Signature: (J)Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1df_1h
-  (JNIEnv *, jobject, jlong);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _du
- * Signature: (JLjava/lang/String;)J
- */
-JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1du
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _initrd_list
- * Signature: (JLjava/lang/String;)[Ljava/lang/String;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1initrd_1list
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mount_loop
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount_1loop
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mkswap
- * Signature: (JLjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkswap
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mkswap_L
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkswap_1L
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mkswap_U
- * Signature: (JLjava/lang/String;Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkswap_1U
-  (JNIEnv *, jobject, jlong, jstring, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mknod
- * Signature: (JIIILjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mknod
-  (JNIEnv *, jobject, jlong, jint, jint, jint, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mkfifo
- * Signature: (JILjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkfifo
-  (JNIEnv *, jobject, jlong, jint, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mknod_b
- * Signature: (JIIILjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mknod_1b
-  (JNIEnv *, jobject, jlong, jint, jint, jint, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _mknod_c
- * Signature: (JIIILjava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mknod_1c
-  (JNIEnv *, jobject, jlong, jint, jint, jint, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _umask
- * Signature: (JI)I
- */
-JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1umask
-  (JNIEnv *, jobject, jlong, jint);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _readdir
- * Signature: (JLjava/lang/String;)[Lcom/redhat/et/libguestfs/Dirent;
- */
-JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1readdir
-  (JNIEnv *, jobject, jlong, jstring);
-
-/*
- * Class:     com_redhat_et_libguestfs_GuestFS
- * Method:    _sfdiskM
- * Signature: (JLjava/lang/String;[Ljava/lang/String;)V
- */
-JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdiskM
-  (JNIEnv *, jobject, jlong, jstring, jobjectArray);
+JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1create (JNIEnv *env, jobject);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1close (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0 (JNIEnv *env, jobject, jlong, jstring, jstring, jobjectArray, jboolean, jint, jstring, jstring);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rint (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rinterr (JNIEnv *env, jobject, jlong);
+JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rint64 (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rint64err (JNIEnv *env, jobject, jlong);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rbool (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rboolerr (JNIEnv *env, jobject, jlong);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rconststring (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rconststringerr (JNIEnv *env, jobject, jlong);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstring (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstringerr (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstringlist (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstringlisterr (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstruct (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstructerr (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstructlist (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rstructlisterr (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rhashtable (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1test0rhashtableerr (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1launch (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1wait_1ready (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1kill_1subprocess (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1add_1drive (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1add_1cdrom (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1add_1drive_1ro (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1config (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1qemu (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1qemu (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1path (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1path (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1append (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1append (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1autosync (JNIEnv *env, jobject, jlong, jboolean);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1autosync (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1verbose (JNIEnv *env, jobject, jlong, jboolean);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1verbose (JNIEnv *env, jobject, jlong);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1ready (JNIEnv *env, jobject, jlong);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1config (JNIEnv *env, jobject, jlong);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1launching (JNIEnv *env, jobject, jlong);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1busy (JNIEnv *env, jobject, jlong);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1state (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1busy (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1ready (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1end_1busy (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1memsize (JNIEnv *env, jobject, jlong, jint);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1memsize (JNIEnv *env, jobject, jlong);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1pid (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1version (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sync (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1touch (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1cat (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1ll (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1ls (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1list_1devices (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1list_1partitions (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1pvs (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vgs (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvs (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1pvs_1full (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vgs_1full (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvs_1full (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1read_1lines (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1init (JNIEnv *env, jobject, jlong, jstring, jint);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1close (JNIEnv *env, jobject, jlong);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1defvar (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1defnode (JNIEnv *env, jobject, jlong, jstring, jstring, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1get (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1set (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1insert (JNIEnv *env, jobject, jlong, jstring, jstring, jboolean);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1rm (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1mv (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1match (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1save (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1load (JNIEnv *env, jobject, jlong);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1aug_1ls (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1rm (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1rmdir (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1rm_1rf (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkdir (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkdir_1p (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1chmod (JNIEnv *env, jobject, jlong, jint, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1chown (JNIEnv *env, jobject, jlong, jint, jint, jstring);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1exists (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1file (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1is_1dir (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1pvcreate (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vgcreate (JNIEnv *env, jobject, jlong, jstring, jobjectArray);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvcreate (JNIEnv *env, jobject, jlong, jstring, jstring, jint);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkfs (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdisk (JNIEnv *env, jobject, jlong, jstring, jint, jint, jint, jobjectArray);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1write_1file (JNIEnv *env, jobject, jlong, jstring, jstring, jint);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1umount (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mounts (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1umount_1all (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvm_1remove_1all (JNIEnv *env, jobject, jlong);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1file (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1command (JNIEnv *env, jobject, jlong, jobjectArray);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1command_1lines (JNIEnv *env, jobject, jlong, jobjectArray);
+JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1stat (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lstat (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1statvfs (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobject JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tune2fs_1l (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1setro (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1setrw (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1getro (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1getss (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1getbsz (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1setbsz (JNIEnv *env, jobject, jlong, jstring, jint);
+JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1getsz (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1getsize64 (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1flushbufs (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1blockdev_1rereadpt (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1upload (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1download (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1checksum (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tar_1in (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tar_1out (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tgz_1in (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tgz_1out (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount_1ro (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount_1options (JNIEnv *env, jobject, jlong, jstring, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount_1vfs (JNIEnv *env, jobject, jlong, jstring, jstring, jstring, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1debug (JNIEnv *env, jobject, jlong, jstring, jobjectArray);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvremove (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vgremove (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1pvremove (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1e2label (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1e2label (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1set_1e2uuid (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1get_1e2uuid (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1fsck (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1zero (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1grub_1install (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1cp (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1cp_1a (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mv (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1drop_1caches (JNIEnv *env, jobject, jlong, jint);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1dmesg (JNIEnv *env, jobject, jlong);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1ping_1daemon (JNIEnv *env, jobject, jlong);
+JNIEXPORT jboolean JNICALL Java_com_redhat_et_libguestfs_GuestFS__1equal (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1strings (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1strings_1e (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1hexdump (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1zerofree (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1pvresize (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdisk_1N (JNIEnv *env, jobject, jlong, jstring, jint, jint, jint, jint, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdisk_1l (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdisk_1kernel_1geometry (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdisk_1disk_1geometry (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vg_1activate_1all (JNIEnv *env, jobject, jlong, jboolean);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1vg_1activate (JNIEnv *env, jobject, jlong, jboolean, jobjectArray);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lvresize (JNIEnv *env, jobject, jlong, jstring, jint);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1resize2fs (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1find (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1e2fsck_1f (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sleep (JNIEnv *env, jobject, jlong, jint);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1ntfs_13g_1probe (JNIEnv *env, jobject, jlong, jboolean, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sh (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sh_1lines (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1glob_1expand (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1scrub_1device (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1scrub_1file (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1scrub_1freespace (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkdtemp (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1wc_1l (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1wc_1w (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1wc_1c (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1head (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1head_1n (JNIEnv *env, jobject, jlong, jint, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tail (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1tail_1n (JNIEnv *env, jobject, jlong, jint, jstring);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1df (JNIEnv *env, jobject, jlong);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1df_1h (JNIEnv *env, jobject, jlong);
+JNIEXPORT jlong JNICALL Java_com_redhat_et_libguestfs_GuestFS__1du (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1initrd_1list (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount_1loop (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkswap (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkswap_1L (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkswap_1U (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mknod (JNIEnv *env, jobject, jlong, jint, jint, jint, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mkfifo (JNIEnv *env, jobject, jlong, jint, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mknod_1b (JNIEnv *env, jobject, jlong, jint, jint, jint, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mknod_1c (JNIEnv *env, jobject, jlong, jint, jint, jint, jstring);
+JNIEXPORT jint JNICALL Java_com_redhat_et_libguestfs_GuestFS__1umask (JNIEnv *env, jobject, jlong, jint);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1readdir (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1sfdiskM (JNIEnv *env, jobject, jlong, jstring, jobjectArray);
+JNIEXPORT jstring JNICALL Java_com_redhat_et_libguestfs_GuestFS__1zfile (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1getxattrs (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT jobjectArray JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lgetxattrs (JNIEnv *env, jobject, jlong, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1setxattr (JNIEnv *env, jobject, jlong, jstring, jstring, jint, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lsetxattr (JNIEnv *env, jobject, jlong, jstring, jstring, jint, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1removexattr (JNIEnv *env, jobject, jlong, jstring, jstring);
+JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1lremovexattr (JNIEnv *env, jobject, jlong, jstring, jstring);
 
 #ifdef __cplusplus
 }
 #endif
-#endif
+
+#endif /* __com_redhat_et_libguestfs_GuestFS__ */
diff --git a/libguestfs.pc b/libguestfs.pc
index 1181b78..889a00b 100644
--- a/libguestfs.pc
+++ b/libguestfs.pc
@@ -4,7 +4,7 @@ libdir=${exec_prefix}/lib
 includedir=${prefix}/include
 
 Name: libguestfs
-Version: 1.0.56
+Version: 1.0.61
 Description: libguestfs library for accessing and modifying VM images
 Requires:
 Cflags:
diff --git a/ocaml/Makefile.in b/ocaml/Makefile.in
index da45716..797345b 100644
--- a/ocaml/Makefile.in
+++ b/ocaml/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -33,8 +34,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -67,6 +69,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = META
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -79,10 +82,40 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 DATA = $(noinst_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir
 ETAGS = etags
 CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
 DIST_SUBDIRS = $(SUBDIRS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AR = @AR@
@@ -296,9 +329,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/.depend $(am__configure_
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  ocaml/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  ocaml/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ocaml/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign ocaml/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -316,6 +349,7 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 META: $(top_builddir)/config.status $(srcdir)/META.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
@@ -349,7 +383,7 @@ $(RECURSIVE_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done; \
 	if test "$$dot_seen" = "no"; then \
@@ -383,16 +417,16 @@ $(RECURSIVE_CLEAN_TARGETS):
 	  else \
 	    local_target="$$target"; \
 	  fi; \
-	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
 	  || eval $$failcom; \
 	done && test -z "$$fail"
 tags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
 	done
 ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
-	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@@ -407,7 +441,7 @@ tags: TAGS
 
 TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
@@ -419,7 +453,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test ! -f $$subdir/TAGS || \
-	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
 	done; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
@@ -428,29 +462,34 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -459,6 +498,7 @@ check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
 	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
@@ -470,10 +510,10 @@ check-TESTS: $(TESTS)
 	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
@@ -481,17 +521,18 @@ check-TESTS: $(TESTS)
 	      case " $(XFAIL_TESTS) " in \
 	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
 	  if test "$$all" -eq 1; then \
 	    tests="test"; \
@@ -533,11 +574,15 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    echo "$$grn$$dashes"; \
+	  else \
+	    echo "$$red$$dashes"; \
+	  fi; \
 	  echo "$$banner"; \
 	  test -z "$$skipped" || echo "$$skipped"; \
 	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  echo "$$dashes$$std"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
@@ -557,29 +602,44 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
-	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
 	    test -d "$(distdir)/$$subdir" \
 	    || $(MKDIR_P) "$(distdir)/$$subdir" \
 	    || exit 1; \
-	    distdir=`$(am__cd) $(distdir) && pwd`; \
-	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
-	    (cd $$subdir && \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
 	      $(MAKE) $(AM_MAKEFLAGS) \
-	        top_distdir="$$top_distdir" \
-	        distdir="$$distdir/$$subdir" \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
 		am__remove_distdir=: \
 		am__skip_length_check=: \
+		am__skip_mode_fix=: \
 	        distdir) \
 	      || exit 1; \
 	  fi; \
@@ -611,6 +671,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -630,6 +691,8 @@ dvi-am:
 
 html: html-recursive
 
+html-am:
+
 info: info-recursive
 
 info-am:
@@ -637,21 +700,30 @@ info-am:
 install-data-am:
 	@$(NORMAL_INSTALL)
 	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
 install-dvi: install-dvi-recursive
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-recursive
 
+install-html-am:
+
 install-info: install-info-recursive
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-recursive
 
+install-pdf-am:
+
 install-ps: install-ps-recursive
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
@@ -672,8 +744,9 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
-	install-data-am install-strip
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \
+	ctags-recursive install-am install-data-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
 	all all-am check check-TESTS check-am clean clean-generic \
@@ -751,6 +824,7 @@ uninstall-am:
 # Tell version 3.79 and up of GNU make to not build goals in this
 # directory in parallel.  (Possible solution for RHBZ#502309).
 .NOTPARALLEL:
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/ocaml/examples/Makefile.in b/ocaml/examples/Makefile.in
index cd93185..405b3bb 100644
--- a/ocaml/examples/Makefile.in
+++ b/ocaml/examples/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -15,8 +16,9 @@
 @SET_MAKE@
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -47,6 +49,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -239,9 +242,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  ocaml/examples/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  ocaml/examples/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ocaml/examples/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign ocaml/examples/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -259,6 +262,7 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -288,13 +292,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -323,6 +331,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -341,6 +350,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -349,18 +360,28 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -397,6 +418,7 @@ uninstall-am:
 
 @HAVE_OCAML_TRUE at lvs:	lvs.ml
 @HAVE_OCAML_TRUE@	$(OCAMLFIND) ocamlopt -I .. mlguestfs.cmxa $< -o $@
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml
index 1cb1a3a..80429b4 100644
--- a/ocaml/guestfs.ml
+++ b/ocaml/guestfs.ml
@@ -126,6 +126,18 @@ type dirent = {
   name : string;
 }
 
+type version = {
+  major : int64;
+  minor : int64;
+  release : int64;
+  extra : string;
+}
+
+type xattr = {
+  attrname : string;
+  attrval : string;
+}
+
 external test0 : t -> string -> string option -> string array -> bool -> int -> string -> string -> unit = "ocaml_guestfs_test0_byte" "ocaml_guestfs_test0"
 external test0rint : t -> string -> int = "ocaml_guestfs_test0rint"
 external test0rinterr : t -> int = "ocaml_guestfs_test0rinterr"
@@ -173,6 +185,7 @@ external end_busy : t -> unit = "ocaml_guestfs_end_busy"
 external set_memsize : t -> int -> unit = "ocaml_guestfs_set_memsize"
 external get_memsize : t -> int = "ocaml_guestfs_get_memsize"
 external get_pid : t -> int = "ocaml_guestfs_get_pid"
+external version : t -> version = "ocaml_guestfs_version"
 external mount : t -> string -> string -> unit = "ocaml_guestfs_mount"
 external sync : t -> unit = "ocaml_guestfs_sync"
 external touch : t -> string -> unit = "ocaml_guestfs_touch"
@@ -312,3 +325,10 @@ external mknod_c : t -> int -> int -> int -> string -> unit = "ocaml_guestfs_mkn
 external umask : t -> int -> int = "ocaml_guestfs_umask"
 external readdir : t -> string -> dirent array = "ocaml_guestfs_readdir"
 external sfdiskM : t -> string -> string array -> unit = "ocaml_guestfs_sfdiskM"
+external zfile : t -> string -> string -> string = "ocaml_guestfs_zfile"
+external getxattrs : t -> string -> xattr array = "ocaml_guestfs_getxattrs"
+external lgetxattrs : t -> string -> xattr array = "ocaml_guestfs_lgetxattrs"
+external setxattr : t -> string -> string -> int -> string -> unit = "ocaml_guestfs_setxattr"
+external lsetxattr : t -> string -> string -> int -> string -> unit = "ocaml_guestfs_lsetxattr"
+external removexattr : t -> string -> string -> unit = "ocaml_guestfs_removexattr"
+external lremovexattr : t -> string -> string -> unit = "ocaml_guestfs_lremovexattr"
diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli
index 8ec61e7..98749f0 100644
--- a/ocaml/guestfs.mli
+++ b/ocaml/guestfs.mli
@@ -135,6 +135,18 @@ type dirent = {
   name : string;
 }
 
+type version = {
+  major : int64;
+  minor : int64;
+  release : int64;
+  extra : string;
+}
+
+type xattr = {
+  attrname : string;
+  attrval : string;
+}
+
 val test0 : t -> string -> string option -> string array -> bool -> int -> string -> string -> unit
 (** internal test function - do not use *)
 
@@ -276,6 +288,9 @@ val get_memsize : t -> int
 val get_pid : t -> int
 (** get PID of qemu subprocess *)
 
+val version : t -> version
+(** get the library version number *)
+
 val mount : t -> string -> string -> unit
 (** mount a guest disk at a position in the filesystem *)
 
@@ -693,3 +708,24 @@ val readdir : t -> string -> dirent array
 val sfdiskM : t -> string -> string array -> unit
 (** create partitions on a block device *)
 
+val zfile : t -> string -> string -> string
+(** determine file type inside a compressed file *)
+
+val getxattrs : t -> string -> xattr array
+(** list extended attributes of a file or directory *)
+
+val lgetxattrs : t -> string -> xattr array
+(** list extended attributes of a file or directory *)
+
+val setxattr : t -> string -> string -> int -> string -> unit
+(** set extended attribute of a file or directory *)
+
+val lsetxattr : t -> string -> string -> int -> string -> unit
+(** set extended attribute of a file or directory *)
+
+val removexattr : t -> string -> string -> unit
+(** remove extended attribute of a file or directory *)
+
+val lremovexattr : t -> string -> string -> unit
+(** remove extended attribute of a file or directory *)
+
diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c
index f13b8c0..4da3f25 100644
--- a/ocaml/guestfs_c_actions.c
+++ b/ocaml/guestfs_c_actions.c
@@ -434,6 +434,77 @@ copy_dirent_list (const struct guestfs_dirent_list *dirents)
   }
 }
 
+static CAMLprim value
+copy_version (const struct guestfs_version *version)
+{
+  CAMLparam0 ();
+  CAMLlocal2 (rv, v);
+
+  rv = caml_alloc (4, 0);
+  v = caml_copy_int64 (version->major);
+  Store_field (rv, 0, v);
+  v = caml_copy_int64 (version->minor);
+  Store_field (rv, 1, v);
+  v = caml_copy_int64 (version->release);
+  Store_field (rv, 2, v);
+  v = caml_copy_string (version->extra);
+  Store_field (rv, 3, v);
+  CAMLreturn (rv);
+}
+
+static CAMLprim value
+copy_version_list (const struct guestfs_version_list *versions)
+{
+  CAMLparam0 ();
+  CAMLlocal2 (rv, v);
+  int i;
+
+  if (versions->len == 0)
+    CAMLreturn (Atom (0));
+  else {
+    rv = caml_alloc (versions->len, 0);
+    for (i = 0; i < versions->len; ++i) {
+      v = copy_version (&versions->val[i]);
+      caml_modify (&Field (rv, i), v);
+    }
+    CAMLreturn (rv);
+  }
+}
+
+static CAMLprim value
+copy_xattr (const struct guestfs_xattr *xattr)
+{
+  CAMLparam0 ();
+  CAMLlocal2 (rv, v);
+
+  rv = caml_alloc (2, 0);
+  v = caml_copy_string (xattr->attrname);
+  Store_field (rv, 0, v);
+  v = caml_alloc_string (xattr->attrval_len);
+  memcpy (String_val (v), xattr->attrval, xattr->attrval_len);
+  Store_field (rv, 1, v);
+  CAMLreturn (rv);
+}
+
+static CAMLprim value
+copy_xattr_list (const struct guestfs_xattr_list *xattrs)
+{
+  CAMLparam0 ();
+  CAMLlocal2 (rv, v);
+  int i;
+
+  if (xattrs->len == 0)
+    CAMLreturn (Atom (0));
+  else {
+    rv = caml_alloc (xattrs->len, 0);
+    for (i = 0; i < xattrs->len; ++i) {
+      v = copy_xattr (&xattrs->val[i]);
+      caml_modify (&Field (rv, i), v);
+    }
+    CAMLreturn (rv);
+  }
+}
+
 CAMLprim value
 ocaml_guestfs_test0 (value gv, value strv, value optstrv, value strlistv, value bv, value integerv, value fileinv, value fileoutv)
 {
@@ -1524,6 +1595,29 @@ ocaml_guestfs_get_pid (value gv)
 }
 
 CAMLprim value
+ocaml_guestfs_version (value gv)
+{
+  CAMLparam1 (gv);
+  CAMLlocal1 (rv);
+
+  guestfs_h *g = Guestfs_val (gv);
+  if (g == NULL)
+    caml_failwith ("version: used handle after closing it");
+
+  struct guestfs_version *r;
+
+  caml_enter_blocking_section ();
+  r = guestfs_version (g);
+  caml_leave_blocking_section ();
+  if (r == NULL)
+    ocaml_guestfs_raise_error (g, "version");
+
+  rv = copy_version (r);
+  guestfs_free_version (r);
+  CAMLreturn (rv);
+}
+
+CAMLprim value
 ocaml_guestfs_mount (value gv, value devicev, value mountpointv)
 {
   CAMLparam3 (gv, devicev, mountpointv);
@@ -4885,3 +4979,176 @@ ocaml_guestfs_sfdiskM (value gv, value devicev, value linesv)
   CAMLreturn (rv);
 }
 
+CAMLprim value
+ocaml_guestfs_zfile (value gv, value methodv, value pathv)
+{
+  CAMLparam3 (gv, methodv, pathv);
+  CAMLlocal1 (rv);
+
+  guestfs_h *g = Guestfs_val (gv);
+  if (g == NULL)
+    caml_failwith ("zfile: used handle after closing it");
+
+  const char *method = String_val (methodv);
+  const char *path = String_val (pathv);
+  char *r;
+
+  caml_enter_blocking_section ();
+  r = guestfs_zfile (g, method, path);
+  caml_leave_blocking_section ();
+  if (r == NULL)
+    ocaml_guestfs_raise_error (g, "zfile");
+
+  rv = caml_copy_string (r);
+  free (r);
+  CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_getxattrs (value gv, value pathv)
+{
+  CAMLparam2 (gv, pathv);
+  CAMLlocal1 (rv);
+
+  guestfs_h *g = Guestfs_val (gv);
+  if (g == NULL)
+    caml_failwith ("getxattrs: used handle after closing it");
+
+  const char *path = String_val (pathv);
+  struct guestfs_xattr_list *r;
+
+  caml_enter_blocking_section ();
+  r = guestfs_getxattrs (g, path);
+  caml_leave_blocking_section ();
+  if (r == NULL)
+    ocaml_guestfs_raise_error (g, "getxattrs");
+
+  rv = copy_xattr_list (r);
+  guestfs_free_xattr_list (r);
+  CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_lgetxattrs (value gv, value pathv)
+{
+  CAMLparam2 (gv, pathv);
+  CAMLlocal1 (rv);
+
+  guestfs_h *g = Guestfs_val (gv);
+  if (g == NULL)
+    caml_failwith ("lgetxattrs: used handle after closing it");
+
+  const char *path = String_val (pathv);
+  struct guestfs_xattr_list *r;
+
+  caml_enter_blocking_section ();
+  r = guestfs_lgetxattrs (g, path);
+  caml_leave_blocking_section ();
+  if (r == NULL)
+    ocaml_guestfs_raise_error (g, "lgetxattrs");
+
+  rv = copy_xattr_list (r);
+  guestfs_free_xattr_list (r);
+  CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_setxattr (value gv, value xattrv, value valv, value vallenv, value pathv)
+{
+  CAMLparam5 (gv, xattrv, valv, vallenv, pathv);
+  CAMLlocal1 (rv);
+
+  guestfs_h *g = Guestfs_val (gv);
+  if (g == NULL)
+    caml_failwith ("setxattr: used handle after closing it");
+
+  const char *xattr = String_val (xattrv);
+  const char *val = String_val (valv);
+  int vallen = Int_val (vallenv);
+  const char *path = String_val (pathv);
+  int r;
+
+  caml_enter_blocking_section ();
+  r = guestfs_setxattr (g, xattr, val, vallen, path);
+  caml_leave_blocking_section ();
+  if (r == -1)
+    ocaml_guestfs_raise_error (g, "setxattr");
+
+  rv = Val_unit;
+  CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_lsetxattr (value gv, value xattrv, value valv, value vallenv, value pathv)
+{
+  CAMLparam5 (gv, xattrv, valv, vallenv, pathv);
+  CAMLlocal1 (rv);
+
+  guestfs_h *g = Guestfs_val (gv);
+  if (g == NULL)
+    caml_failwith ("lsetxattr: used handle after closing it");
+
+  const char *xattr = String_val (xattrv);
+  const char *val = String_val (valv);
+  int vallen = Int_val (vallenv);
+  const char *path = String_val (pathv);
+  int r;
+
+  caml_enter_blocking_section ();
+  r = guestfs_lsetxattr (g, xattr, val, vallen, path);
+  caml_leave_blocking_section ();
+  if (r == -1)
+    ocaml_guestfs_raise_error (g, "lsetxattr");
+
+  rv = Val_unit;
+  CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_removexattr (value gv, value xattrv, value pathv)
+{
+  CAMLparam3 (gv, xattrv, pathv);
+  CAMLlocal1 (rv);
+
+  guestfs_h *g = Guestfs_val (gv);
+  if (g == NULL)
+    caml_failwith ("removexattr: used handle after closing it");
+
+  const char *xattr = String_val (xattrv);
+  const char *path = String_val (pathv);
+  int r;
+
+  caml_enter_blocking_section ();
+  r = guestfs_removexattr (g, xattr, path);
+  caml_leave_blocking_section ();
+  if (r == -1)
+    ocaml_guestfs_raise_error (g, "removexattr");
+
+  rv = Val_unit;
+  CAMLreturn (rv);
+}
+
+CAMLprim value
+ocaml_guestfs_lremovexattr (value gv, value xattrv, value pathv)
+{
+  CAMLparam3 (gv, xattrv, pathv);
+  CAMLlocal1 (rv);
+
+  guestfs_h *g = Guestfs_val (gv);
+  if (g == NULL)
+    caml_failwith ("lremovexattr: used handle after closing it");
+
+  const char *xattr = String_val (xattrv);
+  const char *path = String_val (pathv);
+  int r;
+
+  caml_enter_blocking_section ();
+  r = guestfs_lremovexattr (g, xattr, path);
+  caml_leave_blocking_section ();
+  if (r == -1)
+    ocaml_guestfs_raise_error (g, "lremovexattr");
+
+  rv = Val_unit;
+  CAMLreturn (rv);
+}
+
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs
index d40f0f8..b42f378 100644
--- a/perl/Guestfs.xs
+++ b/perl/Guestfs.xs
@@ -308,20 +308,34 @@ PREINIT:
       valout = guestfs_test0rstruct (g, val);
       if (valout == NULL)
         croak ("test0rstruct: %s", guestfs_last_error (g));
-      EXTEND (SP, 14);
+      EXTEND (SP, 2 * 14);
+      PUSHs (sv_2mortal (newSVpv ("pv_name", 0)));
       PUSHs (sv_2mortal (newSVpv (valout->pv_name, 0)));
+      PUSHs (sv_2mortal (newSVpv ("pv_uuid", 0)));
       PUSHs (sv_2mortal (newSVpv (valout->pv_uuid, 32)));
+      PUSHs (sv_2mortal (newSVpv ("pv_fmt", 0)));
       PUSHs (sv_2mortal (newSVpv (valout->pv_fmt, 0)));
+      PUSHs (sv_2mortal (newSVpv ("pv_size", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->pv_size)));
+      PUSHs (sv_2mortal (newSVpv ("dev_size", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->dev_size)));
+      PUSHs (sv_2mortal (newSVpv ("pv_free", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->pv_free)));
+      PUSHs (sv_2mortal (newSVpv ("pv_used", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->pv_used)));
+      PUSHs (sv_2mortal (newSVpv ("pv_attr", 0)));
       PUSHs (sv_2mortal (newSVpv (valout->pv_attr, 0)));
+      PUSHs (sv_2mortal (newSVpv ("pv_pe_count", 0)));
       PUSHs (sv_2mortal (my_newSVll (valout->pv_pe_count)));
+      PUSHs (sv_2mortal (newSVpv ("pv_pe_alloc_count", 0)));
       PUSHs (sv_2mortal (my_newSVll (valout->pv_pe_alloc_count)));
+      PUSHs (sv_2mortal (newSVpv ("pv_tags", 0)));
       PUSHs (sv_2mortal (newSVpv (valout->pv_tags, 0)));
+      PUSHs (sv_2mortal (newSVpv ("pe_start", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->pe_start)));
+      PUSHs (sv_2mortal (newSVpv ("pv_mda_count", 0)));
       PUSHs (sv_2mortal (my_newSVll (valout->pv_mda_count)));
+      PUSHs (sv_2mortal (newSVpv ("pv_mda_free", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->pv_mda_free)));
       free (valout);
 
@@ -334,20 +348,34 @@ PREINIT:
       valout = guestfs_test0rstructerr (g);
       if (valout == NULL)
         croak ("test0rstructerr: %s", guestfs_last_error (g));
-      EXTEND (SP, 14);
+      EXTEND (SP, 2 * 14);
+      PUSHs (sv_2mortal (newSVpv ("pv_name", 0)));
       PUSHs (sv_2mortal (newSVpv (valout->pv_name, 0)));
+      PUSHs (sv_2mortal (newSVpv ("pv_uuid", 0)));
       PUSHs (sv_2mortal (newSVpv (valout->pv_uuid, 32)));
+      PUSHs (sv_2mortal (newSVpv ("pv_fmt", 0)));
       PUSHs (sv_2mortal (newSVpv (valout->pv_fmt, 0)));
+      PUSHs (sv_2mortal (newSVpv ("pv_size", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->pv_size)));
+      PUSHs (sv_2mortal (newSVpv ("dev_size", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->dev_size)));
+      PUSHs (sv_2mortal (newSVpv ("pv_free", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->pv_free)));
+      PUSHs (sv_2mortal (newSVpv ("pv_used", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->pv_used)));
+      PUSHs (sv_2mortal (newSVpv ("pv_attr", 0)));
       PUSHs (sv_2mortal (newSVpv (valout->pv_attr, 0)));
+      PUSHs (sv_2mortal (newSVpv ("pv_pe_count", 0)));
       PUSHs (sv_2mortal (my_newSVll (valout->pv_pe_count)));
+      PUSHs (sv_2mortal (newSVpv ("pv_pe_alloc_count", 0)));
       PUSHs (sv_2mortal (my_newSVll (valout->pv_pe_alloc_count)));
+      PUSHs (sv_2mortal (newSVpv ("pv_tags", 0)));
       PUSHs (sv_2mortal (newSVpv (valout->pv_tags, 0)));
+      PUSHs (sv_2mortal (newSVpv ("pe_start", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->pe_start)));
+      PUSHs (sv_2mortal (newSVpv ("pv_mda_count", 0)));
       PUSHs (sv_2mortal (my_newSVll (valout->pv_mda_count)));
+      PUSHs (sv_2mortal (newSVpv ("pv_mda_free", 0)));
       PUSHs (sv_2mortal (my_newSVull (valout->pv_mda_free)));
       free (valout);
 
@@ -781,6 +809,26 @@ PREINIT:
       RETVAL
 
 void
+version (g)
+      guestfs_h *g;
+PREINIT:
+      struct guestfs_version *version;
+ PPCODE:
+      version = guestfs_version (g);
+      if (version == NULL)
+        croak ("version: %s", guestfs_last_error (g));
+      EXTEND (SP, 2 * 4);
+      PUSHs (sv_2mortal (newSVpv ("major", 0)));
+      PUSHs (sv_2mortal (my_newSVll (version->major)));
+      PUSHs (sv_2mortal (newSVpv ("minor", 0)));
+      PUSHs (sv_2mortal (my_newSVll (version->minor)));
+      PUSHs (sv_2mortal (newSVpv ("release", 0)));
+      PUSHs (sv_2mortal (my_newSVll (version->release)));
+      PUSHs (sv_2mortal (newSVpv ("extra", 0)));
+      PUSHs (sv_2mortal (newSVpv (version->extra, 0)));
+      free (version);
+
+void
 mount (g, device, mountpoint)
       guestfs_h *g;
       char *device;
@@ -1123,8 +1171,10 @@ PREINIT:
       nrnodescreated = guestfs_aug_defnode (g, name, expr, val);
       if (nrnodescreated == NULL)
         croak ("aug_defnode: %s", guestfs_last_error (g));
-      EXTEND (SP, 2);
+      EXTEND (SP, 2 * 2);
+      PUSHs (sv_2mortal (newSVpv ("i", 0)));
       PUSHs (sv_2mortal (newSVnv (nrnodescreated->i)));
+      PUSHs (sv_2mortal (newSVpv ("b", 0)));
       PUSHs (sv_2mortal (newSVnv (nrnodescreated->b)));
       free (nrnodescreated);
 
@@ -1562,19 +1612,32 @@ PREINIT:
       statbuf = guestfs_stat (g, path);
       if (statbuf == NULL)
         croak ("stat: %s", guestfs_last_error (g));
-      EXTEND (SP, 13);
+      EXTEND (SP, 2 * 13);
+      PUSHs (sv_2mortal (newSVpv ("dev", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->dev)));
+      PUSHs (sv_2mortal (newSVpv ("ino", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->ino)));
+      PUSHs (sv_2mortal (newSVpv ("mode", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->mode)));
+      PUSHs (sv_2mortal (newSVpv ("nlink", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->nlink)));
+      PUSHs (sv_2mortal (newSVpv ("uid", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->uid)));
+      PUSHs (sv_2mortal (newSVpv ("gid", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->gid)));
+      PUSHs (sv_2mortal (newSVpv ("rdev", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->rdev)));
+      PUSHs (sv_2mortal (newSVpv ("size", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->size)));
+      PUSHs (sv_2mortal (newSVpv ("blksize", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->blksize)));
+      PUSHs (sv_2mortal (newSVpv ("blocks", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->blocks)));
+      PUSHs (sv_2mortal (newSVpv ("atime", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->atime)));
+      PUSHs (sv_2mortal (newSVpv ("mtime", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->mtime)));
+      PUSHs (sv_2mortal (newSVpv ("ctime", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->ctime)));
       free (statbuf);
 
@@ -1588,19 +1651,32 @@ PREINIT:
       statbuf = guestfs_lstat (g, path);
       if (statbuf == NULL)
         croak ("lstat: %s", guestfs_last_error (g));
-      EXTEND (SP, 13);
+      EXTEND (SP, 2 * 13);
+      PUSHs (sv_2mortal (newSVpv ("dev", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->dev)));
+      PUSHs (sv_2mortal (newSVpv ("ino", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->ino)));
+      PUSHs (sv_2mortal (newSVpv ("mode", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->mode)));
+      PUSHs (sv_2mortal (newSVpv ("nlink", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->nlink)));
+      PUSHs (sv_2mortal (newSVpv ("uid", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->uid)));
+      PUSHs (sv_2mortal (newSVpv ("gid", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->gid)));
+      PUSHs (sv_2mortal (newSVpv ("rdev", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->rdev)));
+      PUSHs (sv_2mortal (newSVpv ("size", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->size)));
+      PUSHs (sv_2mortal (newSVpv ("blksize", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->blksize)));
+      PUSHs (sv_2mortal (newSVpv ("blocks", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->blocks)));
+      PUSHs (sv_2mortal (newSVpv ("atime", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->atime)));
+      PUSHs (sv_2mortal (newSVpv ("mtime", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->mtime)));
+      PUSHs (sv_2mortal (newSVpv ("ctime", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->ctime)));
       free (statbuf);
 
@@ -1614,17 +1690,28 @@ PREINIT:
       statbuf = guestfs_statvfs (g, path);
       if (statbuf == NULL)
         croak ("statvfs: %s", guestfs_last_error (g));
-      EXTEND (SP, 11);
+      EXTEND (SP, 2 * 11);
+      PUSHs (sv_2mortal (newSVpv ("bsize", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->bsize)));
+      PUSHs (sv_2mortal (newSVpv ("frsize", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->frsize)));
+      PUSHs (sv_2mortal (newSVpv ("blocks", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->blocks)));
+      PUSHs (sv_2mortal (newSVpv ("bfree", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->bfree)));
+      PUSHs (sv_2mortal (newSVpv ("bavail", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->bavail)));
+      PUSHs (sv_2mortal (newSVpv ("files", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->files)));
+      PUSHs (sv_2mortal (newSVpv ("ffree", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->ffree)));
+      PUSHs (sv_2mortal (newSVpv ("favail", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->favail)));
+      PUSHs (sv_2mortal (newSVpv ("fsid", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->fsid)));
+      PUSHs (sv_2mortal (newSVpv ("flag", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->flag)));
+      PUSHs (sv_2mortal (newSVpv ("namemax", 0)));
       PUSHs (sv_2mortal (my_newSVll (statbuf->namemax)));
       free (statbuf);
 
@@ -2800,3 +2887,113 @@ PREINIT:
       if (r == -1)
         croak ("sfdiskM: %s", guestfs_last_error (g));
 
+SV *
+zfile (g, method, path)
+      guestfs_h *g;
+      char *method;
+      char *path;
+PREINIT:
+      char *description;
+   CODE:
+      description = guestfs_zfile (g, method, path);
+      if (description == NULL)
+        croak ("zfile: %s", guestfs_last_error (g));
+      RETVAL = newSVpv (description, 0);
+      free (description);
+ OUTPUT:
+      RETVAL
+
+void
+getxattrs (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      struct guestfs_xattr_list *xattrs;
+      int i;
+      HV *hv;
+ PPCODE:
+      xattrs = guestfs_getxattrs (g, path);
+      if (xattrs == NULL)
+        croak ("getxattrs: %s", guestfs_last_error (g));
+      EXTEND (SP, xattrs->len);
+      for (i = 0; i < xattrs->len; ++i) {
+        hv = newHV ();
+        (void) hv_store (hv, "attrname", 8, newSVpv (xattrs->val[i].attrname, 0), 0);
+        (void) hv_store (hv, "attrval", 7, newSVpv (xattrs->val[i].attrval, xattrs->val[i].attrval_len), 0);
+        PUSHs (sv_2mortal (newRV ((SV *) hv)));
+      }
+      guestfs_free_xattr_list (xattrs);
+
+void
+lgetxattrs (g, path)
+      guestfs_h *g;
+      char *path;
+PREINIT:
+      struct guestfs_xattr_list *xattrs;
+      int i;
+      HV *hv;
+ PPCODE:
+      xattrs = guestfs_lgetxattrs (g, path);
+      if (xattrs == NULL)
+        croak ("lgetxattrs: %s", guestfs_last_error (g));
+      EXTEND (SP, xattrs->len);
+      for (i = 0; i < xattrs->len; ++i) {
+        hv = newHV ();
+        (void) hv_store (hv, "attrname", 8, newSVpv (xattrs->val[i].attrname, 0), 0);
+        (void) hv_store (hv, "attrval", 7, newSVpv (xattrs->val[i].attrval, xattrs->val[i].attrval_len), 0);
+        PUSHs (sv_2mortal (newRV ((SV *) hv)));
+      }
+      guestfs_free_xattr_list (xattrs);
+
+void
+setxattr (g, xattr, val, vallen, path)
+      guestfs_h *g;
+      char *xattr;
+      char *val;
+      int vallen;
+      char *path;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_setxattr (g, xattr, val, vallen, path);
+      if (r == -1)
+        croak ("setxattr: %s", guestfs_last_error (g));
+
+void
+lsetxattr (g, xattr, val, vallen, path)
+      guestfs_h *g;
+      char *xattr;
+      char *val;
+      int vallen;
+      char *path;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_lsetxattr (g, xattr, val, vallen, path);
+      if (r == -1)
+        croak ("lsetxattr: %s", guestfs_last_error (g));
+
+void
+removexattr (g, xattr, path)
+      guestfs_h *g;
+      char *xattr;
+      char *path;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_removexattr (g, xattr, path);
+      if (r == -1)
+        croak ("removexattr: %s", guestfs_last_error (g));
+
+void
+lremovexattr (g, xattr, path)
+      guestfs_h *g;
+      char *xattr;
+      char *path;
+PREINIT:
+      int r;
+ PPCODE:
+      r = guestfs_lremovexattr (g, xattr, path);
+      if (r == -1)
+        croak ("lremovexattr: %s", guestfs_last_error (g));
+
diff --git a/perl/Makefile.am b/perl/Makefile.am
index 66d1d4b..55761b9 100644
--- a/perl/Makefile.am
+++ b/perl/Makefile.am
@@ -22,6 +22,7 @@ EXTRA_DIST = \
 	examples/LICENSE \
 	examples/*.pl \
 	lib/Sys/Guestfs.pm \
+	lib/Sys/Guestfs/Lib.pm \
 	run-bindtests \
 	run-perl-tests \
 	bindtests.pl \
diff --git a/perl/Makefile.in b/perl/Makefile.in
index d57da25..2d618d2 100644
--- a/perl/Makefile.in
+++ b/perl/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -32,8 +33,9 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -49,7 +51,7 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 subdir = perl
-DIST_COMMON = $(srcdir)/Makefile.PL.in $(srcdir)/Makefile.am \
+DIST_COMMON = README $(srcdir)/Makefile.PL.in $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
@@ -65,8 +67,11 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = Makefile.PL
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -250,6 +255,7 @@ EXTRA_DIST = \
 	examples/LICENSE \
 	examples/*.pl \
 	lib/Sys/Guestfs.pm \
+	lib/Sys/Guestfs/Lib.pm \
 	run-bindtests \
 	run-perl-tests \
 	bindtests.pl \
@@ -277,9 +283,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  perl/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  perl/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign perl/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign perl/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -297,6 +303,7 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 Makefile.PL: $(top_builddir)/config.status $(srcdir)/Makefile.PL.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
@@ -316,6 +323,7 @@ check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
 	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
@@ -327,10 +335,10 @@ check-TESTS: $(TESTS)
 	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
@@ -338,17 +346,18 @@ check-TESTS: $(TESTS)
 	      case " $(XFAIL_TESTS) " in \
 	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
 	  if test "$$all" -eq 1; then \
 	    tests="test"; \
@@ -390,11 +399,15 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    echo "$$grn$$dashes"; \
+	  else \
+	    echo "$$red$$dashes"; \
+	  fi; \
 	  echo "$$banner"; \
 	  test -z "$$skipped" || echo "$$skipped"; \
 	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  echo "$$dashes$$std"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
@@ -414,13 +427,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -449,6 +466,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -468,6 +486,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -475,21 +495,30 @@ info-am:
 install-data-am:
 	@$(NORMAL_INSTALL)
 	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -510,7 +539,7 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: install-am install-data-am install-strip
+.MAKE: check-am install-am install-data-am install-strip
 
 .PHONY: all all-am check check-TESTS check-am clean clean-generic \
 	clean-libtool distclean distclean-generic distclean-libtool \
@@ -533,6 +562,7 @@ uninstall-am:
 
 @HAVE_PERL_TRUE at install-data-hook:
 @HAVE_PERL_TRUE@	$(MAKE) -f Makefile-pl DESTDIR=$(DESTDIR) install
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/perl/README b/perl/README
new file mode 100644
index 0000000..6d7d646
--- /dev/null
+++ b/perl/README
@@ -0,0 +1,20 @@
+Sys::Guestfs
+------------
+
+This directory contains the Perl bindings for the libguestfs API.
+
+The basic libguestfs bindings have the name 'Sys::Guestfs'.
+
+As with all other language bindings, these bindings are generated
+automatically.  See src/generator.ml.
+
+Sys::Guestfs::Lib
+-----------------
+
+Because we use Perl for writing lots of additional tools around
+libguestfs, the Perl bindings also contain an extra library of useful
+functions, called 'Sys::Guestfs::Lib'.  This extra library is entirely
+optional, and only enhances the usefulness of the ordinary libguestfs
+API.
+
+One of the features of this library is tighter libvirt integration.
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index 2fb690a..90e679f 100644
--- a/perl/lib/Sys/Guestfs.pm
+++ b/perl/lib/Sys/Guestfs.pm
@@ -58,6 +58,10 @@ Libguestfs provides ways to enumerate guest storage (eg. partitions,
 LVs, what filesystem is in each LV, etc.).  It can also run commands
 in the context of the guest.  Also you can access filesystems over FTP.
 
+See also L<Sys::Guestfs::Lib(3)> for a set of useful library
+functions for using libguestfs from Perl, including integration
+with libvirt.
+
 =head1 ERRORS
 
 All errors turn into calls to C<croak> (see L<Carp(3)>).
@@ -725,6 +729,16 @@ For more information on states, see L<guestfs(3)>.
 
 This returns the verbose messages flag.
 
+=item @xattrs = $h->getxattrs ($path);
+
+This call lists the extended attributes of the file or directory
+C<path>.
+
+At the system call level, this is a combination of the
+L<listxattr(2)> and L<getxattr(2)> calls.
+
+See also: C<$h-E<gt>lgetxattrs>, L<attr(5)>.
+
 =item @paths = $h->glob_expand ($pattern);
 
 This command searches for all the pathnames matching
@@ -843,6 +857,12 @@ using L<qemu(1)>.
 You should call this after configuring the handle
 (eg. adding drives) but before performing any actions.
 
+=item @xattrs = $h->lgetxattrs ($path);
+
+This is the same as C<$h-E<gt>getxattrs>, but if C<path>
+is a symbolic link, then it returns the extended attributes
+of the link itself.
+
 =item @devices = $h->list_devices ();
 
 List all the block devices.
@@ -866,6 +886,12 @@ there is no cwd) in the format of 'ls -la'.
 This command is mostly useful for interactive sessions.  It
 is I<not> intended that you try to parse the output string.
 
+=item $h->lremovexattr ($xattr, $path);
+
+This is the same as C<$h-E<gt>removexattr>, but if C<path>
+is a symbolic link, then it removes an extended attribute
+of the link itself.
+
 =item @listing = $h->ls ($directory);
 
 List the files in C<directory> (relative to the root directory,
@@ -875,6 +901,12 @@ hidden files are shown.
 This command is mostly useful for interactive sessions.  Programs
 should probably use C<$h-E<gt>readdir> instead.
 
+=item $h->lsetxattr ($xattr, $val, $vallen, $path);
+
+This is the same as C<$h-E<gt>setxattr>, but if C<path>
+is a symbolic link, then it sets an extended attribute
+of the link itself.
+
 =item %statbuf = $h->lstat ($path);
 
 Returns file information for the given C<path>.
@@ -1137,6 +1169,13 @@ This function is primarily intended for use by programs.  To
 get a simple list of names, use C<$h-E<gt>ls>.  To get a printable
 directory for human consumption, use C<$h-E<gt>ll>.
 
+=item $h->removexattr ($xattr, $path);
+
+This call removes the extended attribute named C<xattr>
+of the file C<path>.
+
+See also: C<$h-E<gt>lremovexattr>, L<attr(5)>.
+
 =item $h->resize2fs ($device);
 
 This resizes an ext2 or ext3 filesystem to match the size of
@@ -1289,6 +1328,14 @@ If C<verbose> is true, this turns on verbose messages (to C<stderr>).
 Verbose messages are disabled unless the environment variable
 C<LIBGUESTFS_DEBUG> is defined and set to C<1>.
 
+=item $h->setxattr ($xattr, $val, $vallen, $path);
+
+This call sets the extended attribute named C<xattr>
+of the file C<path> to the value C<val> (of length C<vallen>).
+The value is arbitrary 8 bit data.
+
+See also: C<$h-E<gt>lsetxattr>, L<attr(5)>.
+
 =item $h->sfdisk ($device, $cyls, $heads, $sectors, \@lines);
 
 This is a direct interface to the L<sfdisk(8)> program for creating
@@ -1542,6 +1589,33 @@ C<filename> can also be a named pipe.
 
 See also C<$h-E<gt>download>.
 
+=item %version = $h->version ();
+
+Return the libguestfs version number that the program is linked
+against.
+
+Note that because of dynamic linking this is not necessarily
+the version of libguestfs that you compiled against.  You can
+compile the program, and then at runtime dynamically link
+against a completely different C<libguestfs.so> library.
+
+This call was added in version C<1.0.58>.  In previous
+versions of libguestfs there was no way to get the version
+number.  From C code you can use ELF weak linking tricks to find out if
+this symbol exists (if it doesn't, then it's an earlier version).
+
+The call returns a structure with four elements.  The first
+three (C<major>, C<minor> and C<release>) are numbers and
+correspond to the usual version triplet.  The fourth element
+(C<extra>) is a string and is normally empty, but may be
+used for distro-specific information.
+
+To construct the original version string:
+C<$major.$minor.$release$extra>
+
+I<Note:> Don't use this call to test for availability
+of features.  Distro backports makes this unreliable.
+
 =item $h->vg_activate ($activate, \@volgroups);
 
 This command activates or (if C<activate> is false) deactivates
@@ -1657,6 +1731,15 @@ mounted.
 It is possible that using this program can damage the filesystem
 or data on the filesystem.
 
+=item $description = $h->zfile ($method, $path);
+
+This command runs C<file> after first decompressing C<path>
+using C<method>.
+
+C<method> must be one of C<gzip>, C<compress> or C<bzip2>.
+
+See also: C<$h-E<gt>file>
+
 =cut
 
 1;
@@ -1673,6 +1756,9 @@ Please see the file COPYING.LIB for the full license.
 
 =head1 SEE ALSO
 
-L<guestfs(3)>, L<guestfish(1)>.
+L<guestfs(3)>,
+L<guestfish(1)>,
+L<http://libguestfs.org>,
+L<Sys::Guestfs::Lib(3)>.
 
 =cut
diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm
new file mode 100644
index 0000000..925c494
--- /dev/null
+++ b/perl/lib/Sys/Guestfs/Lib.pm
@@ -0,0 +1,1268 @@
+# Sys::Guestfs::Lib
+# Copyright (C) 2009 Red Hat Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+package Sys::Guestfs::Lib;
+
+use strict;
+use warnings;
+
+use Sys::Guestfs;
+use File::Temp qw/tempdir/;
+use Locale::TextDomain 'libguestfs';
+
+# Optional:
+eval "use Sys::Virt;";
+eval "use XML::XPath;";
+eval "use XML::XPath::XMLParser;";
+
+=pod
+
+=head1 NAME
+
+Sys::Guestfs::Lib - Useful functions for using libguestfs from Perl
+
+=head1 SYNOPSIS
+
+ use Sys::Guestfs::Lib qw(open_guest inspect_all_partitions ...);
+
+ $g = open_guest ($name);
+
+ %fses = inspect_all_partitions ($g, \@partitions);
+
+(and many more calls - see the rest of this manpage)
+
+=head1 DESCRIPTION
+
+C<Sys::Guestfs::Lib> is an extra library of useful functions for using
+the libguestfs API from Perl.  It also provides tighter integration
+with libvirt.
+
+The basic libguestfs API is not covered by this manpage.  Please refer
+instead to L<Sys::Guestfs(3)> and L<guestfs(3)>.  The libvirt API is
+also not covered.  For that, see L<Sys::Virt(3)>.
+
+=head1 BASIC FUNCTIONS
+
+=cut
+
+require Exporter;
+
+use vars qw(@EXPORT_OK @ISA);
+
+ at ISA = qw(Exporter);
+ at EXPORT_OK = qw(open_guest get_partitions resolve_windows_path
+  inspect_all_partitions inspect_partition
+  inspect_operating_systems mount_operating_system inspect_in_detail);
+
+=head2 open_guest
+
+ $g = open_guest ($name);
+
+ $g = open_guest ($name, rw => 1, ...);
+
+ $g = open_guest ($name, address => $uri, ...);
+
+ $g = open_guest ([$img1, $img2, ...], address => $uri, ...);
+
+ ($g, $conn, $dom) = open_guest ($name);
+
+This function opens a libguestfs handle for either the libvirt domain
+called C<$name>, or the disk image called C<$name>.  Any disk images
+found through libvirt or specified explicitly are attached to the
+libguestfs handle.
+
+The C<Sys::Guestfs> handle C<$g> is returned, or if there was an error
+it throws an exception.  To catch errors, wrap the call in an eval
+block.
+
+The first parameter is either a string referring to a libvirt domain
+or a disk image, or (if a guest has several disk images) an arrayref
+C<[$img1, $img2, ...]>.
+
+The handle is I<read-only> by default.  Use the optional parameter
+C<rw =E<gt> 1> to open a read-write handle.  However if you open a
+read-write handle, this function will refuse to use active libvirt
+domains.
+
+The handle is still in the config state when it is returned, so you
+have to call C<$g-E<gt>launch ()> and C<$g-E<gt>wait_ready>.
+
+The optional C<address> parameter can be added to specify the libvirt
+URI.  In addition, L<Sys::Virt(3)> lists other parameters which are
+passed through to C<Sys::Virt-E<gt>new> unchanged.
+
+The implicit libvirt handle is closed after this function, I<unless>
+you call the function in C<wantarray> context, in which case the
+function returns a tuple of: the open libguestfs handle, the open
+libvirt handle, and the open libvirt domain handle.  (This is useful
+if you want to do other things like pulling the XML description of the
+guest).  Note that if this is a straight disk image, then C<$conn> and
+C<$dom> will be C<undef>.
+
+If the C<Sys::Virt> module is not available, then libvirt is bypassed,
+and this function can only open disk images.
+
+=cut
+
+sub open_guest
+{
+    local $_;
+    my $first = shift;
+    my %params = @_;
+
+    my $readwrite = $params{rw};
+
+    my @images = ();
+    if (ref ($first) eq "ARRAY") {
+	@images = @$first;
+    } elsif (ref ($first) eq "SCALAR") {
+	@images = ($first);
+    } else {
+	die __"open_guest: first parameter must be a string or an arrayref"
+    }
+
+    my ($conn, $dom);
+
+    if (-e $images[0]) {
+	foreach (@images) {
+	    die __x("guest image {imagename} does not exist or is not readable",
+		    imagename => $_)
+		unless -r $_;
+	}
+    } else {
+	die __"open_guest: no libvirt support (install Sys::Virt, XML::XPath and XML::XPath::XMLParser)"
+	    unless exists $INC{"Sys/Virt.pm"} &&
+	    exists $INC{"XML/XPath.pm"} &&
+	    exists $INC{"XML/XPath/XMLParser.pm"};
+
+	die __"open_guest: too many domains listed on command line"
+	    if @images > 1;
+
+	$conn = Sys::Virt->new (readonly => 1, @_);
+	die __"open_guest: cannot connect to libvirt" unless $conn;
+
+	my @doms = $conn->list_defined_domains ();
+	my $isitinactive = 1;
+	unless ($readwrite) {
+	    # In the case where we want read-only access to a domain,
+	    # allow the user to specify an active domain too.
+	    push @doms, $conn->list_domains ();
+	    $isitinactive = 0;
+	}
+	foreach (@doms) {
+	    if ($_->get_name () eq $images[0]) {
+		$dom = $_;
+		last;
+	    }
+	}
+
+	unless ($dom) {
+	    if ($isitinactive) {
+		die __x("{imagename} is not the name of an inactive libvirt domain\n",
+			imagename => $images[0]);
+	    } else {
+		die __x("{imagename} is not the name of a libvirt domain\n",
+			imagename => $images[0]);
+	    }
+	}
+
+	# Get the names of the image(s).
+	my $xml = $dom->get_xml_description ();
+
+	my $p = XML::XPath->new (xml => $xml);
+	my @disks = $p->findnodes ('//devices/disk/source/@dev');
+	push (@disks, $p->findnodes ('//devices/disk/source/@file'));
+
+	die __x("{imagename} seems to have no disk devices\n",
+		imagename => $images[0])
+	    unless @disks;
+
+	@images = map { $_->getData } @disks;
+    }
+
+    # We've now got the list of @images, so feed them to libguestfs.
+    my $g = Sys::Guestfs->new ();
+    foreach (@images) {
+	if ($readwrite) {
+	    $g->add_drive ($_);
+	} else {
+	    $g->add_drive_ro ($_);
+	}
+    }
+
+    return wantarray ? ($g, $conn, $dom) : $g
+}
+
+=head2 get_partitions
+
+ @partitions = get_partitions ($g);
+
+This function takes an open libguestfs handle C<$g> and returns all
+partitions and logical volumes found on it.
+
+What is returned is everything that could contain a filesystem (or
+swap).  Physical volumes are excluded from the list, and so are any
+devices which are partitioned (eg. C</dev/sda> would not be returned
+if C</dev/sda1> exists).
+
+=cut
+
+sub get_partitions
+{
+    my $g = shift;
+
+    my @partitions = $g->list_partitions ();
+    my @pvs = $g->pvs ();
+    @partitions = grep { ! _is_pv ($_, @pvs) } @partitions;
+
+    my @lvs = $g->lvs ();
+
+    return sort (@lvs, @partitions);
+}
+
+sub _is_pv {
+    local $_;
+    my $t = shift;
+
+    foreach (@_) {
+	return 1 if $_ eq $t;
+    }
+    0;
+}
+
+=head2 resolve_windows_path
+
+ $path = resolve_windows_path ($g, $path);
+
+ $path = resolve_windows_path ($g, "/windows/system");
+   ==> "/WINDOWS/System"
+       or undef if no path exists
+
+This function, which is specific to FAT/NTFS filesystems (ie.  Windows
+guests), lets you look up a case insensitive C<$path> in the
+filesystem and returns the true, case sensitive path as required by
+the underlying kernel or NTFS-3g driver.
+
+If C<$path> does not exist then this function returns C<undef>.
+
+The C<$path> parameter must begin with C</> character and be separated
+by C</> characters.  Do not use C<\>, drive names, etc.
+
+=cut
+
+sub resolve_windows_path
+{
+    local $_;
+    my $g = shift;
+    my $path = shift;
+
+    if (substr ($path, 0, 1) ne "/") {
+	warn __"resolve_windows_path: path must start with a / character";
+	return undef;
+    }
+
+    my @elems = split (/\//, $path);
+    shift @elems;
+
+    # Start reconstructing the path at the top.
+    $path = "/";
+
+    foreach my $dir (@elems) {
+	my $found = 0;
+	foreach ($g->ls ($path)) {
+	    if (lc ($_) eq lc ($dir)) {
+		if ($path eq "/") {
+		    $path = "/$_";
+		    $found = 1;
+		} else {
+		    $path = "$path/$_";
+		    $found = 1;
+		}
+	    }
+	}
+	return undef unless $found;
+    }
+
+    return $path;
+}
+
+=head1 OPERATING SYSTEM INSPECTION FUNCTIONS
+
+The functions in this section can be used to inspect the operating
+system(s) available inside a virtual machine image.  For example, you
+can find out if the VM is Linux or Windows, how the partitions are
+meant to be mounted, and what applications are installed.
+
+If you just want a simple command-line interface to this
+functionality, use the L<virt-inspector(1)> tool.  The documentation
+below covers the case where you want to access this functionality from
+a Perl program.
+
+Once you have the list of partitions (from C<get_partitions>) there
+are several steps involved:
+
+=over 4
+
+=item 1.
+
+Look at each partition separately and find out what is on it.
+
+The information you get back includes whether the partition contains a
+filesystem or swapspace, what sort of filesystem (eg. ext3, ntfs), and
+a first pass guess at the content of the filesystem (eg. Linux boot,
+Windows root).
+
+The result of this step is a C<%fs> hash of information, one hash for
+each partition.
+
+See: C<inspect_partition>, C<inspect_all_partitions>
+
+=item 2.
+
+Work out the relationship between partitions.
+
+In this step we work out how partitions are related to each other.  In
+the case of a single-boot VM, we work out how the partitions are
+mounted in respect of each other (eg. C</dev/sda1> is mounted as
+C</boot>).  In the case of a multi-boot VM where there are several
+roots, we may identify several operating system roots, and mountpoints
+can even be shared.
+
+The result of this step is a single hash called C<%oses> which is
+described in more detail below, but at the top level looks like:
+
+ %oses = {
+   '/dev/VG/Root1' => \%os1,
+   '/dev/VG/Root2' => \%os2,
+ }
+ 
+ %os1 = {
+   os => 'linux',
+   mounts => {
+     '/' => '/dev/VG/Root1',
+     '/boot' => '/dev/sda1',
+   },
+   ...
+ }
+
+(example shows a multi-boot VM containing two root partitions).
+
+See: C<inspect_operating_systems>
+
+=item 3.
+
+Mount up the disks.
+
+Previous to this point we've essentially been looking at each
+partition in isolation.  Now we construct a true guest filesystem by
+mounting up all of the disks.  Only once everything is mounted up can
+we run commands in the OS context to do more detailed inspection.
+
+See: C<mount_operating_system>
+
+=item 4.
+
+Check for kernels and applications.
+
+This step now does more detailed inspection, where we can look for
+kernels, applications and more installed in the guest.
+
+The result of this is an enhanced C<%os> hash.
+
+See: C<inspect_in_detail>
+
+=item 5.
+
+Generate output.
+
+This library does not contain functions for generating output based on
+the analysis steps above.  Use a command line tool such as
+L<virt-inspector(1)> to get useful output.
+
+=back
+
+=head2 inspect_all_partitions
+
+ %fses = inspect_all_partitions ($g, \@partitions);
+
+ %fses = inspect_all_partitions ($g, \@partitions, use_windows_registry => 1);
+
+This calls C<inspect_partition> for each partition in the list
+C<@partitions>.
+
+The result is a hash which maps partition name to C<\%fs> hashref.
+
+The contents of the C<%fs> hash and the meaning of the
+C<use_windows_registry> flag are explained below.
+
+=cut
+
+sub inspect_all_partitions
+{
+    local $_;
+    my $g = shift;
+    my $parts = shift;
+    my @parts = @$parts;
+    return map { $_ => inspect_partition ($g, $_, @_) } @parts;
+}
+
+=head2 inspect_partition
+
+ \%fs = inspect_partition ($g, $partition);
+
+ \%fs = inspect_partition ($g, $partition, use_windows_registry => 1);
+
+This function inspects the device named C<$partition> in isolation and
+tries to determine what it is.  It returns information such as whether
+the partition is formatted, and with what, whether it is mountable,
+and what it appears to contain (eg. a Windows root, or a Linux /usr).
+
+If C<use_windows_registry> is set to 1, then we will try to download
+and parse the content of the Windows registry (for Windows root
+devices).  However since this is an expensive and error-prone
+operation, we don't do this by default.  It also requires the external
+program C<reged>, patched to remove numerous crashing bugs in the
+upstream version.
+
+The returned value is a hashref C<\%fs> which may contain the
+following top-level keys (any key can be missing):
+
+=over 4
+
+=item fstype
+
+Filesystem type, eg. "ext2" or "ntfs"
+
+=item fsos
+
+Apparent filesystem OS, eg. "linux" or "windows"
+
+=item is_swap
+
+If set, the partition is a swap partition.
+
+=item uuid
+
+Filesystem UUID.
+
+=item label
+
+Filesystem label.
+
+=item is_mountable
+
+If set, the partition could be mounted by libguestfs.
+
+=item content
+
+Filesystem content, if we could determine it.  One of: "linux-grub",
+"linux-root", "linux-usrlocal", "linux-usr", "windows-root".
+
+=item osdistro
+
+(For Linux root partitions only).
+Operating system distribution.  One of: "fedora", "redhat",
+"debian".
+
+=item osversion
+
+(For root partitions only).
+Operating system version.
+
+=item fstab
+
+(For Linux root partitions only).
+The contents of the C</etc/fstab> file.
+
+=item boot_ini
+
+(For Windows root partitions only).
+The contents of the C</boot.ini> (NTLDR) file.
+
+=item registry
+
+The value is an arrayref, which is a list of Windows registry
+file contents, in Windows C<.REG> format.
+
+=back
+
+=cut
+
+sub inspect_partition
+{
+    local $_;
+    my $g = shift;
+    my $dev = shift;		# LV or partition name.
+    my %params = @_;
+
+    my $use_windows_registry = $params{use_windows_registry};
+
+    my %r;			# Result hash.
+
+    # First try 'file(1)' on it.
+    my $file = $g->file ($dev);
+    if ($file =~ /ext2 filesystem data/) {
+	$r{fstype} = "ext2";
+	$r{fsos} = "linux";
+    } elsif ($file =~ /ext3 filesystem data/) {
+	$r{fstype} = "ext3";
+	$r{fsos} = "linux";
+    } elsif ($file =~ /ext4 filesystem data/) {
+	$r{fstype} = "ext4";
+	$r{fsos} = "linux";
+    } elsif ($file =~ m{Linux/i386 swap file}) {
+	$r{fstype} = "swap";
+	$r{fsos} = "linux";
+	$r{is_swap} = 1;
+    }
+
+    # If it's ext2/3/4, then we want the UUID and label.
+    if (exists $r{fstype} && $r{fstype} =~ /^ext/) {
+	$r{uuid} = $g->get_e2uuid ($dev);
+	$r{label} = $g->get_e2label ($dev);
+    }
+
+    # Try mounting it, fnarrr.
+    if (!$r{is_swap}) {
+	$r{is_mountable} = 1;
+	eval { $g->mount_ro ($dev, "/") };
+	if ($@) {
+	    # It's not mountable, probably empty or some format
+	    # we don't understand.
+	    $r{is_mountable} = 0;
+	    goto OUT;
+	}
+
+	# Grub /boot?
+	if ($g->is_file ("/grub/menu.lst") ||
+	    $g->is_file ("/grub/grub.conf")) {
+	    $r{content} = "linux-grub";
+	    _check_grub ($g, \%r);
+	    goto OUT;
+	}
+
+	# Linux root?
+	if ($g->is_dir ("/etc") && $g->is_dir ("/bin") &&
+	    $g->is_file ("/etc/fstab")) {
+	    $r{content} = "linux-root";
+	    $r{is_root} = 1;
+	    _check_linux_root ($g, \%r);
+	    goto OUT;
+	}
+
+	# Linux /usr/local.
+	if ($g->is_dir ("/etc") && $g->is_dir ("/bin") &&
+	    $g->is_dir ("/share") && !$g->exists ("/local") &&
+	    !$g->is_file ("/etc/fstab")) {
+	    $r{content} = "linux-usrlocal";
+	    goto OUT;
+	}
+
+	# Linux /usr.
+	if ($g->is_dir ("/etc") && $g->is_dir ("/bin") &&
+	    $g->is_dir ("/share") && $g->exists ("/local") &&
+	    !$g->is_file ("/etc/fstab")) {
+	    $r{content} = "linux-usr";
+	    goto OUT;
+	}
+
+	# Windows root?
+	if ($g->is_file ("/AUTOEXEC.BAT") ||
+	    $g->is_file ("/autoexec.bat") ||
+	    $g->is_dir ("/Program Files") ||
+	    $g->is_dir ("/WINDOWS") ||
+	    $g->is_file ("/boot.ini") ||
+	    $g->is_file ("/ntldr")) {
+	    $r{fstype} = "ntfs"; # XXX this is a guess
+	    $r{fsos} = "windows";
+	    $r{content} = "windows-root";
+	    $r{is_root} = 1;
+	    _check_windows_root ($g, \%r, $use_windows_registry);
+	    goto OUT;
+	}
+    }
+
+  OUT:
+    $g->umount_all ();
+    return \%r;
+}
+
+sub _check_linux_root
+{
+    local $_;
+    my $g = shift;
+    my $r = shift;
+
+    # Look into /etc to see if we recognise the operating system.
+    if ($g->is_file ("/etc/redhat-release")) {
+	$_ = $g->cat ("/etc/redhat-release");
+	if (/Fedora release (\d+\.\d+)/) {
+	    $r->{osdistro} = "fedora";
+	    $r->{osversion} = "$1"
+	} elsif (/(Red Hat Enterprise Linux|CentOS|Scientific Linux).*release (\d+).*Update (\d+)/) {
+	    $r->{osdistro} = "redhat";
+	    $r->{osversion} = "$2.$3";
+        } elsif (/(Red Hat Enterprise Linux|CentOS|Scientific Linux).*release (\d+(?:\.(\d+))?)/) {
+	    $r->{osdistro} = "redhat";
+	    $r->{osversion} = "$2";
+	} else {
+	    $r->{osdistro} = "redhat";
+	}
+    } elsif ($g->is_file ("/etc/debian_version")) {
+	$_ = $g->cat ("/etc/debian_version");
+	if (/(\d+\.\d+)/) {
+	    $r->{osdistro} = "debian";
+	    $r->{osversion} = "$1";
+	} else {
+	    $r->{osdistro} = "debian";
+	}
+    }
+
+    # Parse the contents of /etc/fstab.  This is pretty vital so
+    # we can determine where filesystems are supposed to be mounted.
+    eval "\$_ = \$g->cat ('/etc/fstab');";
+    if (!$@ && $_) {
+	my @lines = split /\n/;
+	my @fstab;
+	foreach (@lines) {
+	    my @fields = split /[ \t]+/;
+	    if (@fields >= 2) {
+		my $spec = $fields[0]; # first column (dev/label/uuid)
+		my $file = $fields[1]; # second column (mountpoint)
+		if ($spec =~ m{^/} ||
+		    $spec =~ m{^LABEL=} ||
+		    $spec =~ m{^UUID=} ||
+		    $file eq "swap") {
+		    push @fstab, [$spec, $file]
+		}
+	    }
+	}
+	$r->{fstab} = \@fstab if @fstab;
+    }
+}
+
+# We only support NT.  The control file /boot.ini contains a list of
+# Windows installations and their %systemroot%s in a simple text
+# format.
+#
+# XXX We could parse this better.  This won't work if /boot.ini is on
+# a different drive from the %systemroot%, and in other unusual cases.
+
+sub _check_windows_root
+{
+    local $_;
+    my $g = shift;
+    my $r = shift;
+    my $use_windows_registry = shift;
+
+    my $boot_ini = resolve_windows_path ($g, "/boot.ini");
+    $r->{boot_ini} = $boot_ini;
+
+    if (defined $r->{boot_ini}) {
+	$_ = $g->cat ($boot_ini);
+	my @lines = split /\n/;
+	my $section;
+	my $systemroot;
+	foreach (@lines) {
+	    if (m/\[.*\]/) {
+		$section = $1;
+	    } elsif (m/^default=.*?\\(\w+)$/i) {
+		$systemroot = $1;
+		last;
+	    } elsif (m/\\(\w+)=/) {
+		$systemroot = $1;
+		last;
+	    }
+	}
+
+	if (defined $systemroot) {
+	    $r->{systemroot} = resolve_windows_path ($g, "/$systemroot");
+	    if (defined $r->{systemroot} && $use_windows_registry) {
+		_check_windows_registry ($g, $r, $r->{systemroot});
+	    }
+	}
+    }
+}
+
+sub _check_windows_registry
+{
+    local $_;
+    my $g = shift;
+    my $r = shift;
+    my $systemroot = shift;
+
+    # Download the system registry files.  Only download the
+    # interesting ones, and we don't bother with user profiles at all.
+
+    my $configdir = resolve_windows_path ($g, "$systemroot/system32/config");
+    if (defined $configdir) {
+	my $softwaredir = resolve_windows_path ($g, "$configdir/software");
+	if (defined $softwaredir) {
+	    _load_windows_registry ($g, $r, $softwaredir,
+				    "HKEY_LOCAL_MACHINE\\SOFTWARE");
+	}
+	my $systemdir = resolve_windows_path ($g, "$configdir/system");
+	if (defined $systemdir) {
+	    _load_windows_registry ($g, $r, $systemdir,
+				    "HKEY_LOCAL_MACHINE\\System");
+	}
+    }
+}
+
+sub _load_windows_registry
+{
+    local $_;
+    my $g = shift;
+    my $r = shift;
+    my $regfile = shift;
+    my $prefix = shift;
+
+    my $dir = tempdir (CLEANUP => 1);
+
+    $g->download ($regfile, "$dir/reg");
+
+    # 'reged' command is particularly noisy.  Redirect stdout and
+    # stderr to /dev/null temporarily.
+    open SAVEOUT, ">&STDOUT";
+    open SAVEERR, ">&STDERR";
+    open STDOUT, ">/dev/null";
+    open STDERR, ">/dev/null";
+
+    my @cmd = ("reged", "-x", "$dir/reg", "$prefix", "\\", "$dir/out");
+    my $res = system (@cmd);
+
+    close STDOUT;
+    close STDERR;
+    open STDOUT, ">&SAVEOUT";
+    open STDERR, ">&SAVEERR";
+    close SAVEOUT;
+    close SAVEERR;
+
+    unless ($res == 0) {
+	warn __x("reged command failed: {errormsg}", errormsg => $?);
+	return;
+    }
+
+    # Some versions of reged segfault on inputs.  If that happens we
+    # may get no / partial output file.  Anyway, if it exists, load
+    # it.
+    my $content;
+    unless (open F, "$dir/out") {
+	warn __x("no output from reged command: {errormsg}", errormsg => $!);
+	return;
+    }
+    { local $/ = undef; $content = <F>; }
+    close F;
+
+    my @registry = ();
+    @registry = @{$r->{registry}} if exists $r->{registry};
+    push @registry, $content;
+    $r->{registry} = \@registry;
+}
+
+sub _check_grub
+{
+    local $_;
+    my $g = shift;
+    my $r = shift;
+
+    # Grub version, if we care.
+}
+
+=head2 inspect_operating_systems
+
+ \%oses = inspect_operating_systems ($g, \%fses);
+
+This function works out how partitions are related to each other.  In
+the case of a single-boot VM, we work out how the partitions are
+mounted in respect of each other (eg. C</dev/sda1> is mounted as
+C</boot>).  In the case of a multi-boot VM where there are several
+roots, we may identify several operating system roots, and mountpoints
+can even be shared.
+
+This function returns a hashref C<\%oses> which at the top level looks
+like:
+
+ %oses = {
+   '/dev/VG/Root' => \%os,
+ }
+ 
+(There can be multiple roots for a multi-boot VM).
+
+The C<\%os> hash contains the following keys (any can be omitted):
+
+=over 4
+
+=item os
+
+Operating system type, eg. "linux", "windows".
+
+=item distro
+
+Operating system distribution, eg. "debian".
+
+=item version
+
+Operating system version, eg. "4.0".
+
+=item root
+
+The value is a reference to the root partition C<%fs> hash.
+
+=item root_device
+
+The value is the name of the root partition (as a string).
+
+=item mounts
+
+Mountpoints.
+The value is a hashref like this:
+
+ mounts => {
+   '/' => '/dev/VG/Root',
+   '/boot' => '/dev/sda1',
+ }
+
+=item filesystems
+
+Filesystems (including swap devices and unmounted partitions).
+The value is a hashref like this:
+
+ filesystems => {
+   '/dev/sda1' => \%fs,
+   '/dev/VG/Root' => \%fs,
+   '/dev/VG/Swap' => \%fs,
+ }
+
+=back
+
+=cut
+
+sub inspect_operating_systems
+{
+    local $_;
+    my $g = shift;
+    my $fses = shift;
+
+    my %oses = ();
+
+    foreach (sort keys %$fses) {
+	if ($fses->{$_}->{is_root}) {
+	    my %r = (
+		root => $fses->{$_},
+		root_device => $_
+		);
+	    _get_os_version ($g, \%r);
+	    _assign_mount_points ($g, $fses, \%r);
+	    $oses{$_} = \%r;
+	}
+    }
+
+    return \%oses;
+}
+
+sub _get_os_version
+{
+    local $_;
+    my $g = shift;
+    my $r = shift;
+
+    $r->{os} = $r->{root}->{fsos} if exists $r->{root}->{fsos};
+    $r->{distro} = $r->{root}->{osdistro} if exists $r->{root}->{osdistro};
+    $r->{version} = $r->{root}->{osversion} if exists $r->{root}->{osversion};
+}
+
+sub _assign_mount_points
+{
+    local $_;
+    my $g = shift;
+    my $fses = shift;
+    my $r = shift;
+
+    $r->{mounts} = { "/" => $r->{root_device} };
+    $r->{filesystems} = { $r->{root_device} => $r->{root} };
+
+    # Use /etc/fstab if we have it to mount the rest.
+    if (exists $r->{root}->{fstab}) {
+	my @fstab = @{$r->{root}->{fstab}};
+	foreach (@fstab) {
+	    my ($spec, $file) = @$_;
+
+	    my ($dev, $fs) = _find_filesystem ($g, $fses, $spec);
+	    if ($dev) {
+		$r->{mounts}->{$file} = $dev;
+		$r->{filesystems}->{$dev} = $fs;
+		if (exists $fs->{used}) {
+		    $fs->{used}++
+		} else {
+		    $fs->{used} = 1
+	        }
+                $fs->{spec} = $spec;
+	    }
+	}
+    }
+}
+
+# Find filesystem by device name, LABEL=.. or UUID=..
+sub _find_filesystem
+{
+    my $g = shift;
+    my $fses = shift;
+    local $_ = shift;
+
+    if (/^LABEL=(.*)/) {
+	my $label = $1;
+	foreach (sort keys %$fses) {
+	    if (exists $fses->{$_}->{label} &&
+		$fses->{$_}->{label} eq $label) {
+		return ($_, $fses->{$_});
+	    }
+	}
+	warn __x("unknown filesystem label {label}\n", label => $label);
+	return ();
+    } elsif (/^UUID=(.*)/) {
+	my $uuid = $1;
+	foreach (sort keys %$fses) {
+	    if (exists $fses->{$_}->{uuid} &&
+		$fses->{$_}->{uuid} eq $uuid) {
+		return ($_, $fses->{$_});
+	    }
+	}
+	warn __x("unknown filesystem UUID {uuid}\n", uuid => $uuid);
+	return ();
+    } else {
+	return ($_, $fses->{$_}) if exists $fses->{$_};
+
+        # The following is to handle the case where an fstab entry specifies a
+        # specific device rather than its label or uuid, and the libguestfs
+        # appliance has named the device differently due to the use of a
+        # different driver.
+        # This will work as long as the underlying drivers recognise devices in
+        # the same order.
+	if (m{^/dev/hd(.*)} && exists $fses->{"/dev/sd$1"}) {
+	    return ("/dev/sd$1", $fses->{"/dev/sd$1"});
+	}
+	if (m{^/dev/xvd(.*)} && exists $fses->{"/dev/sd$1"}) {
+	    return ("/dev/sd$1", $fses->{"/dev/sd$1"});
+	}
+	if (m{^/dev/mapper/(.*)-(.*)$} && exists $fses->{"/dev/$1/$2"}) {
+	    return ("/dev/$1/$2", $fses->{"/dev/$1/$2"});
+	}
+
+	return () if m{/dev/cdrom};
+
+	warn __x("unknown filesystem {fs}\n", fs => $_);
+	return ();
+    }
+}
+
+=head2 mount_operating_system
+
+ mount_operating_system ($g, \%os);
+
+This function mounts the operating system described in the
+C<%os> hash according to the C<mounts> table in that hash (see
+C<inspect_operating_systems>).
+
+The partitions are mounted read-only.
+
+To reverse the effect of this call, use the standard
+libguestfs API call C<$g-E<gt>umount_all ()>.
+
+=cut
+
+sub mount_operating_system
+{
+    local $_;
+    my $g = shift;
+    my $os = shift;
+
+    my $mounts = $os->{mounts};
+
+    # Have to mount / first.  Luckily '/' is early in the ASCII
+    # character set, so this should be OK.
+    foreach (sort keys %$mounts) {
+	$g->mount_ro ($mounts->{$_}, $_)
+	    if $_ ne "swap" && $_ ne "none" && ($_ eq '/' || $g->is_dir ($_));
+    }
+}
+
+=head2 inspect_in_detail
+
+ mount_operating_system ($g, \%os);
+ inspect_in_detail ($g, \%os);
+ $g->umount_all ();
+
+The C<inspect_in_detail> function inspects the mounted operating
+system for installed applications, installed kernels, kernel modules
+and more.
+
+It adds extra keys to the existing C<%os> hash reflecting what it
+finds.  These extra keys are:
+
+=over 4
+
+=item apps
+
+List of applications.
+
+=item kernels
+
+List of kernels.
+
+=item modprobe_aliases
+
+(For Linux VMs).
+The contents of the modprobe configuration.
+
+=item initrd_modules
+
+(For Linux VMs).
+The kernel modules installed in the initrd.  The value is
+a hashref of kernel version to list of modules.
+
+=back
+
+=cut
+
+sub inspect_in_detail
+{
+    local $_;
+    my $g = shift;
+    my $os = shift;
+
+    _check_for_applications ($g, $os);
+    _check_for_kernels ($g, $os);
+    if ($os->{os} eq "linux") {
+	_check_for_modprobe_aliases ($g, $os);
+	_check_for_initrd ($g, $os);
+    }
+}
+
+sub _check_for_applications
+{
+    local $_;
+    my $g = shift;
+    my $os = shift;
+
+    my @apps;
+
+    my $osn = $os->{os};
+    if ($osn eq "linux") {
+	my $distro = $os->{distro};
+	if (defined $distro && ($distro eq "redhat" || $distro eq "fedora")) {
+	    my @lines = $g->command_lines
+		(["rpm",
+		  "-q", "-a",
+		  "--qf", "%{name} %{epoch} %{version} %{release} %{arch}\n"]);
+	    foreach (@lines) {
+		if (m/^(.*) (.*) (.*) (.*) (.*)$/) {
+		    my $epoch = $2;
+		    $epoch = "" if $epoch eq "(none)";
+		    my $app = {
+			name => $1,
+			epoch => $epoch,
+			version => $3,
+			release => $4,
+			arch => $5
+		    };
+		    push @apps, $app
+		}
+	    }
+	}
+    } elsif ($osn eq "windows") {
+	# XXX
+	# I worked out a general plan for this, but haven't
+	# implemented it yet.  We can iterate over /Program Files
+	# looking for *.EXE files, which we download, then use
+	# i686-pc-mingw32-windres on, to find the VERSIONINFO
+	# section, which has a lot of useful information.
+    }
+
+    $os->{apps} = \@apps;
+}
+
+sub _check_for_kernels
+{
+    local $_;
+    my $g = shift;
+    my $os = shift;
+
+    my @kernels;
+
+    my $osn = $os->{os};
+    if ($osn eq "linux") {
+	# Installed kernels will have a corresponding /lib/modules/<version>
+	# directory, which is the easiest way to find out what kernels
+	# are installed, and what modules are available.
+	foreach ($g->ls ("/lib/modules")) {
+	    if ($g->is_dir ("/lib/modules/$_")) {
+		my %kernel;
+		$kernel{version} = $_;
+
+		# List modules.
+		my @modules;
+		foreach ($g->find ("/lib/modules/$_")) {
+		    if (m,/([^/]+)\.ko$, || m,([^/]+)\.o$,) {
+			push @modules, $1;
+		    }
+		}
+
+		$kernel{modules} = \@modules;
+
+		push @kernels, \%kernel;
+	    }
+	}
+
+    } elsif ($osn eq "windows") {
+	# XXX
+    }
+
+    $os->{kernels} = \@kernels;
+}
+
+# Check /etc/modprobe.conf to see if there are any specified
+# drivers associated with network (ethX) or hard drives.  Normally
+# one might find something like:
+#
+#  alias eth0 xennet
+#  alias scsi_hostadapter xenblk
+#
+# XXX This doesn't look beyond /etc/modprobe.conf, eg. in /etc/modprobe.d/
+
+sub _check_for_modprobe_aliases
+{
+    local $_;
+    my $g = shift;
+    my $os = shift;
+
+    # Initialise augeas
+    my $success = 0;
+    $success = $g->aug_init("/", 16);
+
+    # Register /etc/modules.conf and /etc/conf.modules to the Modprobe lens
+    my @results;
+    @results = $g->aug_match("/augeas/load/Modprobe/incl");
+
+    # Calculate the next index of /augeas/load/Modprobe/incl
+    my $i = 1;
+    foreach ( @results ) {
+        next unless m{/augeas/load/Modprobe/incl\[(\d*)]};
+        $i = $1 + 1 if ($1 == $i);
+    }
+
+    $success = $g->aug_set("/augeas/load/Modprobe/incl[$i]",
+                           "/etc/modules.conf");
+    $i++;
+    $success = $g->aug_set("/augeas/load/Modprobe/incl[$i]",
+                                  "/etc/conf.modules");
+
+    # Make augeas reload
+    $success = $g->aug_load();
+
+    my %modprobe_aliases;
+
+    for my $pattern qw(/files/etc/conf.modules/alias
+                       /files/etc/modules.conf/alias
+                       /files/etc/modprobe.conf/alias
+                       /files/etc/modprobe.d/*/alias) {
+        @results = $g->aug_match($pattern);
+
+        for my $path ( @results ) {
+            $path =~ m{^/files(.*)/alias(?:\[\d*\])?$}
+                or die __x("{path} doesn't match augeas pattern",
+			   path => $path);
+            my $file = $1;
+
+            my $alias;
+            $alias = $g->aug_get($path);
+
+            my $modulename;
+            $modulename = $g->aug_get($path.'/modulename');
+
+            my %aliasinfo;
+            $aliasinfo{modulename} = $modulename;
+            $aliasinfo{augeas} = $path;
+            $aliasinfo{file} = $file;
+
+            $modprobe_aliases{$alias} = \%aliasinfo;
+        }
+    }
+
+    $os->{modprobe_aliases} = \%modprobe_aliases;
+}
+
+# Get a listing of device drivers in any initrd corresponding to a
+# kernel.  This is an indication of what can possibly be booted.
+
+sub _check_for_initrd
+{
+    local $_;
+    my $g = shift;
+    my $os = shift;
+
+    my %initrd_modules;
+
+    foreach my $initrd ($g->ls ("/boot")) {
+	if ($initrd =~ m/^initrd-(.*)\.img$/ && $g->is_file ("/boot/$initrd")) {
+	    my $version = $1;
+	    my @modules;
+
+	    # Disregard old-style compressed ext2 files, since cpio
+	    # takes ages to (fail to) process these.
+	    if ($g->file ("/boot/$initrd") !~ /gzip compressed/ ||
+		$g->zfile ("gzip", "/boot/$initrd") !~ /ext2 filesystem/) {
+		eval {
+		    @modules = $g->initrd_list ("/boot/$initrd");
+		};
+		unless ($@) {
+		    @modules = grep { m,([^/]+)\.ko$, || m,([^/]+)\.o$, }
+		    @modules;
+		    $initrd_modules{$version} = \@modules
+		} else {
+		    warn __x("{filename}: could not read initrd format",
+			     filename => "/boot/$initrd");
+	        }
+	    }
+	}
+    }
+
+    $os->{initrd_modules} = \%initrd_modules;
+}
+
+
+1;
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009 Red Hat Inc.
+
+=head1 LICENSE
+
+Please see the file COPYING.LIB for the full license.
+
+=head1 SEE ALSO
+
+L<virt-inspector(1)>,
+L<Sys::Guestfs(3)>,
+L<guestfs(3)>,
+L<http://libguestfs.org/>,
+L<Sys::Virt(3)>,
+L<http://libvirt.org/>,
+L<guestfish(1)>.
+
+=cut
diff --git a/po/Makevars b/po/Makevars
index 2ef4f7e..76b47a4 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -8,7 +8,8 @@ subdir = po
 top_builddir = ..
 
 # These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+# --keyword=__ etc are for Perl code using perl-libintl.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=__ --keyword=__x
 
 # This is the copyright holder that gets inserted into the header of the
 # $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 7762d69..60aeddc 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,79 @@
+cat/virt-cat.pl
+daemon/augeas.c
+daemon/blockdev.c
+daemon/checksum.c
+daemon/cmp.c
+daemon/command.c
+daemon/cpmv.c
+daemon/debug.c
+daemon/devsparts.c
+daemon/df.c
+daemon/dir.c
+daemon/dmesg.c
+daemon/dropcaches.c
+daemon/du.c
+daemon/ext2.c
+daemon/file.c
+daemon/find.c
+daemon/fsck.c
+daemon/glob.c
+daemon/grub.c
+daemon/guestfsd.c
+daemon/headtail.c
+daemon/hexdump.c
+daemon/initrd.c
+daemon/ls.c
+daemon/lvm.c
+daemon/mknod.c
+daemon/mount.c
+daemon/names.c
+daemon/ntfs.c
+daemon/pingdaemon.c
+daemon/proto.c
+daemon/readdir.c
+daemon/scrub.c
+daemon/sfdisk.c
+daemon/sleep.c
+daemon/stat.c
+daemon/strings.c
+daemon/stubs.c
+daemon/swap.c
+daemon/sync.c
+daemon/tar.c
+daemon/umask.c
+daemon/upload.c
+daemon/wc.c
+daemon/xattr.c
+daemon/zero.c
+daemon/zerofree.c
+df/virt-df.pl
 fish/alloc.c
+fish/cmds.c
+fish/completion.c
+fish/destpaths.c
 fish/echo.c
 fish/edit.c
 fish/fish.c
+fish/glob.c
+fish/lcd.c
+fish/more.c
+fish/rc.c
+fish/rc_protocol.c
+fish/reopen.c
+fish/tilde.c
+fish/time.c
+inspector/virt-inspector.pl
+java/com_redhat_et_libguestfs_GuestFS.c
+ocaml/guestfs_c_actions.c
+ocaml/guestfs_c.c
+perl/bindtests.pl
+perl/Guestfs.c
+perl/lib/Sys/Guestfs/Lib.pm
+perl/lib/Sys/Guestfs.pm
+python/guestfs-py.c
+ruby/ext/guestfs/_guestfs.c
+src/guestfs-actions.c
+src/guestfs-bindtests.c
 src/guestfs.c
+src/guestfs_protocol.c
+v2v/virt-v2v.pl
diff --git a/po/libguestfs.pot b/po/libguestfs.pot
index aedb480..126d448 100644
--- a/po/libguestfs.pot
+++ b/po/libguestfs.pot
@@ -9,7 +9,7 @@ msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
 "component=libguestfs&product=Virtualization+Tools\n"
-"POT-Creation-Date: 2009-07-07 20:03+0100\n"
+"POT-Creation-Date: 2009-07-15 16:35+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -17,6 +17,62 @@ msgstr ""
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+#: cat/virt-cat.pl:126
+msgid "virt-cat: no image, VM names or filenames to cat given"
+msgstr ""
+
+#: cat/virt-cat.pl:152 v2v/virt-v2v.pl:208
+msgid "no root device found in this operating system image"
+msgstr ""
+
+#: cat/virt-cat.pl:153
+msgid "multiboot operating systems are not supported by virt-cat"
+msgstr ""
+
+#: df/virt-df.pl:258
+msgid "Virtual Machine"
+msgstr ""
+
+#: df/virt-df.pl:258
+msgid "Filesystem"
+msgstr ""
+
+#: df/virt-df.pl:261
+msgid "1K-blocks"
+msgstr ""
+
+#: df/virt-df.pl:263
+msgid "Size"
+msgstr ""
+
+#: df/virt-df.pl:265
+msgid "Used"
+msgstr ""
+
+#: df/virt-df.pl:266
+msgid "Available"
+msgstr ""
+
+#: df/virt-df.pl:267
+msgid "Use%"
+msgstr ""
+
+#: df/virt-df.pl:269
+msgid "Inodes"
+msgstr ""
+
+#: df/virt-df.pl:270
+msgid "IUsed"
+msgstr ""
+
+#: df/virt-df.pl:271
+msgid "IFree"
+msgstr ""
+
+#: df/virt-df.pl:272
+msgid "IUse%"
+msgstr ""
+
 #: fish/alloc.c:39
 #, c-format
 msgid "use 'alloc file size' to create an image\n"
@@ -37,7 +93,7 @@ msgstr ""
 msgid "use '%s filename' to edit a file\n"
 msgstr ""
 
-#: fish/fish.c:90
+#: fish/fish.c:94
 #, c-format
 msgid ""
 "guestfish: guest filesystem shell\n"
@@ -61,45 +117,80 @@ msgid ""
 "  -D|--no-dest-paths   Don't tab-complete paths from guest fs\n"
 "  -f|--file file       Read commands from file\n"
 "  -i|--inspector       Run virt-inspector to get disk mountpoints\n"
+"  --listen             Listen for remote commands\n"
 "  -m|--mount dev[:mnt] Mount dev on mnt (if omitted, /)\n"
 "  -n|--no-sync         Don't autosync\n"
+"  --remote[=pid]       Send commands to remote guestfish\n"
 "  -r|--ro              Mount read-only\n"
 "  -v|--verbose         Verbose messages\n"
+"  -x                   Echo each command before executing it\n"
 "  -V|--version         Display version and exit\n"
 "For more information,  see the manpage guestfish(1).\n"
 msgstr ""
 
-#: fish/fish.c:157
+#: fish/fish.c:168
 #, c-format
 msgid "guestfs_create: failed to create handle\n"
 msgstr ""
 
-#: fish/fish.c:202
+#: fish/fish.c:198
+#, c-format
+msgid "guestfish: --listen=PID: PID was not a number: %s\n"
+msgstr ""
+
+#: fish/fish.c:204
+#, c-format
+msgid ""
+"guestfish: remote: $GUESTFISH_PID must be set to the PID of the remote "
+"process\n"
+msgstr ""
+
+#: fish/fish.c:209
+#, c-format
+msgid "guestfish: unknown long option: %s (%d)\n"
+msgstr ""
+
+#: fish/fish.c:236
 #, c-format
 msgid "guestfish: only one -f parameter can be given\n"
 msgstr ""
 
-#: fish/fish.c:260
+#: fish/fish.c:298
 #, c-format
 msgid "guestfish: unexpected command line option 0x%x\n"
 msgstr ""
 
-#: fish/fish.c:272
+#: fish/fish.c:310
 #, c-format
-msgid "guestfish: cannot use -i option with -a or -m\n"
+msgid "guestfish: cannot use -i option with -a, -m, --listen or --remote\n"
 msgstr ""
 
-#: fish/fish.c:276
+#: fish/fish.c:314
 #, c-format
 msgid "guestfish -i requires a libvirt domain or path(s) to disk image(s)\n"
 msgstr ""
 
-#: fish/fish.c:284
+#: fish/fish.c:322
 #, c-format
 msgid "guestfish: virt-inspector command too long for fixed-size buffer\n"
 msgstr ""
 
-#: fish/fish.c:464
+#: fish/fish.c:364
+#, c-format
+msgid "guestfish: cannot use --listen and --remote options at the same time\n"
+msgstr ""
+
+#: fish/fish.c:370
+#, c-format
+msgid "guestfish: extra parameters on the command line with --listen flag\n"
+msgstr ""
+
+#: fish/fish.c:374
+#, c-format
+msgid "guestfish: cannot use --listen and --file options at the same time\n"
+msgstr ""
+
+#: fish/fish.c:520
 #, c-format
 msgid ""
 "\n"
@@ -111,69 +202,77 @@ msgid ""
 "\n"
 msgstr ""
 
-#: fish/fish.c:542
+#: fish/fish.c:600
 #, c-format
 msgid "guestfish: unterminated double quote\n"
 msgstr ""
 
-#: fish/fish.c:547 fish/fish.c:562
+#: fish/fish.c:605 fish/fish.c:620
 #, c-format
 msgid "guestfish: command arguments not separated by whitespace\n"
 msgstr ""
 
-#: fish/fish.c:557
+#: fish/fish.c:615
 #, c-format
 msgid "guestfish: unterminated single quote\n"
 msgstr ""
 
-#: fish/fish.c:602
+#: fish/fish.c:665
 #, c-format
 msgid "guestfish: internal error parsing string at '%s'\n"
 msgstr ""
 
-#: fish/fish.c:615
+#: fish/fish.c:682
 #, c-format
 msgid "guestfish: too many arguments\n"
 msgstr ""
 
-#: fish/fish.c:642
+#: fish/fish.c:711
 #, c-format
 msgid "guestfish: empty command on command line\n"
 msgstr ""
 
-#: fish/fish.c:755
+#: fish/fish.c:838
 msgid "display a list of commands or help on a command"
 msgstr ""
 
-#: fish/fish.c:757
+#: fish/fish.c:840
 msgid "quit guestfish"
 msgstr ""
 
-#: fish/fish.c:760
+#: fish/fish.c:843
 msgid "allocate an image"
 msgstr ""
 
-#: fish/fish.c:762
+#: fish/fish.c:845
 msgid "display a line of text"
 msgstr ""
 
-#: fish/fish.c:764
+#: fish/fish.c:847
 msgid "edit a file in the image"
 msgstr ""
 
-#: fish/fish.c:766
+#: fish/fish.c:849
 msgid "local change directory"
 msgstr ""
 
-#: fish/fish.c:768
+#: fish/fish.c:851
 msgid "expand wildcards in command"
 msgstr ""
 
-#: fish/fish.c:770
+#: fish/fish.c:853
+msgid "view a file in the pager"
+msgstr ""
+
+#: fish/fish.c:855
+msgid "close and reopen libguestfs handle"
+msgstr ""
+
+#: fish/fish.c:857
 msgid "measure time taken to run command"
 msgstr ""
 
-#: fish/fish.c:782
+#: fish/fish.c:869
 #, c-format
 msgid ""
 "alloc - allocate an image\n"
@@ -193,7 +292,7 @@ msgid ""
 "    <nn>sects        number of 512 byte sectors\n"
 msgstr ""
 
-#: fish/fish.c:798
+#: fish/fish.c:885
 #, c-format
 msgid ""
 "echo - display a line of text\n"
@@ -202,7 +301,7 @@ msgid ""
 "    This echos the parameters to the terminal.\n"
 msgstr ""
 
-#: fish/fish.c:805
+#: fish/fish.c:892
 #, c-format
 msgid ""
 "edit - edit a file in the image\n"
@@ -220,7 +319,7 @@ msgid ""
 "    (> 2 MB) or binary files containing \\0 bytes.\n"
 msgstr ""
 
-#: fish/fish.c:819
+#: fish/fish.c:906
 #, c-format
 msgid ""
 "lcd - local change directory\n"
@@ -231,7 +330,7 @@ msgid ""
 "    place.\n"
 msgstr ""
 
-#: fish/fish.c:826
+#: fish/fish.c:913
 #, c-format
 msgid ""
 "glob - expand wildcards in command\n"
@@ -242,7 +341,15 @@ msgid ""
 "    once for each expanded argument.\n"
 msgstr ""
 
-#: fish/fish.c:834
+#: fish/fish.c:920
+#, c-format
+msgid ""
+"help - display a list of commands or help on a command\n"
+"     help cmd\n"
+"     help\n"
+msgstr ""
+
+#: fish/fish.c:925
 #, c-format
 msgid ""
 "more - view a file in the pager\n"
@@ -260,22 +367,25 @@ msgid ""
 "    (> 2 MB) or binary files containing \\0 bytes.\n"
 msgstr ""
 
-#: fish/fish.c:848
+#: fish/fish.c:941
 #, c-format
 msgid ""
-"help - display a list of commands or help on a command\n"
-"     help cmd\n"
-"     help\n"
+"quit - quit guestfish\n"
+"     quit\n"
 msgstr ""
 
-#: fish/fish.c:854
+#: fish/fish.c:944
 #, c-format
 msgid ""
-"quit - quit guestfish\n"
-"     quit\n"
+"reopen - close and reopen the libguestfs handle\n"
+"     reopen\n"
+"\n"
+"Close and reopen the libguestfs handle.  It is not necessary to use\n"
+"this normally, because the handle is closed properly when guestfish\n"
+"exits.  However this is occasionally useful for testing.\n"
 msgstr ""
 
-#: fish/fish.c:857
+#: fish/fish.c:951
 #, c-format
 msgid ""
 "time - measure time taken to run command\n"
@@ -285,256 +395,443 @@ msgid ""
 "    time afterwards.\n"
 msgstr ""
 
-#: fish/fish.c:863
+#: fish/fish.c:957
 #, c-format
 msgid "%s: command not known, use -h to list all commands\n"
 msgstr ""
 
+#: fish/glob.c:52
+#, c-format
+msgid "use 'glob command [args...]'\n"
+msgstr ""
+
+#: fish/glob.c:72
+#, c-format
+msgid "glob: guestfs_glob_expand call failed: %s\n"
+msgstr ""
+
+#: fish/lcd.c:34
+#, c-format
+msgid "use 'lcd directory' to change local directory\n"
+msgstr ""
+
+#: fish/more.c:40
+#, c-format
+msgid "use '%s filename' to page a file\n"
+msgstr ""
+
+#: fish/rc.c:134
+#, c-format
+msgid "guestfish: protocol error: could not read 'hello' message\n"
+msgstr ""
+
+#: fish/rc.c:139
+#, c-format
+msgid ""
+"guestfish: protocol error: version mismatch, server version '%s' does not "
+"match client version '%s'.  The two versions must match exactly.\n"
+msgstr ""
+
+#: fish/rc.c:213 fish/rc.c:227
+#, c-format
+msgid "guestfish: remote: looks like the server is not running\n"
+msgstr ""
+
+#: fish/rc.c:237 fish/rc.c:251
+#, c-format
+msgid "guestfish: protocol error: could not send initial greeting to server\n"
+msgstr ""
+
+#: fish/rc.c:262
+#, c-format
+msgid "guestfish: protocol error: could not decode reply from server\n"
+msgstr ""
+
+#: fish/reopen.c:36
+#, c-format
+msgid "'reopen' command takes no parameters\n"
+msgstr ""
+
+#: fish/reopen.c:46
+#, c-format
+msgid "reopen: guestfs_create: failed to create handle\n"
+msgstr ""
+
+#: fish/time.c:35
+#, c-format
+msgid "use 'time command [args...]'\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:205
+msgid "virt-inspector: no image or VM names given"
+msgstr ""
+
+#: inspector/virt-inspector.pl:297
+msgid "--fish output is only possible with a single OS\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:323
+msgid "virt-inspector: no YAML support\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:358
+msgid "  Mountpoints:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:364
+msgid "  Filesystems:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:382
+msgid "  Modprobe aliases:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:393
+msgid "  Initrd modules:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:402
+msgid "  Applications:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:408
+msgid "  Kernels:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:419
+msgid "  Windows Registry entries:\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:135
+msgid "open_guest: first parameter must be a string or an arrayref"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:142
+#, perl-brace-format
+msgid "guest image {imagename} does not exist or is not readable"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:147
+msgid ""
+"open_guest: no libvirt support (install Sys::Virt, XML::XPath and XML::"
+"XPath::XMLParser)"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:152
+msgid "open_guest: too many domains listed on command line"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:156
+msgid "open_guest: cannot connect to libvirt"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:175
+#, perl-brace-format
+msgid "{imagename} is not the name of an inactive libvirt domain\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:178
+#, perl-brace-format
+msgid "{imagename} is not the name of a libvirt domain\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:190
+#, perl-brace-format
+msgid "{imagename} seems to have no disk devices\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:274
+msgid "resolve_windows_path: path must start with a / character"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:756
+#, perl-brace-format
+msgid "reged command failed: {errormsg}"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:765
+#, perl-brace-format
+msgid "no output from reged command: {errormsg}"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:935
+#, perl-brace-format
+msgid "unknown filesystem label {label}\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:945
+#, perl-brace-format
+msgid "unknown filesystem UUID {uuid}\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:968
+#, perl-brace-format
+msgid "unknown filesystem {fs}\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:1187
+#, perl-brace-format
+msgid "{path} doesn't match augeas pattern"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:1237
+#, perl-brace-format
+msgid "{filename}: could not read initrd format"
+msgstr ""
+
 #: src/guestfs.c:309
 #, c-format
 msgid "guestfs_close: called twice on the same handle\n"
 msgstr ""
 
-#: src/guestfs.c:398
+#: src/guestfs.c:417
 #, c-format
 msgid "libguestfs: error: %s\n"
 msgstr ""
 
-#: src/guestfs.c:701
+#: src/guestfs.c:733
 msgid "command line cannot be altered after qemu subprocess launched"
 msgstr ""
 
-#: src/guestfs.c:715
+#: src/guestfs.c:747
 msgid "guestfs_config: parameter must begin with '-' character"
 msgstr ""
 
-#: src/guestfs.c:729
+#: src/guestfs.c:761
 #, c-format
 msgid "guestfs_config: parameter '%s' isn't allowed"
 msgstr ""
 
-#: src/guestfs.c:749 src/guestfs.c:771 src/guestfs.c:789
+#: src/guestfs.c:781 src/guestfs.c:803 src/guestfs.c:821
 msgid "filename cannot contain ',' (comma) character"
 msgstr ""
 
-#: src/guestfs.c:858
+#: src/guestfs.c:890
 msgid "you must call guestfs_add_drive before guestfs_launch"
 msgstr ""
 
-#: src/guestfs.c:863
+#: src/guestfs.c:895
 msgid "qemu has already been launched"
 msgstr ""
 
-#: src/guestfs.c:871
+#: src/guestfs.c:903
 #, c-format
 msgid "%s: cannot create temporary directory"
 msgstr ""
 
-#: src/guestfs.c:961
+#: src/guestfs.c:993
 #, c-format
 msgid "cannot find %s or %s on LIBGUESTFS_PATH (current path = %s)"
 msgstr ""
 
-#: src/guestfs.c:1168
+#: src/guestfs.c:1200
 msgid "failed to connect to vmchannel socket"
 msgstr ""
 
-#: src/guestfs.c:1187
+#: src/guestfs.c:1219
 msgid "could not watch qemu stdout"
 msgstr ""
 
-#: src/guestfs.c:1255
+#: src/guestfs.c:1287
 #, c-format
 msgid "external command failed: %s"
 msgstr ""
 
-#: src/guestfs.c:1294
+#: src/guestfs.c:1326
 #, c-format
 msgid ""
 "%s: command failed: If qemu is located on a non-standard path, try setting "
 "the LIBGUESTFS_QEMU environment variable."
 msgstr ""
 
-#: src/guestfs.c:1367
+#: src/guestfs.c:1399
 msgid "qemu has finished launching already"
 msgstr ""
 
-#: src/guestfs.c:1372
+#: src/guestfs.c:1404
 msgid "qemu has not been launched yet"
 msgstr ""
 
-#: src/guestfs.c:1385
+#: src/guestfs.c:1417
 msgid "guestfs_wait_ready failed, see earlier error messages"
 msgstr ""
 
-#: src/guestfs.c:1395
+#: src/guestfs.c:1427
 msgid "qemu launched and contacted daemon, but state != READY"
 msgstr ""
 
-#: src/guestfs.c:1406
+#: src/guestfs.c:1438
 msgid "no subprocess to kill"
 msgstr ""
 
-#: src/guestfs.c:1454
+#: src/guestfs.c:1486
 #, c-format
 msgid "guestfs_set_ready: called when in state %d != BUSY"
 msgstr ""
 
-#: src/guestfs.c:1466
+#: src/guestfs.c:1498
 #, c-format
 msgid "guestfs_set_busy: called when in state %d != READY"
 msgstr ""
 
-#: src/guestfs.c:1487
+#: src/guestfs.c:1519
 #, c-format
 msgid "guestfs_end_busy: called when in state %d"
 msgstr ""
 
-#: src/guestfs.c:1545
+#: src/guestfs.c:1577
 #, c-format
 msgid "stdout_event: internal error: %d != %d"
 msgstr ""
 
-#: src/guestfs.c:1588
+#: src/guestfs.c:1620
 #, c-format
 msgid "sock_read_event: internal error: %d != %d"
 msgstr ""
 
-#: src/guestfs.c:1618
+#: src/guestfs.c:1650
 msgid "can't decode length word"
 msgstr ""
 
-#: src/guestfs.c:1628
+#: src/guestfs.c:1660
 #, c-format
 msgid "received magic signature from guestfsd, but in state %d"
 msgstr ""
 
-#: src/guestfs.c:1631
+#: src/guestfs.c:1663
 #, c-format
 msgid "received magic signature from guestfsd, but msg size is %d"
 msgstr ""
 
-#: src/guestfs.c:1656
+#: src/guestfs.c:1688
 #, c-format
 msgid "message length (%u) > maximum possible size (%d)"
 msgstr ""
 
-#: src/guestfs.c:1689
+#: src/guestfs.c:1721
 #, c-format
 msgid "state %d != BUSY"
 msgstr ""
 
-#: src/guestfs.c:1729
+#: src/guestfs.c:1761
 #, c-format
 msgid "sock_write_event: internal error: %d != %d"
 msgstr ""
 
-#: src/guestfs.c:1734
+#: src/guestfs.c:1766
 #, c-format
 msgid "sock_write_event: state %d != BUSY"
 msgstr ""
 
-#: src/guestfs.c:1841 src/guestfs.c:1864
+#: src/guestfs.c:1873 src/guestfs.c:1896
 msgid "remove_handle failed"
 msgstr ""
 
-#: src/guestfs.c:1852 src/guestfs.c:1875
+#: src/guestfs.c:1884 src/guestfs.c:1907
 msgid "add_handle failed"
 msgstr ""
 
-#: src/guestfs.c:1908
+#: src/guestfs.c:1940
 #, c-format
 msgid "guestfs__send_sync: state %d != BUSY"
 msgstr ""
 
-#: src/guestfs.c:1916 src/guestfs.c:2096
+#: src/guestfs.c:1948 src/guestfs.c:2128
 msgid "guestfs__send_sync: msg_out should be NULL"
 msgstr ""
 
-#: src/guestfs.c:1938
+#: src/guestfs.c:1970
 msgid "xdr_guestfs_message_header failed"
 msgstr ""
 
-#: src/guestfs.c:1947
+#: src/guestfs.c:1979
 msgid "dispatch failed to marshal args"
 msgstr ""
 
-#: src/guestfs.c:1973
+#: src/guestfs.c:2005
 msgid "send failed, see earlier error messages"
 msgstr ""
 
-#: src/guestfs.c:2088
+#: src/guestfs.c:2120
 #, c-format
 msgid "send_file_chunk_sync: state %d != READY"
 msgstr ""
 
-#: src/guestfs.c:2119
+#: src/guestfs.c:2151
 #, c-format
 msgid "xdr_guestfs_chunk failed (buf = %p, buflen = %zu)"
 msgstr ""
 
-#: src/guestfs.c:2144
+#: src/guestfs.c:2176
 msgid "send file chunk failed, see earlier error messages"
 msgstr ""
 
-#: src/guestfs.c:2195
+#: src/guestfs.c:2227
 #, c-format
 msgid "check_for_daemon_cancellation: read 0x%x from daemon, expected 0x%x\n"
 msgstr ""
 
-#: src/guestfs.c:2233
+#: src/guestfs.c:2265
 #, c-format
 msgid "%s: error in chunked encoding"
 msgstr ""
 
-#: src/guestfs.c:2261
+#: src/guestfs.c:2293
 msgid "write to daemon socket"
 msgstr ""
 
-#: src/guestfs.c:2308
+#: src/guestfs.c:2340
 msgid "failed to parse file chunk"
 msgstr ""
 
-#: src/guestfs.c:2340
+#: src/guestfs.c:2372
 msgid "receive_file_data_sync: reply callback not called\n"
 msgstr ""
 
-#: src/guestfs.c:2345
+#: src/guestfs.c:2377
 msgid "receive_file_data_sync: parse error in reply callback\n"
 msgstr ""
 
-#: src/guestfs.c:2359
+#: src/guestfs.c:2391
 msgid "file receive cancelled by daemon"
 msgstr ""
 
-#: src/guestfs.c:2394 src/guestfs.c:2452
+#: src/guestfs.c:2426 src/guestfs.c:2484
 #, c-format
 msgid "fd %d is out of range"
 msgstr ""
 
-#: src/guestfs.c:2402
+#: src/guestfs.c:2434
 #, c-format
 msgid "set of events (0x%x) contains unknown events"
 msgstr ""
 
-#: src/guestfs.c:2407
+#: src/guestfs.c:2439
 msgid "set of events is empty"
 msgstr ""
 
-#: src/guestfs.c:2414
+#: src/guestfs.c:2446
 #, c-format
 msgid "fd %d is already registered"
 msgstr ""
 
-#: src/guestfs.c:2419
+#: src/guestfs.c:2451
 msgid "callback is NULL"
 msgstr ""
 
-#: src/guestfs.c:2459
+#: src/guestfs.c:2491
 #, c-format
 msgid "fd %d was not registered"
 msgstr ""
 
-#: src/guestfs.c:2508
+#: src/guestfs.c:2540
 msgid "select_main_loop_run: this cannot be called recursively"
 msgstr ""
+
+#: v2v/virt-v2v.pl:174
+msgid "virt-v2v: no image or VM names given"
+msgstr ""
+
+#: v2v/virt-v2v.pl:209
+msgid "multiboot operating systems are not supported by v2v"
+msgstr ""
diff --git a/po/pl.gmo b/po/pl.gmo
index 362cfd4..6dc2ec7 100644
Binary files a/po/pl.gmo and b/po/pl.gmo differ
diff --git a/po/pl.po b/po/pl.po
index a0d4ffc..87eccfd 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -6,7 +6,7 @@ msgstr ""
 "Project-Id-Version: pl\n"
 "Report-Msgid-Bugs-To: https://bugzilla.redhat.com/enter_bug.cgi?"
 "component=libguestfs&product=Virtualization+Tools\n"
-"POT-Creation-Date: 2009-07-07 20:03+0100\n"
+"POT-Creation-Date: 2009-07-15 16:35+0100\n"
 "PO-Revision-Date: 2009-06-22 21:16+0200\n"
 "Last-Translator: Piotr Drąg <piotrdrag at gmail.com>\n"
 "Language-Team: Polish <pl at li.org>\n"
@@ -14,6 +14,62 @@ msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+#: cat/virt-cat.pl:126
+msgid "virt-cat: no image, VM names or filenames to cat given"
+msgstr ""
+
+#: cat/virt-cat.pl:152 v2v/virt-v2v.pl:208
+msgid "no root device found in this operating system image"
+msgstr ""
+
+#: cat/virt-cat.pl:153
+msgid "multiboot operating systems are not supported by virt-cat"
+msgstr ""
+
+#: df/virt-df.pl:258
+msgid "Virtual Machine"
+msgstr ""
+
+#: df/virt-df.pl:258
+msgid "Filesystem"
+msgstr ""
+
+#: df/virt-df.pl:261
+msgid "1K-blocks"
+msgstr ""
+
+#: df/virt-df.pl:263
+msgid "Size"
+msgstr ""
+
+#: df/virt-df.pl:265
+msgid "Used"
+msgstr ""
+
+#: df/virt-df.pl:266
+msgid "Available"
+msgstr ""
+
+#: df/virt-df.pl:267
+msgid "Use%"
+msgstr ""
+
+#: df/virt-df.pl:269
+msgid "Inodes"
+msgstr ""
+
+#: df/virt-df.pl:270
+msgid "IUsed"
+msgstr ""
+
+#: df/virt-df.pl:271
+msgid "IFree"
+msgstr ""
+
+#: df/virt-df.pl:272
+msgid "IUse%"
+msgstr ""
+
 #: fish/alloc.c:39
 #, c-format
 msgid "use 'alloc file size' to create an image\n"
@@ -34,7 +90,7 @@ msgstr "nie można przeanalizować określenia rozmiaru \"%s\"\n"
 msgid "use '%s filename' to edit a file\n"
 msgstr "użyj \"%s nazwapliku\", aby zmodyfikować plik\n"
 
-#: fish/fish.c:90
+#: fish/fish.c:94
 #, fuzzy, c-format
 msgid ""
 "guestfish: guest filesystem shell\n"
@@ -58,10 +114,13 @@ msgid ""
 "  -D|--no-dest-paths   Don't tab-complete paths from guest fs\n"
 "  -f|--file file       Read commands from file\n"
 "  -i|--inspector       Run virt-inspector to get disk mountpoints\n"
+"  --listen             Listen for remote commands\n"
 "  -m|--mount dev[:mnt] Mount dev on mnt (if omitted, /)\n"
 "  -n|--no-sync         Don't autosync\n"
+"  --remote[=pid]       Send commands to remote guestfish\n"
 "  -r|--ro              Mount read-only\n"
 "  -v|--verbose         Verbose messages\n"
+"  -x                   Echo each command before executing it\n"
 "  -V|--version         Display version and exit\n"
 "For more information,  see the manpage guestfish(1).\n"
 msgstr ""
@@ -90,37 +149,69 @@ msgstr ""
 "  -V|--version         Wyświetla wersję i kończy pracę\n"
 "Aby dowiedzieć się więcej, zobacz stronę podręcznika guestfish(1).\n"
 
-#: fish/fish.c:157
+#: fish/fish.c:168
 #, c-format
 msgid "guestfs_create: failed to create handle\n"
 msgstr "guestfs_create: utworzenie programu obsługi nie powiodło się\n"
 
-#: fish/fish.c:202
+#: fish/fish.c:198
+#, c-format
+msgid "guestfish: --listen=PID: PID was not a number: %s\n"
+msgstr ""
+
+#: fish/fish.c:204
+#, c-format
+msgid ""
+"guestfish: remote: $GUESTFISH_PID must be set to the PID of the remote "
+"process\n"
+msgstr ""
+
+#: fish/fish.c:209
+#, fuzzy, c-format
+msgid "guestfish: unknown long option: %s (%d)\n"
+msgstr "guestfish: nieoczekiwane polecenie wiersza poleceń 0x%x\n"
+
+#: fish/fish.c:236
 #, c-format
 msgid "guestfish: only one -f parameter can be given\n"
 msgstr ""
 
-#: fish/fish.c:260
+#: fish/fish.c:298
 #, c-format
 msgid "guestfish: unexpected command line option 0x%x\n"
 msgstr "guestfish: nieoczekiwane polecenie wiersza poleceń 0x%x\n"
 
-#: fish/fish.c:272
+#: fish/fish.c:310
 #, c-format
-msgid "guestfish: cannot use -i option with -a or -m\n"
+msgid "guestfish: cannot use -i option with -a, -m, --listen or --remote\n"
 msgstr ""
 
-#: fish/fish.c:276
+#: fish/fish.c:314
 #, c-format
 msgid "guestfish -i requires a libvirt domain or path(s) to disk image(s)\n"
 msgstr ""
 
-#: fish/fish.c:284
+#: fish/fish.c:322
 #, c-format
 msgid "guestfish: virt-inspector command too long for fixed-size buffer\n"
 msgstr ""
 
-#: fish/fish.c:464
+#: fish/fish.c:364
+#, c-format
+msgid "guestfish: cannot use --listen and --remote options at the same time\n"
+msgstr ""
+
+#: fish/fish.c:370
+#, fuzzy, c-format
+msgid "guestfish: extra parameters on the command line with --listen flag\n"
+msgstr "guestfish: nieoczekiwane polecenie wiersza poleceń 0x%x\n"
+
+#: fish/fish.c:374
+#, c-format
+msgid "guestfish: cannot use --listen and --file options at the same time\n"
+msgstr ""
+
+#: fish/fish.c:520
 #, c-format
 msgid ""
 "\n"
@@ -139,69 +230,78 @@ msgstr ""
 "      \"quit\", aby zakończyć powłokę\n"
 "\n"
 
-#: fish/fish.c:542
+#: fish/fish.c:600
 #, c-format
 msgid "guestfish: unterminated double quote\n"
 msgstr "guestfish: niezakończony podwójny cudzysłów\n"
 
-#: fish/fish.c:547 fish/fish.c:562
+#: fish/fish.c:605 fish/fish.c:620
 #, c-format
 msgid "guestfish: command arguments not separated by whitespace\n"
 msgstr "guestfish: parametry poleceń nie są oddzielone spacjami\n"
 
-#: fish/fish.c:557
+#: fish/fish.c:615
 #, c-format
 msgid "guestfish: unterminated single quote\n"
 msgstr "guestfish: niezakończony pojedynczy cudzysłów\n"
 
-#: fish/fish.c:602
+#: fish/fish.c:665
 #, c-format
 msgid "guestfish: internal error parsing string at '%s'\n"
 msgstr "guestfish: wewnętrzny błąd analizowania łańcucha \"%s\"\n"
 
-#: fish/fish.c:615
+#: fish/fish.c:682
 #, c-format
 msgid "guestfish: too many arguments\n"
 msgstr "guestfish: za dużo parametrów\n"
 
-#: fish/fish.c:642
+#: fish/fish.c:711
 #, c-format
 msgid "guestfish: empty command on command line\n"
 msgstr "guestfish: puste polecenie wiersza poleceń\n"
 
-#: fish/fish.c:755
+#: fish/fish.c:838
 msgid "display a list of commands or help on a command"
 msgstr "wyświetla listę poleceń lub pomoc polecenia"
 
-#: fish/fish.c:757
+#: fish/fish.c:840
 msgid "quit guestfish"
 msgstr "kończy pracę guestfish"
 
-#: fish/fish.c:760
+#: fish/fish.c:843
 msgid "allocate an image"
 msgstr "przydziela obraz"
 
-#: fish/fish.c:762
+#: fish/fish.c:845
 msgid "display a line of text"
 msgstr "wyświetla wiersz tekstu"
 
-#: fish/fish.c:764
+#: fish/fish.c:847
 msgid "edit a file in the image"
 msgstr "modyfikuje plik w obrazie"
 
-#: fish/fish.c:766
+#: fish/fish.c:849
 msgid "local change directory"
 msgstr "zmienia lokalny folder"
 
-#: fish/fish.c:768
+#: fish/fish.c:851
 msgid "expand wildcards in command"
 msgstr "rozwija wieloznaczniki w poleceniach"
 
-#: fish/fish.c:770
+#: fish/fish.c:853
+#, fuzzy
+msgid "view a file in the pager"
+msgstr "modyfikuje plik w obrazie"
+
+#: fish/fish.c:855
+msgid "close and reopen libguestfs handle"
+msgstr ""
+
+#: fish/fish.c:857
 msgid "measure time taken to run command"
 msgstr ""
 
-#: fish/fish.c:782
+#: fish/fish.c:869
 #, c-format
 msgid ""
 "alloc - allocate an image\n"
@@ -237,7 +337,7 @@ msgstr ""
 "    <nn>G lub <nn>GB  liczba gigabajtów\n"
 "    <nn>sektory       liczba 512 bajtowych sektorów\n"
 
-#: fish/fish.c:798
+#: fish/fish.c:885
 #, c-format
 msgid ""
 "echo - display a line of text\n"
@@ -250,7 +350,7 @@ msgstr ""
 "\n"
 "    Wyświetla ostatnie parametry w terminalu.\n"
 
-#: fish/fish.c:805
+#: fish/fish.c:892
 #, c-format
 msgid ""
 "edit - edit a file in the image\n"
@@ -282,7 +382,7 @@ msgstr ""
 "    UWAGA: nie będzie działało poprawnie dla dużych plików\n"
 "    (> 2 MB) lub plików binarnych zawierających \\0 bajtów.\n"
 
-#: fish/fish.c:819
+#: fish/fish.c:906
 #, c-format
 msgid ""
 "lcd - local change directory\n"
@@ -299,7 +399,7 @@ msgstr ""
 "    przydatne, jeśli chcesz pobrać pliki do konkretnego\n"
 "    miejsca.\n"
 
-#: fish/fish.c:826
+#: fish/fish.c:913
 #, c-format
 msgid ""
 "glob - expand wildcards in command\n"
@@ -317,7 +417,18 @@ msgstr ""
 "    Zauważ, że polecenie jest wykonywane raz dla\n"
 "    każdego rozwiniętego parametru.\n"
 
-#: fish/fish.c:834
+#: fish/fish.c:920
+#, c-format
+msgid ""
+"help - display a list of commands or help on a command\n"
+"     help cmd\n"
+"     help\n"
+msgstr ""
+"help - wyświetla listę poleceń lub pomoc polecenia\n"
+"     help polecenie\n"
+"     help\n"
+
+#: fish/fish.c:925
 #, fuzzy, c-format
 msgid ""
 "more - view a file in the pager\n"
@@ -349,18 +460,7 @@ msgstr ""
 "    UWAGA: nie będzie działało poprawnie dla dużych plików\n"
 "    (> 2 MB) lub plików binarnych zawierających \\0 bajtów.\n"
 
-#: fish/fish.c:848
-#, c-format
-msgid ""
-"help - display a list of commands or help on a command\n"
-"     help cmd\n"
-"     help\n"
-msgstr ""
-"help - wyświetla listę poleceń lub pomoc polecenia\n"
-"     help polecenie\n"
-"     help\n"
-
-#: fish/fish.c:854
+#: fish/fish.c:941
 #, c-format
 msgid ""
 "quit - quit guestfish\n"
@@ -369,7 +469,18 @@ msgstr ""
 "quit - kończy pracę guestfish\n"
 "     quit\n"
 
-#: fish/fish.c:857
+#: fish/fish.c:944
+#, c-format
+msgid ""
+"reopen - close and reopen the libguestfs handle\n"
+"     reopen\n"
+"\n"
+"Close and reopen the libguestfs handle.  It is not necessary to use\n"
+"this normally, because the handle is closed properly when guestfish\n"
+"exits.  However this is occasionally useful for testing.\n"
+msgstr ""
+
+#: fish/fish.c:951
 #, c-format
 msgid ""
 "time - measure time taken to run command\n"
@@ -379,264 +490,452 @@ msgid ""
 "    time afterwards.\n"
 msgstr ""
 
-#: fish/fish.c:863
+#: fish/fish.c:957
 #, c-format
 msgid "%s: command not known, use -h to list all commands\n"
 msgstr ""
 "%s: nieznane polecenie, użyj -h, aby wyświetlić listę wszystkich poleceń\n"
 
+#: fish/glob.c:52
+#, c-format
+msgid "use 'glob command [args...]'\n"
+msgstr ""
+
+#: fish/glob.c:72
+#, c-format
+msgid "glob: guestfs_glob_expand call failed: %s\n"
+msgstr ""
+
+#: fish/lcd.c:34
+#, c-format
+msgid "use 'lcd directory' to change local directory\n"
+msgstr ""
+
+#: fish/more.c:40
+#, fuzzy, c-format
+msgid "use '%s filename' to page a file\n"
+msgstr "użyj \"%s nazwapliku\", aby zmodyfikować plik\n"
+
+#: fish/rc.c:134
+#, c-format
+msgid "guestfish: protocol error: could not read 'hello' message\n"
+msgstr ""
+
+#: fish/rc.c:139
+#, c-format
+msgid ""
+"guestfish: protocol error: version mismatch, server version '%s' does not "
+"match client version '%s'.  The two versions must match exactly.\n"
+msgstr ""
+
+#: fish/rc.c:213 fish/rc.c:227
+#, c-format
+msgid "guestfish: remote: looks like the server is not running\n"
+msgstr ""
+
+#: fish/rc.c:237 fish/rc.c:251
+#, c-format
+msgid "guestfish: protocol error: could not send initial greeting to server\n"
+msgstr ""
+
+#: fish/rc.c:262
+#, c-format
+msgid "guestfish: protocol error: could not decode reply from server\n"
+msgstr ""
+
+#: fish/reopen.c:36
+#, c-format
+msgid "'reopen' command takes no parameters\n"
+msgstr ""
+
+#: fish/reopen.c:46
+#, fuzzy, c-format
+msgid "reopen: guestfs_create: failed to create handle\n"
+msgstr "guestfs_create: utworzenie programu obsługi nie powiodło się\n"
+
+#: fish/time.c:35
+#, c-format
+msgid "use 'time command [args...]'\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:205
+msgid "virt-inspector: no image or VM names given"
+msgstr ""
+
+#: inspector/virt-inspector.pl:297
+msgid "--fish output is only possible with a single OS\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:323
+msgid "virt-inspector: no YAML support\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:358
+msgid "  Mountpoints:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:364
+msgid "  Filesystems:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:382
+msgid "  Modprobe aliases:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:393
+msgid "  Initrd modules:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:402
+msgid "  Applications:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:408
+msgid "  Kernels:\n"
+msgstr ""
+
+#: inspector/virt-inspector.pl:419
+msgid "  Windows Registry entries:\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:135
+msgid "open_guest: first parameter must be a string or an arrayref"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:142
+#, perl-brace-format
+msgid "guest image {imagename} does not exist or is not readable"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:147
+msgid ""
+"open_guest: no libvirt support (install Sys::Virt, XML::XPath and XML::"
+"XPath::XMLParser)"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:152
+#, fuzzy
+msgid "open_guest: too many domains listed on command line"
+msgstr "guestfish: puste polecenie wiersza poleceń\n"
+
+#: perl/lib/Sys/Guestfs/Lib.pm:156
+msgid "open_guest: cannot connect to libvirt"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:175
+#, perl-brace-format
+msgid "{imagename} is not the name of an inactive libvirt domain\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:178
+#, perl-brace-format
+msgid "{imagename} is not the name of a libvirt domain\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:190
+#, perl-brace-format
+msgid "{imagename} seems to have no disk devices\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:274
+msgid "resolve_windows_path: path must start with a / character"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:756
+#, fuzzy, perl-brace-format
+msgid "reged command failed: {errormsg}"
+msgstr "zewnętrzne polecenie nie powiodło się: %s"
+
+#: perl/lib/Sys/Guestfs/Lib.pm:765
+#, perl-brace-format
+msgid "no output from reged command: {errormsg}"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:935
+#, perl-brace-format
+msgid "unknown filesystem label {label}\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:945
+#, perl-brace-format
+msgid "unknown filesystem UUID {uuid}\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:968
+#, perl-brace-format
+msgid "unknown filesystem {fs}\n"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:1187
+#, perl-brace-format
+msgid "{path} doesn't match augeas pattern"
+msgstr ""
+
+#: perl/lib/Sys/Guestfs/Lib.pm:1237
+#, perl-brace-format
+msgid "{filename}: could not read initrd format"
+msgstr ""
+
 #: src/guestfs.c:309
 #, c-format
 msgid "guestfs_close: called twice on the same handle\n"
 msgstr "guestfs_close: wywołano dwa razy w tym samym programie obsługującym\n"
 
-#: src/guestfs.c:398
+#: src/guestfs.c:417
 #, c-format
 msgid "libguestfs: error: %s\n"
 msgstr "libguestfs: błąd: %s\n"
 
-#: src/guestfs.c:701
+#: src/guestfs.c:733
 msgid "command line cannot be altered after qemu subprocess launched"
 msgstr ""
 "wiersz poleceń nie może zostać zmieniony po uruchomieniu podprocesu QEMU"
 
-#: src/guestfs.c:715
+#: src/guestfs.c:747
 msgid "guestfs_config: parameter must begin with '-' character"
 msgstr "guestfs_config: parametr musi zaczynać się od znaku \"-\""
 
-#: src/guestfs.c:729
+#: src/guestfs.c:761
 #, c-format
 msgid "guestfs_config: parameter '%s' isn't allowed"
 msgstr "guestfs_config: parametr \"%s\" nie jest dozwolony"
 
-#: src/guestfs.c:749 src/guestfs.c:771 src/guestfs.c:789
+#: src/guestfs.c:781 src/guestfs.c:803 src/guestfs.c:821
 msgid "filename cannot contain ',' (comma) character"
 msgstr "nazwa pliku nie może zawierać znaku \",\" (przecinka)"
 
-#: src/guestfs.c:858
+#: src/guestfs.c:890
 msgid "you must call guestfs_add_drive before guestfs_launch"
 msgstr "należy wywołać guestfs_add_drive przed guestfs_launch"
 
-#: src/guestfs.c:863
+#: src/guestfs.c:895
 msgid "qemu has already been launched"
 msgstr "QEMU zostało już uruchomione"
 
-#: src/guestfs.c:871
+#: src/guestfs.c:903
 #, c-format
 msgid "%s: cannot create temporary directory"
 msgstr "%s: nie można utworzyć folderu tymczasowego"
 
-#: src/guestfs.c:961
+#: src/guestfs.c:993
 #, c-format
 msgid "cannot find %s or %s on LIBGUESTFS_PATH (current path = %s)"
 msgstr "nie można znaleźć %s lub %s w LIBGUESTFS_PATH (bieżąca ścieżka = %s)"
 
-#: src/guestfs.c:1168
+#: src/guestfs.c:1200
 msgid "failed to connect to vmchannel socket"
 msgstr "połączenie się z gniazdem kanału maszyny wirtualnej nie powiodło się"
 
-#: src/guestfs.c:1187
+#: src/guestfs.c:1219
 msgid "could not watch qemu stdout"
 msgstr "nie można obserwować standardowego wyjścia QEMU"
 
-#: src/guestfs.c:1255
+#: src/guestfs.c:1287
 #, c-format
 msgid "external command failed: %s"
 msgstr "zewnętrzne polecenie nie powiodło się: %s"
 
-#: src/guestfs.c:1294
+#: src/guestfs.c:1326
 #, c-format
 msgid ""
 "%s: command failed: If qemu is located on a non-standard path, try setting "
 "the LIBGUESTFS_QEMU environment variable."
 msgstr ""
 
-#: src/guestfs.c:1367
+#: src/guestfs.c:1399
 msgid "qemu has finished launching already"
 msgstr "QEMU zakończyło już uruchamianie"
 
-#: src/guestfs.c:1372
+#: src/guestfs.c:1404
 msgid "qemu has not been launched yet"
 msgstr "QEMU nie zostało jeszcze uruchomione"
 
-#: src/guestfs.c:1385
+#: src/guestfs.c:1417
 msgid "guestfs_wait_ready failed, see earlier error messages"
 msgstr ""
 "guestfs_wait_ready nie powiodło się, zobacz wcześniejsze komunikaty błędów"
 
-#: src/guestfs.c:1395
+#: src/guestfs.c:1427
 msgid "qemu launched and contacted daemon, but state != READY"
 msgstr ""
 "QEMU zostało uruchomione i skontaktowano się z demonem, ale stan != GOTOWY"
 
-#: src/guestfs.c:1406
+#: src/guestfs.c:1438
 msgid "no subprocess to kill"
 msgstr "brak podprocesu do zniszczenia"
 
-#: src/guestfs.c:1454
+#: src/guestfs.c:1486
 #, c-format
 msgid "guestfs_set_ready: called when in state %d != BUSY"
 msgstr "guestfs_set_ready: wywołano, kiedy w stanie %d != ZAJĘTY"
 
-#: src/guestfs.c:1466
+#: src/guestfs.c:1498
 #, c-format
 msgid "guestfs_set_busy: called when in state %d != READY"
 msgstr "guestfs_set_busy: wywołano, kiedy w stanie %d != GOTOWY"
 
-#: src/guestfs.c:1487
+#: src/guestfs.c:1519
 #, c-format
 msgid "guestfs_end_busy: called when in state %d"
 msgstr "guestfs_end_busy: wywołano, kiedy w stanie %d"
 
-#: src/guestfs.c:1545
+#: src/guestfs.c:1577
 #, c-format
 msgid "stdout_event: internal error: %d != %d"
 msgstr "stdout_event: wewnętrzny błąd: %d != %d"
 
-#: src/guestfs.c:1588
+#: src/guestfs.c:1620
 #, c-format
 msgid "sock_read_event: internal error: %d != %d"
 msgstr "sock_read_event: wewnętrzny błąd: %d != %d"
 
-#: src/guestfs.c:1618
+#: src/guestfs.c:1650
 msgid "can't decode length word"
 msgstr "nie można dekodować długości słowa"
 
-#: src/guestfs.c:1628
+#: src/guestfs.c:1660
 #, c-format
 msgid "received magic signature from guestfsd, but in state %d"
 msgstr "otrzymano podpis magic z guestfsd, ale w stanie %d"
 
-#: src/guestfs.c:1631
+#: src/guestfs.c:1663
 #, c-format
 msgid "received magic signature from guestfsd, but msg size is %d"
 msgstr "otrzymano podpis magic z guestfsd, ale rozmiar komunikatu to %d"
 
-#: src/guestfs.c:1656
+#: src/guestfs.c:1688
 #, c-format
 msgid "message length (%u) > maximum possible size (%d)"
 msgstr "długość komunikatu (%u) > maksymalny możliwy rozmiar (%d)"
 
-#: src/guestfs.c:1689
+#: src/guestfs.c:1721
 #, c-format
 msgid "state %d != BUSY"
 msgstr "stan %d != ZAJĘTY"
 
-#: src/guestfs.c:1729
+#: src/guestfs.c:1761
 #, c-format
 msgid "sock_write_event: internal error: %d != %d"
 msgstr "sock_write_event: wewnętrzny błąd: %d != %d"
 
-#: src/guestfs.c:1734
+#: src/guestfs.c:1766
 #, c-format
 msgid "sock_write_event: state %d != BUSY"
 msgstr "sock_write_event: stan %d != ZAJĘTY"
 
-#: src/guestfs.c:1841 src/guestfs.c:1864
+#: src/guestfs.c:1873 src/guestfs.c:1896
 msgid "remove_handle failed"
 msgstr "remove_handle nie powiodło się"
 
-#: src/guestfs.c:1852 src/guestfs.c:1875
+#: src/guestfs.c:1884 src/guestfs.c:1907
 msgid "add_handle failed"
 msgstr "add_handle nie powiodło się"
 
-#: src/guestfs.c:1908
+#: src/guestfs.c:1940
 #, c-format
 msgid "guestfs__send_sync: state %d != BUSY"
 msgstr "guestfs__send_sync: stan %d != ZAJĘTY"
 
-#: src/guestfs.c:1916 src/guestfs.c:2096
+#: src/guestfs.c:1948 src/guestfs.c:2128
 msgid "guestfs__send_sync: msg_out should be NULL"
 msgstr "guestfs__send_sync: msg_out powinno być PUSTE"
 
-#: src/guestfs.c:1938
+#: src/guestfs.c:1970
 msgid "xdr_guestfs_message_header failed"
 msgstr "xdr_guestfs_message_header nie powiodło się"
 
-#: src/guestfs.c:1947
+#: src/guestfs.c:1979
 msgid "dispatch failed to marshal args"
 msgstr "rozdzielenie parametrów marszałka nie powiodło się"
 
-#: src/guestfs.c:1973
+#: src/guestfs.c:2005
 msgid "send failed, see earlier error messages"
 msgstr "wysłanie nie powiodło się, zobacz wcześniejsze komunikaty błędów"
 
-#: src/guestfs.c:2088
+#: src/guestfs.c:2120
 #, c-format
 msgid "send_file_chunk_sync: state %d != READY"
 msgstr "send_file_chunk_sync: stan %d != GOTOWY"
 
-#: src/guestfs.c:2119
+#: src/guestfs.c:2151
 #, c-format
 msgid "xdr_guestfs_chunk failed (buf = %p, buflen = %zu)"
 msgstr "xdr_guestfs_chunk nie powiodło się (bufor = %p, długość bufora = %zu)"
 
-#: src/guestfs.c:2144
+#: src/guestfs.c:2176
 msgid "send file chunk failed, see earlier error messages"
 msgstr ""
 "wysłanie fragmentu pliku nie powiodło się, zobacz wcześniejsze komunikaty "
 "błędów"
 
-#: src/guestfs.c:2195
+#: src/guestfs.c:2227
 #, c-format
 msgid "check_for_daemon_cancellation: read 0x%x from daemon, expected 0x%x\n"
 msgstr ""
 "check_for_daemon_cancellation: odczytano 0x%x z demona, oczekiwano 0x%x\n"
 
-#: src/guestfs.c:2233
+#: src/guestfs.c:2265
 #, c-format
 msgid "%s: error in chunked encoding"
 msgstr "%s: błąd w kodowaniu fragmentu"
 
-#: src/guestfs.c:2261
+#: src/guestfs.c:2293
 msgid "write to daemon socket"
 msgstr "zapisz do gniazda demona"
 
-#: src/guestfs.c:2308
+#: src/guestfs.c:2340
 msgid "failed to parse file chunk"
 msgstr "przeanalizowanie fragmentu pliku nie powiodło się"
 
-#: src/guestfs.c:2340
+#: src/guestfs.c:2372
 msgid "receive_file_data_sync: reply callback not called\n"
 msgstr "receive_file_data_sync: nie wywołano odpowiedzi wywołania zwrotnego\n"
 
-#: src/guestfs.c:2345
+#: src/guestfs.c:2377
 msgid "receive_file_data_sync: parse error in reply callback\n"
 msgstr ""
 "receive_file_data_sync: błąd analizy w odpowiedzi wywołania zwrotnego\n"
 
-#: src/guestfs.c:2359
+#: src/guestfs.c:2391
 msgid "file receive cancelled by daemon"
 msgstr "otrzymanie pliku zostało anulowane przez demona"
 
-#: src/guestfs.c:2394 src/guestfs.c:2452
+#: src/guestfs.c:2426 src/guestfs.c:2484
 #, c-format
 msgid "fd %d is out of range"
 msgstr "fd %d jest spoza zakresu"
 
-#: src/guestfs.c:2402
+#: src/guestfs.c:2434
 #, c-format
 msgid "set of events (0x%x) contains unknown events"
 msgstr "zestaw zdarzeń (0x%x) zawiera nieznane zdarzenia"
 
-#: src/guestfs.c:2407
+#: src/guestfs.c:2439
 msgid "set of events is empty"
 msgstr "zestaw zdarzeń jest pusty"
 
-#: src/guestfs.c:2414
+#: src/guestfs.c:2446
 #, c-format
 msgid "fd %d is already registered"
 msgstr "fd %d jest już zarejestrowane"
 
-#: src/guestfs.c:2419
+#: src/guestfs.c:2451
 msgid "callback is NULL"
 msgstr "wywołanie zwrotne jest PUSTE"
 
-#: src/guestfs.c:2459
+#: src/guestfs.c:2491
 #, c-format
 msgid "fd %d was not registered"
 msgstr "fd %d nie zostało zarejestrowane"
 
-#: src/guestfs.c:2508
+#: src/guestfs.c:2540
 msgid "select_main_loop_run: this cannot be called recursively"
 msgstr "select_main_loop_run: nie może zostać wywołane rekursywnie"
+
+#: v2v/virt-v2v.pl:174
+msgid "virt-v2v: no image or VM names given"
+msgstr ""
+
+#: v2v/virt-v2v.pl:209
+msgid "multiboot operating systems are not supported by v2v"
+msgstr ""
diff --git a/python/Makefile.in b/python/Makefile.in
index 90765cb..2311f94 100644
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -34,8 +35,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -66,14 +68,29 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(pythondir)"
-pythonLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(python_LTLIBRARIES)
 @HAVE_PYTHON_TRUE at libguestfsmod_la_DEPENDENCIES =  \
 @HAVE_PYTHON_TRUE@	$(top_builddir)/src/libguestfs.la
@@ -88,6 +105,7 @@ libguestfsmod_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -99,10 +117,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libguestfsmod_la_SOURCES)
 DIST_SOURCES = $(am__libguestfsmod_la_SOURCES_DIST)
-pythonDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(python_DATA)
 ETAGS = etags
 CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -313,9 +332,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  python/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  python/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign python/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign python/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -333,23 +352,28 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 install-pythonLTLIBRARIES: $(python_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
 	test -z "$(pythondir)" || $(MKDIR_P) "$(DESTDIR)$(pythondir)"
-	@list='$(python_LTLIBRARIES)'; for p in $$list; do \
+	@list='$(python_LTLIBRARIES)'; test -n "$(pythondir)" || list=; \
+	list2=; for p in $$list; do \
 	  if test -f $$p; then \
-	    f=$(am__strip_dir) \
-	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pythonLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pythondir)/$$f'"; \
-	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pythonLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pythondir)/$$f"; \
+	    list2="$$list2 $$p"; \
 	  else :; fi; \
-	done
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pythondir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pythondir)"; \
+	}
 
 uninstall-pythonLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@list='$(python_LTLIBRARIES)'; for p in $$list; do \
-	  p=$(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pythondir)/$$p'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pythondir)/$$p"; \
+	@list='$(python_LTLIBRARIES)'; test -n "$(pythondir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pythondir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pythondir)/$$f"; \
 	done
 
 clean-pythonLTLIBRARIES:
@@ -373,31 +397,31 @@ distclean-compile:
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
 libguestfsmod_la-guestfs-py.lo: guestfs-py.c
- at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfsmod_la_CFLAGS) $(CFLAGS) -MT libguestfsmod_la-guestfs-py.lo -MD -MP -MF $(DEPDIR)/libguestfsmod_la-guestfs-py.Tpo -c -o libguestfsmod_la-guestfs-py.lo `test -f 'guestfs-py.c' || echo '$(srcdir)/'`guestfs-py.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libguestfsmod_la-guestfs-py.Tpo $(DEPDIR)/libguestfsmod_la-guestfs-py.Plo
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfsmod_la_CFLAGS) $(CFLAGS) -MT libguestfsmod_la-guestfs-py.lo -MD -MP -MF $(DEPDIR)/libguestfsmod_la-guestfs-py.Tpo -c -o libguestfsmod_la-guestfs-py.lo `test -f 'guestfs-py.c' || echo '$(srcdir)/'`guestfs-py.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/libguestfsmod_la-guestfs-py.Tpo $(DEPDIR)/libguestfsmod_la-guestfs-py.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='guestfs-py.c' object='libguestfsmod_la-guestfs-py.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfsmod_la_CFLAGS) $(CFLAGS) -c -o libguestfsmod_la-guestfs-py.lo `test -f 'guestfs-py.c' || echo '$(srcdir)/'`guestfs-py.c
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfsmod_la_CFLAGS) $(CFLAGS) -c -o libguestfsmod_la-guestfs-py.lo `test -f 'guestfs-py.c' || echo '$(srcdir)/'`guestfs-py.c
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -407,20 +431,23 @@ clean-libtool:
 install-pythonDATA: $(python_DATA)
 	@$(NORMAL_INSTALL)
 	test -z "$(pythondir)" || $(MKDIR_P) "$(DESTDIR)$(pythondir)"
-	@list='$(python_DATA)'; for p in $$list; do \
+	@list='$(python_DATA)'; test -n "$(pythondir)" || list=; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(pythonDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pythondir)/$$f'"; \
-	  $(pythonDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pythondir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pythondir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(pythondir)" || exit $$?; \
 	done
 
 uninstall-pythonDATA:
 	@$(NORMAL_UNINSTALL)
-	@list='$(python_DATA)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(pythondir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(pythondir)/$$f"; \
-	done
+	@list='$(python_DATA)'; test -n "$(pythondir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(pythondir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(pythondir)" && rm -f $$files
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -434,7 +461,7 @@ tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
@@ -442,29 +469,34 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -473,6 +505,7 @@ check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
 	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
@@ -484,10 +517,10 @@ check-TESTS: $(TESTS)
 	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
@@ -495,17 +528,18 @@ check-TESTS: $(TESTS)
 	      case " $(XFAIL_TESTS) " in \
 	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
 	  if test "$$all" -eq 1; then \
 	    tests="test"; \
@@ -547,11 +581,15 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    echo "$$grn$$dashes"; \
+	  else \
+	    echo "$$red$$dashes"; \
+	  fi; \
 	  echo "$$banner"; \
 	  test -z "$$skipped" || echo "$$skipped"; \
 	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  echo "$$dashes$$std"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
@@ -571,13 +609,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -609,6 +651,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -630,6 +673,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -638,18 +683,28 @@ install-data-am: install-pythonDATA install-pythonLTLIBRARIES
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -672,7 +727,7 @@ ps-am:
 
 uninstall-am: uninstall-pythonDATA uninstall-pythonLTLIBRARIES
 
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
 	clean-generic clean-libtool clean-pythonLTLIBRARIES ctags \
@@ -693,6 +748,7 @@ uninstall-am: uninstall-pythonDATA uninstall-pythonLTLIBRARIES
 
 # Old RHEL 5 autoconf doesn't have builddir.
 builddir ?= $(top_builddir)/python
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/python/guestfs-py.c b/python/guestfs-py.c
index 3a8395a..0d723f3 100644
--- a/python/guestfs-py.c
+++ b/python/guestfs-py.c
@@ -465,6 +465,60 @@ put_dirent_list (struct guestfs_dirent_list *dirents)
 };
 
 static PyObject *
+put_version (struct guestfs_version *version)
+{
+  PyObject *dict;
+
+  dict = PyDict_New ();
+  PyDict_SetItemString (dict, "major",
+                        PyLong_FromLongLong (version->major));
+  PyDict_SetItemString (dict, "minor",
+                        PyLong_FromLongLong (version->minor));
+  PyDict_SetItemString (dict, "release",
+                        PyLong_FromLongLong (version->release));
+  PyDict_SetItemString (dict, "extra",
+                        PyString_FromString (version->extra));
+  return dict;
+};
+
+static PyObject *
+put_version_list (struct guestfs_version_list *versions)
+{
+  PyObject *list;
+  int i;
+
+  list = PyList_New (versions->len);
+  for (i = 0; i < versions->len; ++i)
+    PyList_SetItem (list, i, put_version (&versions->val[i]));
+  return list;
+};
+
+static PyObject *
+put_xattr (struct guestfs_xattr *xattr)
+{
+  PyObject *dict;
+
+  dict = PyDict_New ();
+  PyDict_SetItemString (dict, "attrname",
+                        PyString_FromString (xattr->attrname));
+  PyDict_SetItemString (dict, "attrval",
+                        PyString_FromStringAndSize (xattr->attrval, xattr->attrval_len));
+  return dict;
+};
+
+static PyObject *
+put_xattr_list (struct guestfs_xattr_list *xattrs)
+{
+  PyObject *list;
+  int i;
+
+  list = PyList_New (xattrs->len);
+  for (i = 0; i < xattrs->len; ++i)
+    PyList_SetItem (list, i, put_xattr (&xattrs->val[i]));
+  return list;
+};
+
+static PyObject *
 py_guestfs_test0 (PyObject *self, PyObject *args)
 {
   PyObject *py_g;
@@ -1604,6 +1658,30 @@ py_guestfs_get_pid (PyObject *self, PyObject *args)
 }
 
 static PyObject *
+py_guestfs_version (PyObject *self, PyObject *args)
+{
+  PyObject *py_g;
+  guestfs_h *g;
+  PyObject *py_r;
+  struct guestfs_version *r;
+
+  if (!PyArg_ParseTuple (args, (char *) "O:guestfs_version",
+                         &py_g))
+    return NULL;
+  g = get_handle (py_g);
+
+  r = guestfs_version (g);
+  if (r == NULL) {
+    PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+    return NULL;
+  }
+
+  py_r = put_version (r);
+  guestfs_free_version (r);
+  return py_r;
+}
+
+static PyObject *
 py_guestfs_mount (PyObject *self, PyObject *args)
 {
   PyObject *py_g;
@@ -5139,6 +5217,190 @@ py_guestfs_sfdiskM (PyObject *self, PyObject *args)
   return py_r;
 }
 
+static PyObject *
+py_guestfs_zfile (PyObject *self, PyObject *args)
+{
+  PyObject *py_g;
+  guestfs_h *g;
+  PyObject *py_r;
+  char *r;
+  const char *method;
+  const char *path;
+
+  if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_zfile",
+                         &py_g, &method, &path))
+    return NULL;
+  g = get_handle (py_g);
+
+  r = guestfs_zfile (g, method, path);
+  if (r == NULL) {
+    PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+    return NULL;
+  }
+
+  py_r = PyString_FromString (r);
+  free (r);
+  return py_r;
+}
+
+static PyObject *
+py_guestfs_getxattrs (PyObject *self, PyObject *args)
+{
+  PyObject *py_g;
+  guestfs_h *g;
+  PyObject *py_r;
+  struct guestfs_xattr_list *r;
+  const char *path;
+
+  if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_getxattrs",
+                         &py_g, &path))
+    return NULL;
+  g = get_handle (py_g);
+
+  r = guestfs_getxattrs (g, path);
+  if (r == NULL) {
+    PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+    return NULL;
+  }
+
+  py_r = put_xattr_list (r);
+  guestfs_free_xattr_list (r);
+  return py_r;
+}
+
+static PyObject *
+py_guestfs_lgetxattrs (PyObject *self, PyObject *args)
+{
+  PyObject *py_g;
+  guestfs_h *g;
+  PyObject *py_r;
+  struct guestfs_xattr_list *r;
+  const char *path;
+
+  if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_lgetxattrs",
+                         &py_g, &path))
+    return NULL;
+  g = get_handle (py_g);
+
+  r = guestfs_lgetxattrs (g, path);
+  if (r == NULL) {
+    PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+    return NULL;
+  }
+
+  py_r = put_xattr_list (r);
+  guestfs_free_xattr_list (r);
+  return py_r;
+}
+
+static PyObject *
+py_guestfs_setxattr (PyObject *self, PyObject *args)
+{
+  PyObject *py_g;
+  guestfs_h *g;
+  PyObject *py_r;
+  int r;
+  const char *xattr;
+  const char *val;
+  int vallen;
+  const char *path;
+
+  if (!PyArg_ParseTuple (args, (char *) "Ossis:guestfs_setxattr",
+                         &py_g, &xattr, &val, &vallen, &path))
+    return NULL;
+  g = get_handle (py_g);
+
+  r = guestfs_setxattr (g, xattr, val, vallen, path);
+  if (r == -1) {
+    PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+    return NULL;
+  }
+
+  Py_INCREF (Py_None);
+  py_r = Py_None;
+  return py_r;
+}
+
+static PyObject *
+py_guestfs_lsetxattr (PyObject *self, PyObject *args)
+{
+  PyObject *py_g;
+  guestfs_h *g;
+  PyObject *py_r;
+  int r;
+  const char *xattr;
+  const char *val;
+  int vallen;
+  const char *path;
+
+  if (!PyArg_ParseTuple (args, (char *) "Ossis:guestfs_lsetxattr",
+                         &py_g, &xattr, &val, &vallen, &path))
+    return NULL;
+  g = get_handle (py_g);
+
+  r = guestfs_lsetxattr (g, xattr, val, vallen, path);
+  if (r == -1) {
+    PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+    return NULL;
+  }
+
+  Py_INCREF (Py_None);
+  py_r = Py_None;
+  return py_r;
+}
+
+static PyObject *
+py_guestfs_removexattr (PyObject *self, PyObject *args)
+{
+  PyObject *py_g;
+  guestfs_h *g;
+  PyObject *py_r;
+  int r;
+  const char *xattr;
+  const char *path;
+
+  if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_removexattr",
+                         &py_g, &xattr, &path))
+    return NULL;
+  g = get_handle (py_g);
+
+  r = guestfs_removexattr (g, xattr, path);
+  if (r == -1) {
+    PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+    return NULL;
+  }
+
+  Py_INCREF (Py_None);
+  py_r = Py_None;
+  return py_r;
+}
+
+static PyObject *
+py_guestfs_lremovexattr (PyObject *self, PyObject *args)
+{
+  PyObject *py_g;
+  guestfs_h *g;
+  PyObject *py_r;
+  int r;
+  const char *xattr;
+  const char *path;
+
+  if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_lremovexattr",
+                         &py_g, &xattr, &path))
+    return NULL;
+  g = get_handle (py_g);
+
+  r = guestfs_lremovexattr (g, xattr, path);
+  if (r == -1) {
+    PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g));
+    return NULL;
+  }
+
+  Py_INCREF (Py_None);
+  py_r = Py_None;
+  return py_r;
+}
+
 static PyMethodDef methods[] = {
   { (char *) "create", py_guestfs_create, METH_VARARGS, NULL },
   { (char *) "close", py_guestfs_close, METH_VARARGS, NULL },
@@ -5189,6 +5451,7 @@ static PyMethodDef methods[] = {
   { (char *) "set_memsize", py_guestfs_set_memsize, METH_VARARGS, NULL },
   { (char *) "get_memsize", py_guestfs_get_memsize, METH_VARARGS, NULL },
   { (char *) "get_pid", py_guestfs_get_pid, METH_VARARGS, NULL },
+  { (char *) "version", py_guestfs_version, METH_VARARGS, NULL },
   { (char *) "mount", py_guestfs_mount, METH_VARARGS, NULL },
   { (char *) "sync", py_guestfs_sync, METH_VARARGS, NULL },
   { (char *) "touch", py_guestfs_touch, METH_VARARGS, NULL },
@@ -5328,6 +5591,13 @@ static PyMethodDef methods[] = {
   { (char *) "umask", py_guestfs_umask, METH_VARARGS, NULL },
   { (char *) "readdir", py_guestfs_readdir, METH_VARARGS, NULL },
   { (char *) "sfdiskM", py_guestfs_sfdiskM, METH_VARARGS, NULL },
+  { (char *) "zfile", py_guestfs_zfile, METH_VARARGS, NULL },
+  { (char *) "getxattrs", py_guestfs_getxattrs, METH_VARARGS, NULL },
+  { (char *) "lgetxattrs", py_guestfs_lgetxattrs, METH_VARARGS, NULL },
+  { (char *) "setxattr", py_guestfs_setxattr, METH_VARARGS, NULL },
+  { (char *) "lsetxattr", py_guestfs_lsetxattr, METH_VARARGS, NULL },
+  { (char *) "removexattr", py_guestfs_removexattr, METH_VARARGS, NULL },
+  { (char *) "lremovexattr", py_guestfs_lremovexattr, METH_VARARGS, NULL },
   { NULL, NULL, 0, NULL }
 };
 
diff --git a/python/guestfs.py b/python/guestfs.py
index ab46cd7..7b3026b 100644
--- a/python/guestfs.py
+++ b/python/guestfs.py
@@ -426,6 +426,39 @@ class GuestFS:
         """
         return libguestfsmod.get_pid (self._o)
 
+    def version (self):
+        u"""Return the libguestfs version number that the program is
+        linked against.
+        
+        Note that because of dynamic linking this is not
+        necessarily the version of libguestfs that you compiled
+        against. You can compile the program, and then at
+        runtime dynamically link against a completely different
+        "libguestfs.so" library.
+        
+        This call was added in version 1.0.58. In previous
+        versions of libguestfs there was no way to get the
+        version number. From C code you can use ELF weak linking
+        tricks to find out if this symbol exists (if it doesn't,
+        then it's an earlier version).
+        
+        The call returns a structure with four elements. The
+        first three ("major", "minor" and "release") are numbers
+        and correspond to the usual version triplet. The fourth
+        element ("extra") is a string and is normally empty, but
+        may be used for distro-specific information.
+        
+        To construct the original version string:
+        "$major.$minor.$release$extra"
+        
+        *Note:* Don't use this call to test for availability of
+        features. Distro backports makes this unreliable.
+        
+        This function returns a dictionary, with keys matching
+        the various fields in the guestfs_version structure.
+        """
+        return libguestfsmod.version (self._o)
+
     def mount (self, device, mountpoint):
         u"""Mount a guest disk at a position in the filesystem.
         Block devices are named "/dev/sda", "/dev/sdb" and so
@@ -1974,3 +2007,68 @@ class GuestFS:
         """
         return libguestfsmod.sfdiskM (self._o, device, lines)
 
+    def zfile (self, method, path):
+        u"""This command runs "file" after first decompressing
+        "path" using "method".
+        
+        "method" must be one of "gzip", "compress" or "bzip2".
+        
+        See also: "g.file"
+        """
+        return libguestfsmod.zfile (self._o, method, path)
+
+    def getxattrs (self, path):
+        u"""This call lists the extended attributes of the file or
+        directory "path".
+        
+        At the system call level, this is a combination of the
+        listxattr(2) and getxattr(2) calls.
+        
+        See also: "g.lgetxattrs", attr(5).
+        
+        This function returns a list of xattrs. Each xattr is
+        represented as a dictionary.
+        """
+        return libguestfsmod.getxattrs (self._o, path)
+
+    def lgetxattrs (self, path):
+        u"""This is the same as "g.getxattrs", but if "path" is a
+        symbolic link, then it returns the extended attributes
+        of the link itself.
+        
+        This function returns a list of xattrs. Each xattr is
+        represented as a dictionary.
+        """
+        return libguestfsmod.lgetxattrs (self._o, path)
+
+    def setxattr (self, xattr, val, vallen, path):
+        u"""This call sets the extended attribute named "xattr" of
+        the file "path" to the value "val" (of length "vallen").
+        The value is arbitrary 8 bit data.
+        
+        See also: "g.lsetxattr", attr(5).
+        """
+        return libguestfsmod.setxattr (self._o, xattr, val, vallen, path)
+
+    def lsetxattr (self, xattr, val, vallen, path):
+        u"""This is the same as "g.setxattr", but if "path" is a
+        symbolic link, then it sets an extended attribute of the
+        link itself.
+        """
+        return libguestfsmod.lsetxattr (self._o, xattr, val, vallen, path)
+
+    def removexattr (self, xattr, path):
+        u"""This call removes the extended attribute named "xattr"
+        of the file "path".
+        
+        See also: "g.lremovexattr", attr(5).
+        """
+        return libguestfsmod.removexattr (self._o, xattr, path)
+
+    def lremovexattr (self, xattr, path):
+        u"""This is the same as "g.removexattr", but if "path" is a
+        symbolic link, then it removes an extended attribute of
+        the link itself.
+        """
+        return libguestfsmod.lremovexattr (self._o, xattr, path)
+
diff --git a/regressions/Makefile.am b/regressions/Makefile.am
index 2e1cb41..0e0d520 100644
--- a/regressions/Makefile.am
+++ b/regressions/Makefile.am
@@ -28,7 +28,9 @@ TESTS = \
 	test-cancellation-download-librarycancels.sh \
 	test-qemudie-midcommand.sh \
 	test-qemudie-killsub.sh \
-	test-qemudie-synch.sh
+	test-qemudie-synch.sh \
+	test-remote.sh \
+	test-reopen.sh
 
 SKIPPED_TESTS = \
 	test-bootbootboot.sh
diff --git a/regressions/Makefile.in b/regressions/Makefile.in
index f894d8b..be11641 100644
--- a/regressions/Makefile.in
+++ b/regressions/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -38,8 +39,9 @@
 # See also capitests/
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -70,8 +72,11 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -255,7 +260,9 @@ TESTS = \
 	test-cancellation-download-librarycancels.sh \
 	test-qemudie-midcommand.sh \
 	test-qemudie-killsub.sh \
-	test-qemudie-synch.sh
+	test-qemudie-synch.sh \
+	test-remote.sh \
+	test-reopen.sh
 
 SKIPPED_TESTS = \
 	test-bootbootboot.sh
@@ -284,9 +291,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  regressions/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  regressions/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign regressions/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign regressions/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -304,6 +311,7 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -321,6 +329,7 @@ check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
 	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
@@ -332,10 +341,10 @@ check-TESTS: $(TESTS)
 	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
@@ -343,17 +352,18 @@ check-TESTS: $(TESTS)
 	      case " $(XFAIL_TESTS) " in \
 	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
 	  if test "$$all" -eq 1; then \
 	    tests="test"; \
@@ -395,11 +405,15 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    echo "$$grn$$dashes"; \
+	  else \
+	    echo "$$red$$dashes"; \
+	  fi; \
 	  echo "$$banner"; \
 	  test -z "$$skipped" || echo "$$skipped"; \
 	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  echo "$$dashes$$std"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
@@ -419,13 +433,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -454,6 +472,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -472,6 +491,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -480,18 +501,28 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -512,7 +543,7 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
 
 .PHONY: all all-am check check-TESTS check-am clean clean-generic \
 	clean-libtool distclean distclean-generic distclean-libtool \
@@ -526,6 +557,7 @@ uninstall-am:
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	uninstall uninstall-am
 
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/regressions/test-qemudie-launchfail.sh b/regressions/test-remote.sh
similarity index 71%
copy from regressions/test-qemudie-launchfail.sh
copy to regressions/test-remote.sh
index 7da1c35..f3c14b4 100755
--- a/regressions/test-qemudie-launchfail.sh
+++ b/regressions/test-remote.sh
@@ -16,22 +16,19 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-# Test if we can handle qemu failure during launch.
+# Test remote control of guestfish.
 
 set -e
 
 rm -f test.img
 
-../fish/guestfish <<'EOF'
-alloc test.img 10M
+eval `../fish/guestfish --listen`
 
-append "root=/dev/null"
--run
-
-# We should now be able to rerun the subprocess.
-append ""
-run
-ping-daemon
-EOF
+../fish/guestfish --remote alloc test.img 10M
+../fish/guestfish --remote run
+../fish/guestfish --remote sfdiskM /dev/sda ,
+../fish/guestfish --remote mkfs ext2 /dev/sda1
+../fish/guestfish --remote mount /dev/sda1 /
+../fish/guestfish --remote exit
 
 rm -f test.img
diff --git a/regressions/test-qemudie-launchfail.sh b/regressions/test-reopen.sh
similarity index 79%
copy from regressions/test-qemudie-launchfail.sh
copy to regressions/test-reopen.sh
index 7da1c35..7901754 100755
--- a/regressions/test-qemudie-launchfail.sh
+++ b/regressions/test-reopen.sh
@@ -16,22 +16,26 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-# Test if we can handle qemu failure during launch.
+# Test reopening the handle in the same process.  This used to fail
+# but was corrected in 03e1f74ee08dc71bc09cc7655bf4732685f80b43.
 
 set -e
 
 rm -f test.img
 
 ../fish/guestfish <<'EOF'
-alloc test.img 10M
+reopen
+reopen
+reopen
 
-append "root=/dev/null"
--run
+alloc test.img 5M
+run
+reopen
 
-# We should now be able to rerun the subprocess.
-append ""
+alloc test.img 5M
 run
-ping-daemon
+reopen
+
 EOF
 
 rm -f test.img
diff --git a/ruby/Makefile.in b/ruby/Makefile.in
index 8d87aaa..e14d728 100644
--- a/ruby/Makefile.in
+++ b/ruby/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -32,8 +33,9 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -65,8 +67,11 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES = Rakefile
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -280,9 +285,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  ruby/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  ruby/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ruby/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign ruby/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -300,6 +305,7 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 Rakefile: $(top_builddir)/config.status $(srcdir)/Rakefile.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
@@ -319,6 +325,7 @@ check-TESTS: $(TESTS)
 	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
 	list=' $(TESTS) '; \
+	$(am__tty_colors); \
 	if test -n "$$list"; then \
 	  for tst in $$list; do \
 	    if test -f ./$$tst; then dir=./; \
@@ -330,10 +337,10 @@ check-TESTS: $(TESTS)
 	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
-		echo "XPASS: $$tst"; \
+		col=$$red; res=XPASS; \
 	      ;; \
 	      *) \
-		echo "PASS: $$tst"; \
+		col=$$grn; res=PASS; \
 	      ;; \
 	      esac; \
 	    elif test $$? -ne 77; then \
@@ -341,17 +348,18 @@ check-TESTS: $(TESTS)
 	      case " $(XFAIL_TESTS) " in \
 	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
-		echo "XFAIL: $$tst"; \
+		col=$$lgn; res=XFAIL; \
 	      ;; \
 	      *) \
 		failed=`expr $$failed + 1`; \
-		echo "FAIL: $$tst"; \
+		col=$$red; res=FAIL; \
 	      ;; \
 	      esac; \
 	    else \
 	      skip=`expr $$skip + 1`; \
-	      echo "SKIP: $$tst"; \
+	      col=$$blu; res=SKIP; \
 	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
 	  done; \
 	  if test "$$all" -eq 1; then \
 	    tests="test"; \
@@ -393,11 +401,15 @@ check-TESTS: $(TESTS)
 	      dashes="$$report"; \
 	  fi; \
 	  dashes=`echo "$$dashes" | sed s/./=/g`; \
-	  echo "$$dashes"; \
+	  if test "$$failed" -eq 0; then \
+	    echo "$$grn$$dashes"; \
+	  else \
+	    echo "$$red$$dashes"; \
+	  fi; \
 	  echo "$$banner"; \
 	  test -z "$$skipped" || echo "$$skipped"; \
 	  test -z "$$report" || echo "$$report"; \
-	  echo "$$dashes"; \
+	  echo "$$dashes$$std"; \
 	  test "$$failed" -eq 0; \
 	else :; fi
 
@@ -417,13 +429,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -453,6 +469,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -471,6 +488,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -479,18 +498,28 @@ install-data-am:
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -511,7 +540,7 @@ ps-am:
 
 uninstall-am:
 
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
 
 .PHONY: all all-am check check-TESTS check-am clean clean-generic \
 	clean-libtool distclean distclean-generic distclean-libtool \
@@ -528,6 +557,7 @@ uninstall-am:
 
 @HAVE_RUBY_TRUE at all:
 @HAVE_RUBY_TRUE@	rake build
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c
index 4c4c81e..9768610 100644
--- a/ruby/ext/guestfs/_guestfs.c
+++ b/ruby/ext/guestfs/_guestfs.c
@@ -1095,6 +1095,29 @@ static VALUE ruby_guestfs_get_pid (VALUE gv)
   return INT2NUM (r);
 }
 
+static VALUE ruby_guestfs_version (VALUE gv)
+{
+  guestfs_h *g;
+  Data_Get_Struct (gv, guestfs_h, g);
+  if (!g)
+    rb_raise (rb_eArgError, "%s: used handle after closing it", "version");
+
+
+  struct guestfs_version *r;
+
+  r = guestfs_version (g);
+  if (r == NULL)
+    rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+  VALUE rv = rb_hash_new ();
+  rb_hash_aset (rv, rb_str_new2 ("major"), LL2NUM (r->major));
+  rb_hash_aset (rv, rb_str_new2 ("minor"), LL2NUM (r->minor));
+  rb_hash_aset (rv, rb_str_new2 ("release"), LL2NUM (r->release));
+  rb_hash_aset (rv, rb_str_new2 ("extra"), rb_str_new2 (r->extra));
+  guestfs_free_version (r);
+  return rv;
+}
+
 static VALUE ruby_guestfs_mount (VALUE gv, VALUE devicev, VALUE mountpointv)
 {
   guestfs_h *g;
@@ -4663,6 +4686,217 @@ static VALUE ruby_guestfs_sfdiskM (VALUE gv, VALUE devicev, VALUE linesv)
   return Qnil;
 }
 
+static VALUE ruby_guestfs_zfile (VALUE gv, VALUE methodv, VALUE pathv)
+{
+  guestfs_h *g;
+  Data_Get_Struct (gv, guestfs_h, g);
+  if (!g)
+    rb_raise (rb_eArgError, "%s: used handle after closing it", "zfile");
+
+  Check_Type (methodv, T_STRING);
+  const char *method = StringValueCStr (methodv);
+  if (!method)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "method", "zfile");
+  Check_Type (pathv, T_STRING);
+  const char *path = StringValueCStr (pathv);
+  if (!path)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "path", "zfile");
+
+  char *r;
+
+  r = guestfs_zfile (g, method, path);
+  if (r == NULL)
+    rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+  VALUE rv = rb_str_new2 (r);
+  free (r);
+  return rv;
+}
+
+static VALUE ruby_guestfs_getxattrs (VALUE gv, VALUE pathv)
+{
+  guestfs_h *g;
+  Data_Get_Struct (gv, guestfs_h, g);
+  if (!g)
+    rb_raise (rb_eArgError, "%s: used handle after closing it", "getxattrs");
+
+  Check_Type (pathv, T_STRING);
+  const char *path = StringValueCStr (pathv);
+  if (!path)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "path", "getxattrs");
+
+  struct guestfs_xattr_list *r;
+
+  r = guestfs_getxattrs (g, path);
+  if (r == NULL)
+    rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+  VALUE rv = rb_ary_new2 (r->len);
+  int i;
+  for (i = 0; i < r->len; ++i) {
+    VALUE hv = rb_hash_new ();
+    rb_hash_aset (hv, rb_str_new2 ("attrname"), rb_str_new2 (r->val[i].attrname));
+    rb_hash_aset (hv, rb_str_new2 ("attrval"), rb_str_new (r->val[i].attrval, r->val[i].attrval_len));
+    rb_ary_push (rv, hv);
+  }
+  guestfs_free_xattr_list (r);
+  return rv;
+}
+
+static VALUE ruby_guestfs_lgetxattrs (VALUE gv, VALUE pathv)
+{
+  guestfs_h *g;
+  Data_Get_Struct (gv, guestfs_h, g);
+  if (!g)
+    rb_raise (rb_eArgError, "%s: used handle after closing it", "lgetxattrs");
+
+  Check_Type (pathv, T_STRING);
+  const char *path = StringValueCStr (pathv);
+  if (!path)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "path", "lgetxattrs");
+
+  struct guestfs_xattr_list *r;
+
+  r = guestfs_lgetxattrs (g, path);
+  if (r == NULL)
+    rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+  VALUE rv = rb_ary_new2 (r->len);
+  int i;
+  for (i = 0; i < r->len; ++i) {
+    VALUE hv = rb_hash_new ();
+    rb_hash_aset (hv, rb_str_new2 ("attrname"), rb_str_new2 (r->val[i].attrname));
+    rb_hash_aset (hv, rb_str_new2 ("attrval"), rb_str_new (r->val[i].attrval, r->val[i].attrval_len));
+    rb_ary_push (rv, hv);
+  }
+  guestfs_free_xattr_list (r);
+  return rv;
+}
+
+static VALUE ruby_guestfs_setxattr (VALUE gv, VALUE xattrv, VALUE valv, VALUE vallenv, VALUE pathv)
+{
+  guestfs_h *g;
+  Data_Get_Struct (gv, guestfs_h, g);
+  if (!g)
+    rb_raise (rb_eArgError, "%s: used handle after closing it", "setxattr");
+
+  Check_Type (xattrv, T_STRING);
+  const char *xattr = StringValueCStr (xattrv);
+  if (!xattr)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "xattr", "setxattr");
+  Check_Type (valv, T_STRING);
+  const char *val = StringValueCStr (valv);
+  if (!val)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "val", "setxattr");
+  int vallen = NUM2INT (vallenv);
+  Check_Type (pathv, T_STRING);
+  const char *path = StringValueCStr (pathv);
+  if (!path)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "path", "setxattr");
+
+  int r;
+
+  r = guestfs_setxattr (g, xattr, val, vallen, path);
+  if (r == -1)
+    rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+  return Qnil;
+}
+
+static VALUE ruby_guestfs_lsetxattr (VALUE gv, VALUE xattrv, VALUE valv, VALUE vallenv, VALUE pathv)
+{
+  guestfs_h *g;
+  Data_Get_Struct (gv, guestfs_h, g);
+  if (!g)
+    rb_raise (rb_eArgError, "%s: used handle after closing it", "lsetxattr");
+
+  Check_Type (xattrv, T_STRING);
+  const char *xattr = StringValueCStr (xattrv);
+  if (!xattr)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "xattr", "lsetxattr");
+  Check_Type (valv, T_STRING);
+  const char *val = StringValueCStr (valv);
+  if (!val)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "val", "lsetxattr");
+  int vallen = NUM2INT (vallenv);
+  Check_Type (pathv, T_STRING);
+  const char *path = StringValueCStr (pathv);
+  if (!path)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "path", "lsetxattr");
+
+  int r;
+
+  r = guestfs_lsetxattr (g, xattr, val, vallen, path);
+  if (r == -1)
+    rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+  return Qnil;
+}
+
+static VALUE ruby_guestfs_removexattr (VALUE gv, VALUE xattrv, VALUE pathv)
+{
+  guestfs_h *g;
+  Data_Get_Struct (gv, guestfs_h, g);
+  if (!g)
+    rb_raise (rb_eArgError, "%s: used handle after closing it", "removexattr");
+
+  Check_Type (xattrv, T_STRING);
+  const char *xattr = StringValueCStr (xattrv);
+  if (!xattr)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "xattr", "removexattr");
+  Check_Type (pathv, T_STRING);
+  const char *path = StringValueCStr (pathv);
+  if (!path)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "path", "removexattr");
+
+  int r;
+
+  r = guestfs_removexattr (g, xattr, path);
+  if (r == -1)
+    rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+  return Qnil;
+}
+
+static VALUE ruby_guestfs_lremovexattr (VALUE gv, VALUE xattrv, VALUE pathv)
+{
+  guestfs_h *g;
+  Data_Get_Struct (gv, guestfs_h, g);
+  if (!g)
+    rb_raise (rb_eArgError, "%s: used handle after closing it", "lremovexattr");
+
+  Check_Type (xattrv, T_STRING);
+  const char *xattr = StringValueCStr (xattrv);
+  if (!xattr)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "xattr", "lremovexattr");
+  Check_Type (pathv, T_STRING);
+  const char *path = StringValueCStr (pathv);
+  if (!path)
+    rb_raise (rb_eTypeError, "expected string for parameter %s of %s",
+              "path", "lremovexattr");
+
+  int r;
+
+  r = guestfs_lremovexattr (g, xattr, path);
+  if (r == -1)
+    rb_raise (e_Error, "%s", guestfs_last_error (g));
+
+  return Qnil;
+}
+
 /* Initialize the module. */
 void Init__guestfs ()
 {
@@ -4767,6 +5001,8 @@ void Init__guestfs ()
         ruby_guestfs_get_memsize, 0);
   rb_define_method (c_guestfs, "get_pid",
         ruby_guestfs_get_pid, 0);
+  rb_define_method (c_guestfs, "version",
+        ruby_guestfs_version, 0);
   rb_define_method (c_guestfs, "mount",
         ruby_guestfs_mount, 2);
   rb_define_method (c_guestfs, "sync",
@@ -5045,4 +5281,18 @@ void Init__guestfs ()
         ruby_guestfs_readdir, 1);
   rb_define_method (c_guestfs, "sfdiskM",
         ruby_guestfs_sfdiskM, 2);
+  rb_define_method (c_guestfs, "zfile",
+        ruby_guestfs_zfile, 2);
+  rb_define_method (c_guestfs, "getxattrs",
+        ruby_guestfs_getxattrs, 1);
+  rb_define_method (c_guestfs, "lgetxattrs",
+        ruby_guestfs_lgetxattrs, 1);
+  rb_define_method (c_guestfs, "setxattr",
+        ruby_guestfs_setxattr, 4);
+  rb_define_method (c_guestfs, "lsetxattr",
+        ruby_guestfs_lsetxattr, 4);
+  rb_define_method (c_guestfs, "removexattr",
+        ruby_guestfs_removexattr, 2);
+  rb_define_method (c_guestfs, "lremovexattr",
+        ruby_guestfs_lremovexattr, 2);
 }
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR
index 897bdc8..878d5a0 100644
--- a/src/MAX_PROC_NR
+++ b/src/MAX_PROC_NR
@@ -1 +1 @@
-139
+146
diff --git a/src/Makefile.am b/src/Makefile.am
index 9dc8e99..292e2ec 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -41,6 +41,17 @@ include_HEADERS = guestfs.h guestfs-actions.h guestfs-structs.h
 
 lib_LTLIBRARIES = libguestfs.la
 
+BUILT_SOURCES = \
+  guestfs_protocol.x \
+  guestfs_protocol.c \
+  guestfs_protocol.h \
+  guestfs-structs.h \
+  guestfs-actions.h \
+  guestfs-actions.c \
+  guestfs-bindtests.c
+
+$(BUILT_SOURCES): stamp-generator
+
 # From the libtool info file, with comments:
 #
 # |  1. Start with version information of `0:0:0' for each libtool library.
@@ -83,17 +94,6 @@ lib_LTLIBRARIES = libguestfs.la
 # Note that this scheme means the real library version will always be
 # 'libguestfs.so.0.$(MAX_PROC_NR).0'.
 
-BUILT_SOURCES = \
-  guestfs_protocol.x \
-  guestfs_protocol.c \
-  guestfs_protocol.h \
-  guestfs-structs.h \
-  guestfs-actions.h \
-  guestfs-actions.c \
-  guestfs-bindtests.c
-
-$(BUILT_SOURCES): stamp-generator
-
 libguestfs_la_LDFLAGS = -version-info $(MAX_PROC_NR):0:$(MAX_PROC_NR)
 libguestfs_la_SOURCES = \
 	guestfs.c \
diff --git a/src/Makefile.in b/src/Makefile.in
index afef590..0e80216 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -35,8 +36,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -68,14 +70,29 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libguestfs_la_LIBADD =
 am_libguestfs_la_OBJECTS = libguestfs_la-guestfs.lo \
@@ -89,6 +106,7 @@ libguestfs_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
 am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -101,7 +119,6 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 SOURCES = $(libguestfs_la_SOURCES)
 DIST_SOURCES = $(libguestfs_la_SOURCES)
 DATA = $(noinst_DATA)
-includeHEADERS_INSTALL = $(INSTALL_HEADER)
 HEADERS = $(include_HEADERS)
 ETAGS = etags
 CTAGS = ctags
@@ -297,6 +314,15 @@ EXTRA_DIST = \
 noinst_DATA = stamp-generator
 include_HEADERS = guestfs.h guestfs-actions.h guestfs-structs.h
 lib_LTLIBRARIES = libguestfs.la
+BUILT_SOURCES = \
+  guestfs_protocol.x \
+  guestfs_protocol.c \
+  guestfs_protocol.h \
+  guestfs-structs.h \
+  guestfs-actions.h \
+  guestfs-actions.c \
+  guestfs-bindtests.c
+
 
 # From the libtool info file, with comments:
 #
@@ -339,15 +365,6 @@ lib_LTLIBRARIES = libguestfs.la
 #
 # Note that this scheme means the real library version will always be
 # 'libguestfs.so.0.$(MAX_PROC_NR).0'.
-BUILT_SOURCES = \
-  guestfs_protocol.x \
-  guestfs_protocol.c \
-  guestfs_protocol.h \
-  guestfs-structs.h \
-  guestfs-actions.h \
-  guestfs-actions.c \
-  guestfs-bindtests.c
-
 libguestfs_la_LDFLAGS = -version-info $(MAX_PROC_NR):0:$(MAX_PROC_NR)
 libguestfs_la_SOURCES = \
 	guestfs.c \
@@ -374,9 +391,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  src/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -394,23 +411,28 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 install-libLTLIBRARIES: $(lib_LTLIBRARIES)
 	@$(NORMAL_INSTALL)
 	test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
 	  if test -f $$p; then \
-	    f=$(am__strip_dir) \
-	    echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
-	    $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+	    list2="$$list2 $$p"; \
 	  else :; fi; \
-	done
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
 
 uninstall-libLTLIBRARIES:
 	@$(NORMAL_UNINSTALL)
-	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
-	  p=$(am__strip_dir) \
-	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
 	done
 
 clean-libLTLIBRARIES:
@@ -437,52 +459,52 @@ distclean-compile:
 
 .c.o:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c $<
 
 .c.obj:
 @am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
 
 .c.lo:
 @am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
 
 libguestfs_la-guestfs.lo: guestfs.c
- at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -MT libguestfs_la-guestfs.lo -MD -MP -MF $(DEPDIR)/libguestfs_la-guestfs.Tpo -c -o libguestfs_la-guestfs.lo `test -f 'guestfs.c' || echo '$(srcdir)/'`guestfs.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libguestfs_la-guestfs.Tpo $(DEPDIR)/libguestfs_la-guestfs.Plo
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -MT libguestfs_la-guestfs.lo -MD -MP -MF $(DEPDIR)/libguestfs_la-guestfs.Tpo -c -o libguestfs_la-guestfs.lo `test -f 'guestfs.c' || echo '$(srcdir)/'`guestfs.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/libguestfs_la-guestfs.Tpo $(DEPDIR)/libguestfs_la-guestfs.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='guestfs.c' object='libguestfs_la-guestfs.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -c -o libguestfs_la-guestfs.lo `test -f 'guestfs.c' || echo '$(srcdir)/'`guestfs.c
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -c -o libguestfs_la-guestfs.lo `test -f 'guestfs.c' || echo '$(srcdir)/'`guestfs.c
 
 libguestfs_la-guestfs_protocol.lo: guestfs_protocol.c
- at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -MT libguestfs_la-guestfs_protocol.lo -MD -MP -MF $(DEPDIR)/libguestfs_la-guestfs_protocol.Tpo -c -o libguestfs_la-guestfs_protocol.lo `test -f 'guestfs_protocol.c' || echo '$(srcdir)/'`guestfs_protocol.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libguestfs_la-guestfs_protocol.Tpo $(DEPDIR)/libguestfs_la-guestfs_protocol.Plo
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -MT libguestfs_la-guestfs_protocol.lo -MD -MP -MF $(DEPDIR)/libguestfs_la-guestfs_protocol.Tpo -c -o libguestfs_la-guestfs_protocol.lo `test -f 'guestfs_protocol.c' || echo '$(srcdir)/'`guestfs_protocol.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/libguestfs_la-guestfs_protocol.Tpo $(DEPDIR)/libguestfs_la-guestfs_protocol.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='guestfs_protocol.c' object='libguestfs_la-guestfs_protocol.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -c -o libguestfs_la-guestfs_protocol.lo `test -f 'guestfs_protocol.c' || echo '$(srcdir)/'`guestfs_protocol.c
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -c -o libguestfs_la-guestfs_protocol.lo `test -f 'guestfs_protocol.c' || echo '$(srcdir)/'`guestfs_protocol.c
 
 libguestfs_la-guestfs-actions.lo: guestfs-actions.c
- at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -MT libguestfs_la-guestfs-actions.lo -MD -MP -MF $(DEPDIR)/libguestfs_la-guestfs-actions.Tpo -c -o libguestfs_la-guestfs-actions.lo `test -f 'guestfs-actions.c' || echo '$(srcdir)/'`guestfs-actions.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libguestfs_la-guestfs-actions.Tpo $(DEPDIR)/libguestfs_la-guestfs-actions.Plo
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -MT libguestfs_la-guestfs-actions.lo -MD -MP -MF $(DEPDIR)/libguestfs_la-guestfs-actions.Tpo -c -o libguestfs_la-guestfs-actions.lo `test -f 'guestfs-actions.c' || echo '$(srcdir)/'`guestfs-actions.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/libguestfs_la-guestfs-actions.Tpo $(DEPDIR)/libguestfs_la-guestfs-actions.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='guestfs-actions.c' object='libguestfs_la-guestfs-actions.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -c -o libguestfs_la-guestfs-actions.lo `test -f 'guestfs-actions.c' || echo '$(srcdir)/'`guestfs-actions.c
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -c -o libguestfs_la-guestfs-actions.lo `test -f 'guestfs-actions.c' || echo '$(srcdir)/'`guestfs-actions.c
 
 libguestfs_la-guestfs-bindtests.lo: guestfs-bindtests.c
- at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -MT libguestfs_la-guestfs-bindtests.lo -MD -MP -MF $(DEPDIR)/libguestfs_la-guestfs-bindtests.Tpo -c -o libguestfs_la-guestfs-bindtests.lo `test -f 'guestfs-bindtests.c' || echo '$(srcdir)/'`guestfs-bindtests.c
- at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libguestfs_la-guestfs-bindtests.Tpo $(DEPDIR)/libguestfs_la-guestfs-bindtests.Plo
+ at am__fastdepCC_TRUE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -MT libguestfs_la-guestfs-bindtests.lo -MD -MP -MF $(DEPDIR)/libguestfs_la-guestfs-bindtests.Tpo -c -o libguestfs_la-guestfs-bindtests.lo `test -f 'guestfs-bindtests.c' || echo '$(srcdir)/'`guestfs-bindtests.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/libguestfs_la-guestfs-bindtests.Tpo $(DEPDIR)/libguestfs_la-guestfs-bindtests.Plo
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='guestfs-bindtests.c' object='libguestfs_la-guestfs-bindtests.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -c -o libguestfs_la-guestfs-bindtests.lo `test -f 'guestfs-bindtests.c' || echo '$(srcdir)/'`guestfs-bindtests.c
+ at am__fastdepCC_FALSE@	$(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libguestfs_la_CFLAGS) $(CFLAGS) -c -o libguestfs_la-guestfs-bindtests.lo `test -f 'guestfs-bindtests.c' || echo '$(srcdir)/'`guestfs-bindtests.c
 
 mostlyclean-libtool:
 	-rm -f *.lo
@@ -492,20 +514,23 @@ clean-libtool:
 install-includeHEADERS: $(include_HEADERS)
 	@$(NORMAL_INSTALL)
 	test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
-	@list='$(include_HEADERS)'; for p in $$list; do \
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  f=$(am__strip_dir) \
-	  echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
-	  $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
 	done
 
 uninstall-includeHEADERS:
 	@$(NORMAL_UNINSTALL)
-	@list='$(include_HEADERS)'; for p in $$list; do \
-	  f=$(am__strip_dir) \
-	  echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
-	  rm -f "$(DESTDIR)$(includedir)/$$f"; \
-	done
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(includedir)" && rm -f $$files
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -519,7 +544,7 @@ tags: TAGS
 
 TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
+	set x; \
 	here=`pwd`; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
@@ -527,29 +552,34 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 	  test -n "$$unique" || unique=$$empty_fix; \
-	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	    $$tags $$unique; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
 	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 		$(TAGS_FILES) $(LISP)
-	tags=; \
 	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
 	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
-	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	test -z "$(CTAGS_ARGS)$$unique" \
 	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
-	     $$tags $$unique
+	     $$unique
 
 GTAGS:
 	here=`$(am__cd) $(top_builddir) && pwd` \
-	  && cd $(top_srcdir) \
-	  && gtags -i $(GTAGS_ARGS) $$here
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
 
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -570,13 +600,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -609,6 +643,7 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
@@ -631,6 +666,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -639,18 +676,28 @@ install-data-am: install-includeHEADERS
 
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am: install-libLTLIBRARIES
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man:
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -673,7 +720,7 @@ ps-am:
 
 uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
 
-.MAKE: install-am install-strip
+.MAKE: all check install install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
 	clean-libLTLIBRARIES clean-libtool ctags distclean \
@@ -710,6 +757,7 @@ $(BUILT_SOURCES): stamp-generator
 @HAVE_RPCGEN_TRUE@	rm -f $@-t
 @HAVE_RPCGEN_TRUE@	$(RPCGEN) -h -o $@-t $<
 @HAVE_RPCGEN_TRUE@	mv $@-t $@
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/src/generator.ml b/src/generator.ml
index 1a4e507..c163b3a 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -24,8 +24,10 @@
  * this one to describe the interface (see the big table below), and
  * daemon/<somefile>.c to write the implementation.
  *
- * After editing this file, run it (./src/generator.ml) to regenerate
- * all the output files.
+ * After editing this file, run it (./src/generator.ml) to regenerate all the
+ * output files. Note that if you are using a separate build directory you must
+ * run generator.ml from your top level build directory. You must also have run
+ * configure before generator.ml will run.
  *
  * IMPORTANT: This script should NOT print any warnings.  If it prints
  * warnings, you should treat them as errors.
@@ -84,6 +86,16 @@ and ret =
      * inefficient.  Keys should be unique.  NULLs are not permitted.
      *)
   | RHashtable of string
+(* Not implemented:
+    (* "RBufferOut" is handled almost exactly like RString, but
+     * it allows the string to contain arbitrary 8 bit data including
+     * ASCII NUL.  In the C API this causes an implicit extra parameter
+     * to be added of type <size_t *size_r>.  Other programming languages
+     * support strings with arbitrary 8 bit data.  At the RPC layer
+     * we have to use the opaque<> type instead of string<>.
+     *)
+  | RBufferOut of string
+*)
 
 and args = argt list	(* Function parameters, guestfs handle is implicit. *)
 
@@ -110,6 +122,18 @@ and argt =
      *)
   | FileIn of string
   | FileOut of string
+(* Not implemented:
+    (* Opaque buffer which can contain arbitrary 8 bit data.
+     * In the C API, this is expressed as <char *, int> pair.
+     * Most other languages have a string type which can contain
+     * ASCII NUL.  We use whatever type is appropriate for each
+     * language.
+     * Buffers are limited by the total message size.  To transfer
+     * large blocks of data, use FileIn/FileOut parameters instead.
+     * To return an arbitrary buffer, use RBufferOut.
+     *)
+  | BufferIn of string
+*)
 
 type flags =
   | ProtocolLimitWarning  (* display warning about protocol size limits *)
@@ -183,6 +207,10 @@ and test =
      *)
   | TestOutputInt of seq * int
     (* Run the command sequence and expect the output of the final
+     * command to be <op> <int>, eg. ">=", "1".
+     *)
+  | TestOutputIntOp of seq * string * int
+    (* Run the command sequence and expect the output of the final
      * command to be a true value (!= 0 or != NULL).
      *)
   | TestOutputTrue of seq
@@ -206,6 +234,7 @@ and test =
 
 and test_field_compare =
   | CompareWithInt of string * int
+  | CompareWithIntOp of string * string * int
   | CompareWithString of string * string
   | CompareFieldsIntEq of string * string
   | CompareFieldsStrEq of string * string
@@ -442,7 +471,8 @@ environment variable.
 Setting C<qemu> to C<NULL> restores the default qemu binary.");
 
   ("get_qemu", (RConstString "qemu", []), -1, [],
-   [],
+   [InitNone, Always, TestRun (
+      [["get_qemu"]])],
    "get the qemu binary",
    "\
 Return the current qemu binary.
@@ -462,7 +492,8 @@ C<LIBGUESTFS_PATH> environment variable.
 Setting C<path> to C<NULL> restores the default path.");
 
   ("get_path", (RConstString "path", []), -1, [],
-   [],
+   [InitNone, Always, TestRun (
+      [["get_path"]])],
    "get the search path",
    "\
 Return the current search path.
@@ -484,6 +515,10 @@ Setting C<append> to C<NULL> means I<no> additional options
 are passed (libguestfs always adds a few of its own).");
 
   ("get_append", (RConstString "append", []), -1, [],
+   (* This cannot be tested with the current framework.  The
+    * function can return NULL in normal operations, which the
+    * test framework interprets as an error.
+    *)
    [],
    "get the additional kernel options",
    "\
@@ -505,7 +540,8 @@ This is disabled by default (except in guestfish where it is
 enabled by default).");
 
   ("get_autosync", (RBool "autosync", []), -1, [],
-   [],
+   [InitNone, Always, TestRun (
+      [["get_autosync"]])],
    "get autosync mode",
    "\
 Get the autosync flag.");
@@ -526,7 +562,8 @@ C<LIBGUESTFS_DEBUG> is defined and set to C<1>.");
 This returns the verbose messages flag.");
 
   ("is_ready", (RBool "ready", []), -1, [],
-   [],
+   [InitNone, Always, TestOutputTrue (
+      [["is_ready"]])],
    "is ready to accept commands",
    "\
 This returns true iff this handle is ready to accept commands
@@ -535,7 +572,8 @@ This returns true iff this handle is ready to accept commands
 For more information on states, see L<guestfs(3)>.");
 
   ("is_config", (RBool "config", []), -1, [],
-   [],
+   [InitNone, Always, TestOutputFalse (
+      [["is_config"]])],
    "is in configuration state",
    "\
 This returns true iff this handle is being configured
@@ -544,7 +582,8 @@ This returns true iff this handle is being configured
 For more information on states, see L<guestfs(3)>.");
 
   ("is_launching", (RBool "launching", []), -1, [],
-   [],
+   [InitNone, Always, TestOutputFalse (
+      [["is_launching"]])],
    "is launching subprocess",
    "\
 This returns true iff this handle is launching the subprocess
@@ -553,7 +592,8 @@ This returns true iff this handle is launching the subprocess
 For more information on states, see L<guestfs(3)>.");
 
   ("is_busy", (RBool "busy", []), -1, [],
-   [],
+   [InitNone, Always, TestOutputFalse (
+      [["is_busy"]])],
    "is busy processing a command",
    "\
 This returns true iff this handle is busy processing a command
@@ -599,7 +639,9 @@ actions using the low-level API.
 For more information on states, see L<guestfs(3)>.");
 
   ("set_memsize", (RErr, [Int "memsize"]), -1, [FishAlias "memsize"],
-   [],
+   [InitNone, Always, TestOutputInt (
+      [["set_memsize"; "500"];
+       ["get_memsize"]], 500)],
    "set memory allocated to the qemu subprocess",
    "\
 This sets the memory size in megabytes allocated to the
@@ -614,7 +656,8 @@ For more information on the architecture of libguestfs,
 see L<guestfs(3)>.");
 
   ("get_memsize", (RInt "memsize", []), -1, [],
-   [],
+   [InitNone, Always, TestOutputIntOp (
+      [["get_memsize"]], ">=", 256)],
    "get memory allocated to the qemu subprocess",
    "\
 This gets the memory size in megabytes allocated to the
@@ -628,7 +671,8 @@ For more information on the architecture of libguestfs,
 see L<guestfs(3)>.");
 
   ("get_pid", (RInt "pid", []), -1, [FishAlias "pid"],
-   [],
+   [InitNone, Always, TestOutputIntOp (
+      [["get_pid"]], ">=", 1)],
    "get PID of qemu subprocess",
    "\
 Return the process ID of the qemu subprocess.  If there is no
@@ -636,6 +680,36 @@ qemu subprocess, then this will return an error.
 
 This is an internal call used for debugging and testing.");
 
+  ("version", (RStruct ("version", "version"), []), -1, [],
+   [InitNone, Always, TestOutputStruct (
+      [["version"]], [CompareWithInt ("major", 1)])],
+   "get the library version number",
+   "\
+Return the libguestfs version number that the program is linked
+against.
+
+Note that because of dynamic linking this is not necessarily
+the version of libguestfs that you compiled against.  You can
+compile the program, and then at runtime dynamically link
+against a completely different C<libguestfs.so> library.
+
+This call was added in version C<1.0.58>.  In previous
+versions of libguestfs there was no way to get the version
+number.  From C code you can use ELF weak linking tricks to find out if
+this symbol exists (if it doesn't, then it's an earlier version).
+
+The call returns a structure with four elements.  The first
+three (C<major>, C<minor> and C<release>) are numbers and
+correspond to the usual version triplet.  The fourth element
+(C<extra>) is a string and is normally empty, but may be
+used for distro-specific information.
+
+To construct the original version string:
+C<$major.$minor.$release$extra>
+
+I<Note:> Don't use this call to test for availability
+of features.  Distro backports makes this unreliable.");
+
 ]
 
 (* daemon_functions are any functions which cause some action
@@ -1644,8 +1718,8 @@ This uses the L<blockdev(8)> command.");
   ("upload", (RErr, [FileIn "filename"; String "remotefilename"]), 66, [],
    [InitBasicFS, Always, TestOutput (
       (* Pick a file from cwd which isn't likely to change. *)
-    [["upload"; "../COPYING.LIB"; "/COPYING.LIB"];
-     ["checksum"; "md5"; "/COPYING.LIB"]], "e3eda01d9815f8d24aae2dbd89b68b06")],
+      [["upload"; "../COPYING.LIB"; "/COPYING.LIB"];
+       ["checksum"; "md5"; "/COPYING.LIB"]], "e3eda01d9815f8d24aae2dbd89b68b06")],
    "upload a file from the local machine",
    "\
 Upload local file C<filename> to C<remotefilename> on the
@@ -1658,10 +1732,10 @@ See also C<guestfs_download>.");
   ("download", (RErr, [String "remotefilename"; FileOut "filename"]), 67, [],
    [InitBasicFS, Always, TestOutput (
       (* Pick a file from cwd which isn't likely to change. *)
-    [["upload"; "../COPYING.LIB"; "/COPYING.LIB"];
-     ["download"; "/COPYING.LIB"; "testdownload.tmp"];
-     ["upload"; "testdownload.tmp"; "/upload"];
-     ["checksum"; "md5"; "/upload"]], "e3eda01d9815f8d24aae2dbd89b68b06")],
+      [["upload"; "../COPYING.LIB"; "/COPYING.LIB"];
+       ["download"; "/COPYING.LIB"; "testdownload.tmp"];
+       ["upload"; "testdownload.tmp"; "/upload"];
+       ["checksum"; "md5"; "/upload"]], "e3eda01d9815f8d24aae2dbd89b68b06")],
    "download a file to the local machine",
    "\
 Download file C<remotefilename> and save it as C<filename>
@@ -2283,19 +2357,19 @@ are activated or deactivated.");
 
   ("lvresize", (RErr, [String "device"; Int "mbytes"]), 105, [],
    [InitNone, Always, TestOutput (
-    [["sfdiskM"; "/dev/sda"; ","];
-     ["pvcreate"; "/dev/sda1"];
-     ["vgcreate"; "VG"; "/dev/sda1"];
-     ["lvcreate"; "LV"; "VG"; "10"];
-     ["mkfs"; "ext2"; "/dev/VG/LV"];
-     ["mount"; "/dev/VG/LV"; "/"];
-     ["write_file"; "/new"; "test content"; "0"];
-     ["umount"; "/"];
-     ["lvresize"; "/dev/VG/LV"; "20"];
-     ["e2fsck_f"; "/dev/VG/LV"];
-     ["resize2fs"; "/dev/VG/LV"];
-     ["mount"; "/dev/VG/LV"; "/"];
-     ["cat"; "/new"]], "test content")],
+      [["sfdiskM"; "/dev/sda"; ","];
+       ["pvcreate"; "/dev/sda1"];
+       ["vgcreate"; "VG"; "/dev/sda1"];
+       ["lvcreate"; "LV"; "VG"; "10"];
+       ["mkfs"; "ext2"; "/dev/VG/LV"];
+       ["mount"; "/dev/VG/LV"; "/"];
+       ["write_file"; "/new"; "test content"; "0"];
+       ["umount"; "/"];
+       ["lvresize"; "/dev/VG/LV"; "20"];
+       ["e2fsck_f"; "/dev/VG/LV"];
+       ["resize2fs"; "/dev/VG/LV"];
+       ["mount"; "/dev/VG/LV"; "/"];
+       ["cat"; "/new"]], "test content")],
    "resize an LVM logical volume",
    "\
 This resizes (expands or shrinks) an existing LVM logical
@@ -2367,7 +2441,7 @@ This command is only needed because of C<guestfs_resize2fs>
 
   ("sleep", (RErr, [Int "secs"]), 109, [],
    [InitNone, Always, TestRun (
-    [["sleep"; "1"]])],
+      [["sleep"; "1"]])],
    "sleep for some seconds",
    "\
 Sleep for C<secs> seconds.");
@@ -2783,6 +2857,76 @@ were rarely if ever used anyway.
 
 See also C<guestfs_sfdisk> and the L<sfdisk(8)> manpage.");
 
+  ("zfile", (RString "description", [String "method"; String "path"]), 140, [],
+   [],
+   "determine file type inside a compressed file",
+   "\
+This command runs C<file> after first decompressing C<path>
+using C<method>.
+
+C<method> must be one of C<gzip>, C<compress> or C<bzip2>.
+
+See also: C<guestfs_file>");
+
+  ("getxattrs", (RStructList ("xattrs", "xattr"), [String "path"]), 141, [],
+   [],
+   "list extended attributes of a file or directory",
+   "\
+This call lists the extended attributes of the file or directory
+C<path>.
+
+At the system call level, this is a combination of the
+L<listxattr(2)> and L<getxattr(2)> calls.
+
+See also: C<guestfs_lgetxattrs>, L<attr(5)>.");
+
+  ("lgetxattrs", (RStructList ("xattrs", "xattr"), [String "path"]), 142, [],
+   [],
+   "list extended attributes of a file or directory",
+   "\
+This is the same as C<guestfs_getxattrs>, but if C<path>
+is a symbolic link, then it returns the extended attributes
+of the link itself.");
+
+  ("setxattr", (RErr, [String "xattr";
+		       String "val"; Int "vallen"; (* will be BufferIn *)
+		       String "path"]), 143, [],
+   [],
+   "set extended attribute of a file or directory",
+   "\
+This call sets the extended attribute named C<xattr>
+of the file C<path> to the value C<val> (of length C<vallen>).
+The value is arbitrary 8 bit data.
+
+See also: C<guestfs_lsetxattr>, L<attr(5)>.");
+
+  ("lsetxattr", (RErr, [String "xattr";
+			String "val"; Int "vallen"; (* will be BufferIn *)
+			String "path"]), 144, [],
+   [],
+   "set extended attribute of a file or directory",
+   "\
+This is the same as C<guestfs_setxattr>, but if C<path>
+is a symbolic link, then it sets an extended attribute
+of the link itself.");
+
+  ("removexattr", (RErr, [String "xattr"; String "path"]), 145, [],
+   [],
+   "remove extended attribute of a file or directory",
+   "\
+This call removes the extended attribute named C<xattr>
+of the file C<path>.
+
+See also: C<guestfs_lremovexattr>, L<attr(5)>.");
+
+  ("lremovexattr", (RErr, [String "xattr"; String "path"]), 146, [],
+   [],
+   "remove extended attribute of a file or directory",
+   "\
+This is the same as C<guestfs_removexattr>, but if C<path>
+is a symbolic link, then it removes an extended attribute
+of the link itself.");
+
 ]
 
 let all_functions = non_daemon_functions @ daemon_functions
@@ -2798,6 +2942,7 @@ let all_functions_sorted =
 type field =
   | FChar			(* C 'char' (really, a 7 bit byte). *)
   | FString			(* nul-terminated ASCII string. *)
+  | FBuffer			(* opaque buffer of bytes, (char *, int) pair *)
   | FUInt32
   | FInt32
   | FUInt64
@@ -2928,6 +3073,20 @@ let structs = [
     "ftyp", FChar;
     "name", FString;
   ];
+
+  (* Version numbers. *)
+  "version", [
+    "major", FInt64;
+    "minor", FInt64;
+    "release", FInt64;
+    "extra", FString;
+  ];
+
+  (* Extended attribute. *)
+  "xattr", [
+    "attrname", FString;
+    "attrval", FBuffer;
+  ];
 ] (* end of structs *)
 
 (* Ugh, Java has to be different ..
@@ -2940,7 +3099,9 @@ let java_structs = [
   "lvm_lv", "LV";
   "stat", "Stat";
   "statvfs", "StatVFS";
-  "dirent", "Dirent"
+  "dirent", "Dirent";
+  "version", "Version";
+  "xattr", "XAttr";
 ]
 
 (* Used for testing language bindings. *)
@@ -3091,7 +3252,8 @@ let cols_of_struct typ =
 let seq_of_test = function
   | TestRun s | TestOutput (s, _) | TestOutputList (s, _)
   | TestOutputListOfDevices (s, _)
-  | TestOutputInt (s, _) | TestOutputTrue s | TestOutputFalse s
+  | TestOutputInt (s, _) | TestOutputIntOp (s, _, _)
+  | TestOutputTrue s | TestOutputFalse s
   | TestOutputLength (s, _) | TestOutputStruct (s, _)
   | TestLastFail s -> s
 
@@ -3353,6 +3515,10 @@ and generate_structs_pod () =
 	| name, (FUInt64|FBytes) -> pr "   uint64_t %s;\n" name
 	| name, FInt64 -> pr "   int64_t %s;\n" name
 	| name, FString -> pr "   char *%s;\n" name
+	| name, FBuffer ->
+	    pr "   /* The next two fields describe a byte array. */\n";
+	    pr "   uint32_t %s_len;\n" name;
+	    pr "   char *%s;\n" name
 	| name, FUUID ->
 	    pr "   /* The next field is NOT nul-terminated, be careful when printing it: */\n";
 	    pr "   char %s[32];\n" name
@@ -3396,6 +3562,7 @@ and generate_xdr () =
 	List.iter (function
 		   | name, FChar -> pr "  char %s;\n" name
 		   | name, FString -> pr "  string %s<>;\n" name
+		   | name, FBuffer -> pr "  opaque %s<>;\n" name
 		   | name, FUUID -> pr "  opaque %s[32];\n" name
 		   | name, (FInt32|FUInt32) -> pr "  int %s;\n" name
 		   | name, (FInt64|FUInt64|FBytes) -> pr "  hyper %s;\n" name
@@ -3557,6 +3724,9 @@ and generate_structs_h () =
 	function
 	| name, FChar -> pr "  char %s;\n" name
 	| name, FString -> pr "  char *%s;\n" name
+	| name, FBuffer ->
+	    pr "  uint32_t %s_len;\n" name;
+	    pr "  char *%s;\n" name
 	| name, FUUID -> pr "  char %s[32]; /* this is NOT nul-terminated, be careful when printing */\n" name
 	| name, FUInt32 -> pr "  uint32_t %s;\n" name
 	| name, FInt32 -> pr "  int32_t %s;\n" name
@@ -3642,7 +3812,7 @@ check_state (guestfs_h *g, const char *caller)
 {
   if (!guestfs_is_ready (g)) {
     if (guestfs_is_config (g))
-      error (g, \"%%s: call launch() before using this function\",
+      error (g, \"%%s: call launch before using this function\\n(in guestfish, don't forget to use the 'run' command)\",
         caller);
     else if (guestfs_is_launching (g))
       error (g, \"%%s: call wait_ready() before using this function\",
@@ -3722,10 +3892,10 @@ check_state (guestfs_h *g, const char *caller)
        | RBool _ | RString _ | RStringList _
        | RStruct _ | RStructList _
        | RHashtable _ ->
-	    pr "  if (!xdr_%s_ret (xdr, &ctx->ret)) {\n" name;
-	    pr "    error (g, \"%%s: failed to parse reply\", \"%s\");\n" name;
-	    pr "    return;\n";
-	    pr "  }\n";
+	   pr "  if (!xdr_%s_ret (xdr, &ctx->ret)) {\n" name;
+	   pr "    error (g, \"%%s: failed to parse reply\", \"%s\");\n" name;
+	   pr "    return;\n";
+	   pr "  }\n";
       );
 
       pr " done:\n";
@@ -3922,9 +4092,9 @@ and generate_daemon_actions_h () =
 
   List.iter (
     fun (name, style, _, _, _, _, _) ->
-	generate_prototype
-	  ~single_line:true ~newline:true ~in_daemon:true ~prefix:"do_"
-	  name style;
+      generate_prototype
+	~single_line:true ~newline:true ~in_daemon:true ~prefix:"do_"
+	name style;
   ) daemon_functions
 
 (* Generate the server-side stubs. *)
@@ -4093,9 +4263,9 @@ and generate_daemon_actions () =
 
   List.iter (
     fun (name, style, _, _, _, _, _) ->
-	pr "    case GUESTFS_PROC_%s:\n" (String.uppercase name);
-	pr "      %s_stub (xdr_in);\n" name;
-	pr "      break;\n"
+      pr "    case GUESTFS_PROC_%s:\n" (String.uppercase name);
+      pr "      %s_stub (xdr_in);\n" name;
+      pr "      break;\n"
   ) daemon_functions;
 
   pr "    default:\n";
@@ -4121,8 +4291,8 @@ and generate_daemon_actions () =
 	pr "  int i, j;\n";
 	pr "\n";
 	(*
-	pr "  fprintf (stderr, \"%%s: <<%%s>>\\n\", __func__, str);\n";
-	pr "\n";
+	  pr "  fprintf (stderr, \"%%s: <<%%s>>\\n\", __func__, str);\n";
+	  pr "\n";
 	*)
 	pr "  if (!str) {\n";
 	pr "    fprintf (stderr, \"%%s: failed: passed a NULL string\\n\", __func__);\n";
@@ -4174,7 +4344,7 @@ and generate_daemon_actions () =
 		 pr "    fprintf (stderr, \"%%s: failed to parse float '%%s' from token %%s\\n\", __func__, tok, \"%s\");\n" name;
 		 pr "    return -1;\n";
 		 pr "  }\n";
-	     | FInt32 | FUInt32 | FUInt64 | FChar ->
+	     | FBuffer | FInt32 | FUInt32 | FUInt64 | FChar ->
 		 assert false (* can never be an LVM column *)
 	    );
 	    pr "  tok = next;\n";
@@ -4582,7 +4752,11 @@ static int %s (void)
 
 and generate_one_test_body name i test_name init test =
   (match init with
-   | InitNone
+   | InitNone (* XXX at some point, InitNone and InitEmpty became
+	       * folded together as the same thing.  Really we should
+	       * make InitNone do nothing at all, but the tests may
+	       * need to be checked to make sure this is OK.
+	       *)
    | InitEmpty ->
        pr "  /* InitNone|InitEmpty for %s */\n" test_name;
        List.iter (generate_test_command_call test_name)
@@ -4708,6 +4882,19 @@ and generate_one_test_body name i test_name init test =
       in
       List.iter (generate_test_command_call test_name) seq;
       generate_test_command_call ~test test_name last
+  | TestOutputIntOp (seq, op, expected) ->
+      pr "  /* TestOutputIntOp for %s (%d) */\n" name i;
+      let seq, last = get_seq_last seq in
+      let test () =
+	pr "    if (! (r %s %d)) {\n" op expected;
+	pr "      fprintf (stderr, \"%s: expected %s %d but got %%d\\n\","
+	  test_name op expected;
+	pr "               (int) r);\n";
+	pr "      return -1;\n";
+	pr "    }\n"
+      in
+      List.iter (generate_test_command_call test_name) seq;
+      generate_test_command_call ~test test_name last
   | TestOutputTrue seq ->
       pr "  /* TestOutputTrue for %s (%d) */\n" name i;
       let seq, last = get_seq_last seq in
@@ -4766,6 +4953,13 @@ and generate_one_test_body name i test_name init test =
 	      pr "               (int) r->%s);\n" field;
 	      pr "      return -1;\n";
 	      pr "    }\n"
+	  | CompareWithIntOp (field, op, expected) ->
+	      pr "    if (!(r->%s %s %d)) {\n" field op expected;
+	      pr "      fprintf (stderr, \"%s: %s was %%d, expected %s %d\\n\",\n"
+		test_name field op expected;
+	      pr "               (int) r->%s);\n" field;
+	      pr "      return -1;\n";
+	      pr "    }\n"
 	  | CompareWithString (field, expected) ->
 	      pr "    if (strcmp (r->%s, \"%s\") != 0) {\n" field expected;
 	      pr "      fprintf (stderr, \"%s: %s was \"%%s\", expected \"%s\"\\n\",\n"
@@ -4933,6 +5127,7 @@ and generate_fish_cmds () =
   pr "#include <stdlib.h>\n";
   pr "#include <string.h>\n";
   pr "#include <inttypes.h>\n";
+  pr "#include <ctype.h>\n";
   pr "\n";
   pr "#include <guestfs.h>\n";
   pr "#include \"fish.h\"\n";
@@ -5010,7 +5205,7 @@ and generate_fish_cmds () =
   List.iter (
     fun (typ, cols) ->
       let needs_i =
-        List.exists (function (_, FUUID) -> true | _ -> false) cols in
+        List.exists (function (_, (FUUID|FBuffer)) -> true | _ -> false) cols in
 
       pr "static void print_%s (struct guestfs_%s *%s)\n" typ typ typ;
       pr "{\n";
@@ -5027,6 +5222,14 @@ and generate_fish_cmds () =
 	    pr "  for (i = 0; i < 32; ++i)\n";
 	    pr "    printf (\"%%c\", %s->%s[i]);\n" typ name;
 	    pr "  printf (\"\\n\");\n"
+	| name, FBuffer ->
+	    pr "  printf (\"%s: \");\n" name;
+	    pr "  for (i = 0; i < %s->%s_len; ++i)\n" typ name;
+	    pr "    if (isprint (%s->%s[i]))\n" typ name;
+	    pr "      printf (\"%%c\", %s->%s[i]);\n" typ name;
+	    pr "    else\n";
+	    pr "      printf (\"\\\\x%%02x\", %s->%s[i]);\n" typ name;
+	    pr "  printf (\"\\n\");\n"
 	| name, (FUInt64|FBytes) ->
 	    pr "  printf (\"%s: %%\" PRIu64 \"\\n\", %s->%s);\n" name typ name
 	| name, FInt64 ->
@@ -5542,6 +5745,10 @@ copy_table (char * const * argv)
 	  (match col with
 	   | name, FString ->
 	       pr "  v = caml_copy_string (%s->%s);\n" typ name
+	   | name, FBuffer ->
+	       pr "  v = caml_alloc_string (%s->%s_len);\n" typ name;
+	       pr "  memcpy (String_val (v), %s->%s, %s->%s_len);\n"
+		 typ name typ name
 	   | name, FUUID ->
 	       pr "  v = caml_alloc_string (32);\n";
 	       pr "  memcpy (String_val (v), %s->%s, 32);\n" typ name
@@ -5722,6 +5929,7 @@ and generate_ocaml_structure_decls () =
       List.iter (
 	function
 	| name, FString -> pr "  %s : string;\n" name
+	| name, FBuffer -> pr "  %s : string;\n" name
 	| name, FUUID -> pr "  %s : string;\n" name
 	| name, (FBytes|FInt64|FUInt64) -> pr "  %s : int64;\n" name
 	| name, (FInt32|FUInt32) -> pr "  %s : int32;\n" name
@@ -6018,6 +6226,9 @@ and generate_perl_struct_list_code typ cols name style n do_cleanups =
     | name, FUUID ->
 	pr "        (void) hv_store (hv, \"%s\", %d, newSVpv (%s->val[i].%s, 32), 0);\n"
 	  name (String.length name) n name
+    | name, FBuffer ->
+	pr "        (void) hv_store (hv, \"%s\", %d, newSVpv (%s->val[i].%s, %s->val[i].%s_len), 0);\n"
+	  name (String.length name) n name n name
     | name, (FBytes|FUInt64) ->
 	pr "        (void) hv_store (hv, \"%s\", %d, my_newSVull (%s->val[i].%s), 0);\n"
 	  name (String.length name) n name
@@ -6048,30 +6259,36 @@ and generate_perl_struct_code typ cols name style n do_cleanups =
   do_cleanups ();
   pr "      if (%s == NULL)\n" n;
   pr "        croak (\"%s: %%s\", guestfs_last_error (g));\n" name;
-  pr "      EXTEND (SP, %d);\n" (List.length cols);
+  pr "      EXTEND (SP, 2 * %d);\n" (List.length cols);
   List.iter (
-    function
-    | name, FString ->
-	pr "      PUSHs (sv_2mortal (newSVpv (%s->%s, 0)));\n"
-	  n name
-    | name, FUUID ->
-	pr "      PUSHs (sv_2mortal (newSVpv (%s->%s, 32)));\n"
-	  n name
-    | name, (FBytes|FUInt64) ->
-	pr "      PUSHs (sv_2mortal (my_newSVull (%s->%s)));\n"
-	  n name
-    | name, FInt64 ->
-	pr "      PUSHs (sv_2mortal (my_newSVll (%s->%s)));\n"
-	  n name
-    | name, (FInt32|FUInt32) ->
-	pr "      PUSHs (sv_2mortal (newSVnv (%s->%s)));\n"
-	  n name
-    | name, FChar ->
-	pr "      PUSHs (sv_2mortal (newSVpv (&%s->%s, 1)));\n"
-	  n name
-    | name, FOptPercent ->
-	pr "      PUSHs (sv_2mortal (newSVnv (%s->%s)));\n"
-	  n name
+    fun ((name, _) as col) ->
+      pr "      PUSHs (sv_2mortal (newSVpv (\"%s\", 0)));\n" name;
+
+      match col with
+      | name, FString ->
+	  pr "      PUSHs (sv_2mortal (newSVpv (%s->%s, 0)));\n"
+	    n name
+      | name, FBuffer ->
+	  pr "      PUSHs (sv_2mortal (newSVpv (%s->%s, %s->%s_len)));\n"
+	    n name n name
+      | name, FUUID ->
+	  pr "      PUSHs (sv_2mortal (newSVpv (%s->%s, 32)));\n"
+	    n name
+      | name, (FBytes|FUInt64) ->
+	  pr "      PUSHs (sv_2mortal (my_newSVull (%s->%s)));\n"
+	    n name
+      | name, FInt64 ->
+	  pr "      PUSHs (sv_2mortal (my_newSVll (%s->%s)));\n"
+	    n name
+      | name, (FInt32|FUInt32) ->
+	  pr "      PUSHs (sv_2mortal (newSVnv (%s->%s)));\n"
+	    n name
+      | name, FChar ->
+	  pr "      PUSHs (sv_2mortal (newSVpv (&%s->%s, 1)));\n"
+	    n name
+      | name, FOptPercent ->
+	  pr "      PUSHs (sv_2mortal (newSVnv (%s->%s)));\n"
+	    n name
   ) cols;
   pr "      free (%s);\n" n
 
@@ -6120,6 +6337,10 @@ Libguestfs provides ways to enumerate guest storage (eg. partitions,
 LVs, what filesystem is in each LV, etc.).  It can also run commands
 in the context of the guest.  Also you can access filesystems over FTP.
 
+See also L<Sys::Guestfs::Lib(3)> for a set of useful library
+functions for using libguestfs from Perl, including integration
+with libvirt.
+
 =head1 ERRORS
 
 All errors turn into calls to C<croak> (see L<Carp(3)>).
@@ -6191,7 +6412,10 @@ Please see the file COPYING.LIB for the full license.
 
 =head1 SEE ALSO
 
-L<guestfs(3)>, L<guestfish(1)>.
+L<guestfs(3)>,
+L<guestfish(1)>,
+L<http://libguestfs.org>,
+L<Sys::Guestfs::Lib(3)>.
 
 =cut
 "
@@ -6379,6 +6603,10 @@ py_guestfs_close (PyObject *self, PyObject *args)
 	    pr "  PyDict_SetItemString (dict, \"%s\",\n" name;
 	    pr "                        PyString_FromString (%s->%s));\n"
 	      typ name
+	| name, FBuffer ->
+	    pr "  PyDict_SetItemString (dict, \"%s\",\n" name;
+	    pr "                        PyString_FromStringAndSize (%s->%s, %s->%s_len));\n"
+	      typ name typ name
 	| name, FUUID ->
 	    pr "  PyDict_SetItemString (dict, \"%s\",\n" name;
 	    pr "                        PyString_FromStringAndSize (%s->%s, 32));\n"
@@ -6922,6 +7150,8 @@ and generate_ruby_struct_code typ cols =
     function
     | name, FString ->
 	pr "  rb_hash_aset (rv, rb_str_new2 (\"%s\"), rb_str_new2 (r->%s));\n" name name
+    | name, FBuffer ->
+	pr "  rb_hash_aset (rv, rb_str_new2 (\"%s\"), rb_str_new (r->%s, r->%s_len));\n" name name name
     | name, FUUID ->
 	pr "  rb_hash_aset (rv, rb_str_new2 (\"%s\"), rb_str_new (r->%s, 32));\n" name name
     | name, (FBytes|FUInt64) ->
@@ -6950,6 +7180,8 @@ and generate_ruby_struct_list_code typ cols =
     function
     | name, FString ->
 	pr "    rb_hash_aset (hv, rb_str_new2 (\"%s\"), rb_str_new2 (r->val[i].%s));\n" name name
+    | name, FBuffer ->
+	pr "    rb_hash_aset (hv, rb_str_new2 (\"%s\"), rb_str_new (r->val[i].%s, r->val[i].%s_len));\n" name name name
     | name, FUUID ->
 	pr "    rb_hash_aset (hv, rb_str_new2 (\"%s\"), rb_str_new (r->val[i].%s, 32));\n" name name
     | name, (FBytes|FUInt64) ->
@@ -7161,7 +7393,8 @@ public class %s {
   List.iter (
     function
     | name, FString
-    | name, FUUID -> pr "  public String %s;\n" name
+    | name, FUUID
+    | name, FBuffer -> pr "  public String %s;\n" name
     | name, (FBytes|FUInt64|FInt64) -> pr "  public long %s;\n" name
     | name, (FUInt32|FInt32) -> pr "  public int %s;\n" name
     | name, FChar -> pr "  public char %s;\n" name
@@ -7304,7 +7537,7 @@ Java_com_redhat_et_libguestfs_GuestFS__1close
 	 | RStringList _ | RStructList _ -> true
 	 | RErr | RBool _ | RInt _ | RInt64 _ | RConstString _
 	 | RString _ | RStruct _ | RHashtable _ -> false) ||
-	List.exists (function StringList _ -> true | _ -> false) (snd style) in
+	  List.exists (function StringList _ -> true | _ -> false) (snd style) in
       if needs_i then
 	pr "  int i;\n";
 
@@ -7425,6 +7658,15 @@ and generate_java_struct_return typ jtyp cols =
 	pr "    fl = (*env)->GetFieldID (env, cl, \"%s\", \"Ljava/lang/String;\");\n" name;
 	pr "    (*env)->SetObjectField (env, jr, fl, (*env)->NewStringUTF (env, s));\n";
 	pr "  }\n";
+    | name, FBuffer ->
+	pr "  {\n";
+	pr "    int len = r->%s_len;\n" name;
+	pr "    char s[len+1];\n";
+	pr "    memcpy (s, r->%s, len);\n" name;
+	pr "    s[len] = 0;\n";
+	pr "    fl = (*env)->GetFieldID (env, cl, \"%s\", \"Ljava/lang/String;\");\n" name;
+	pr "    (*env)->SetObjectField (env, jr, fl, (*env)->NewStringUTF (env, s));\n";
+	pr "  }\n";
     | name, (FBytes|FUInt64|FInt64) ->
 	pr "  fl = (*env)->GetFieldID (env, cl, \"%s\", \"J\");\n" name;
 	pr "  (*env)->SetLongField (env, jr, fl, r->%s);\n" name;
@@ -7459,6 +7701,15 @@ and generate_java_struct_list_return typ jtyp cols =
 	pr "      fl = (*env)->GetFieldID (env, cl, \"%s\", \"Ljava/lang/String;\");\n" name;
 	pr "      (*env)->SetObjectField (env, jfl, fl, (*env)->NewStringUTF (env, s));\n";
 	pr "    }\n";
+    | name, FBuffer ->
+	pr "    {\n";
+	pr "      int len = r->val[i].%s_len;\n" name;
+	pr "      char s[len+1];\n";
+	pr "      memcpy (s, r->val[i].%s, len);\n" name;
+	pr "      s[len] = 0;\n";
+	pr "      fl = (*env)->GetFieldID (env, cl, \"%s\", \"Ljava/lang/String;\");\n" name;
+	pr "      (*env)->SetObjectField (env, jfl, fl, (*env)->NewStringUTF (env, s));\n";
+	pr "    }\n";
     | name, (FBytes|FUInt64|FInt64) ->
 	pr "    fl = (*env)->GetFieldID (env, cl, \"%s\", \"J\");\n" name;
 	pr "    (*env)->SetLongField (env, jfl, fl, r->val[i].%s);\n" name;
@@ -8057,7 +8308,7 @@ and generate_lang_bindtests call =
 		CallStringList ["1"]; CallBool false;
 		CallInt 0; CallString ""; CallString ""]
 
-  (* XXX Add here tests of the return and error functions. *)
+(* XXX Add here tests of the return and error functions. *)
 
 (* This is used to generate the src/MAX_PROC_NR file which
  * contains the maximum procedure number, a surrogate for the
@@ -8222,6 +8473,15 @@ Run it from the top source directory using the command
       close ();
   ) java_structs;
 
+  let close = output_to "java/Makefile.inc" in
+  pr "java_built_sources =";
+  List.iter (
+    fun (typ, jtyp) ->
+        pr " com/redhat/et/libguestfs/%s.java" jtyp;
+  ) java_structs;
+  pr " com/redhat/et/libguestfs/GuestFS.java\n";
+  close ();
+
   let close = output_to "java/com_redhat_et_libguestfs_GuestFS.c" in
   generate_java_c ();
   close ();
diff --git a/src/guestfs-actions.c b/src/guestfs-actions.c
index c84e70a..44c503c 100644
--- a/src/guestfs-actions.c
+++ b/src/guestfs-actions.c
@@ -70,7 +70,7 @@ check_state (guestfs_h *g, const char *caller)
 {
   if (!guestfs_is_ready (g)) {
     if (guestfs_is_config (g))
-      error (g, "%s: call launch() before using this function",
+      error (g, "%s: call launch before using this function\n(in guestfish, don't forget to use the 'run' command)",
         caller);
     else if (guestfs_is_launching (g))
       error (g, "%s: call wait_ready() before using this function",
@@ -12743,6 +12743,650 @@ int guestfs_sfdiskM (guestfs_h *g,
   return 0;
 }
 
+struct zfile_ctx {
+  /* This flag is set by the callbacks, so we know we've done
+   * the callbacks as expected, and in the right sequence.
+   * 0 = not called, 1 = reply_cb called.
+   */
+  int cb_sequence;
+  struct guestfs_message_header hdr;
+  struct guestfs_message_error err;
+  struct guestfs_zfile_ret ret;
+};
+
+static void zfile_reply_cb (guestfs_h *g, void *data, XDR *xdr)
+{
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  struct zfile_ctx *ctx = (struct zfile_ctx *) data;
+
+  /* This should definitely not happen. */
+  if (ctx->cb_sequence != 0) {
+    ctx->cb_sequence = 9999;
+    error (g, "%s: internal error: reply callback called twice", "guestfs_zfile");
+    return;
+  }
+
+  ml->main_loop_quit (ml, g);
+
+  if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
+    error (g, "%s: failed to parse reply header", "guestfs_zfile");
+    return;
+  }
+  if (ctx->hdr.status == GUESTFS_STATUS_ERROR) {
+    if (!xdr_guestfs_message_error (xdr, &ctx->err)) {
+      error (g, "%s: failed to parse reply error", "guestfs_zfile");
+      return;
+    }
+    goto done;
+  }
+  if (!xdr_guestfs_zfile_ret (xdr, &ctx->ret)) {
+    error (g, "%s: failed to parse reply", "guestfs_zfile");
+    return;
+  }
+ done:
+  ctx->cb_sequence = 1;
+}
+
+char *guestfs_zfile (guestfs_h *g,
+		const char *method,
+		const char *path)
+{
+  struct guestfs_zfile_args args;
+  struct zfile_ctx ctx;
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  int serial;
+
+  if (check_state (g, "guestfs_zfile") == -1) return NULL;
+  guestfs_set_busy (g);
+
+  memset (&ctx, 0, sizeof ctx);
+
+  args.method = (char *) method;
+  args.path = (char *) path;
+  serial = guestfs__send_sync (g, GUESTFS_PROC_ZFILE,
+        (xdrproc_t) xdr_guestfs_zfile_args, (char *) &args);
+  if (serial == -1) {
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  guestfs__switch_to_receiving (g);
+  ctx.cb_sequence = 0;
+  guestfs_set_reply_callback (g, zfile_reply_cb, &ctx);
+  (void) ml->main_loop_run (ml, g);
+  guestfs_set_reply_callback (g, NULL, NULL);
+  if (ctx.cb_sequence != 1) {
+    error (g, "%s reply failed, see earlier error messages", "guestfs_zfile");
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_ZFILE, serial) == -1) {
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  if (ctx.hdr.status == GUESTFS_STATUS_ERROR) {
+    error (g, "%s", ctx.err.error_message);
+    free (ctx.err.error_message);
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  guestfs_end_busy (g);
+  return ctx.ret.description; /* caller will free */
+}
+
+struct getxattrs_ctx {
+  /* This flag is set by the callbacks, so we know we've done
+   * the callbacks as expected, and in the right sequence.
+   * 0 = not called, 1 = reply_cb called.
+   */
+  int cb_sequence;
+  struct guestfs_message_header hdr;
+  struct guestfs_message_error err;
+  struct guestfs_getxattrs_ret ret;
+};
+
+static void getxattrs_reply_cb (guestfs_h *g, void *data, XDR *xdr)
+{
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  struct getxattrs_ctx *ctx = (struct getxattrs_ctx *) data;
+
+  /* This should definitely not happen. */
+  if (ctx->cb_sequence != 0) {
+    ctx->cb_sequence = 9999;
+    error (g, "%s: internal error: reply callback called twice", "guestfs_getxattrs");
+    return;
+  }
+
+  ml->main_loop_quit (ml, g);
+
+  if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
+    error (g, "%s: failed to parse reply header", "guestfs_getxattrs");
+    return;
+  }
+  if (ctx->hdr.status == GUESTFS_STATUS_ERROR) {
+    if (!xdr_guestfs_message_error (xdr, &ctx->err)) {
+      error (g, "%s: failed to parse reply error", "guestfs_getxattrs");
+      return;
+    }
+    goto done;
+  }
+  if (!xdr_guestfs_getxattrs_ret (xdr, &ctx->ret)) {
+    error (g, "%s: failed to parse reply", "guestfs_getxattrs");
+    return;
+  }
+ done:
+  ctx->cb_sequence = 1;
+}
+
+struct guestfs_xattr_list *guestfs_getxattrs (guestfs_h *g,
+		const char *path)
+{
+  struct guestfs_getxattrs_args args;
+  struct getxattrs_ctx ctx;
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  int serial;
+
+  if (check_state (g, "guestfs_getxattrs") == -1) return NULL;
+  guestfs_set_busy (g);
+
+  memset (&ctx, 0, sizeof ctx);
+
+  args.path = (char *) path;
+  serial = guestfs__send_sync (g, GUESTFS_PROC_GETXATTRS,
+        (xdrproc_t) xdr_guestfs_getxattrs_args, (char *) &args);
+  if (serial == -1) {
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  guestfs__switch_to_receiving (g);
+  ctx.cb_sequence = 0;
+  guestfs_set_reply_callback (g, getxattrs_reply_cb, &ctx);
+  (void) ml->main_loop_run (ml, g);
+  guestfs_set_reply_callback (g, NULL, NULL);
+  if (ctx.cb_sequence != 1) {
+    error (g, "%s reply failed, see earlier error messages", "guestfs_getxattrs");
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_GETXATTRS, serial) == -1) {
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  if (ctx.hdr.status == GUESTFS_STATUS_ERROR) {
+    error (g, "%s", ctx.err.error_message);
+    free (ctx.err.error_message);
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  guestfs_end_busy (g);
+  /* caller will free this */
+  return safe_memdup (g, &ctx.ret.xattrs, sizeof (ctx.ret.xattrs));
+}
+
+struct lgetxattrs_ctx {
+  /* This flag is set by the callbacks, so we know we've done
+   * the callbacks as expected, and in the right sequence.
+   * 0 = not called, 1 = reply_cb called.
+   */
+  int cb_sequence;
+  struct guestfs_message_header hdr;
+  struct guestfs_message_error err;
+  struct guestfs_lgetxattrs_ret ret;
+};
+
+static void lgetxattrs_reply_cb (guestfs_h *g, void *data, XDR *xdr)
+{
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  struct lgetxattrs_ctx *ctx = (struct lgetxattrs_ctx *) data;
+
+  /* This should definitely not happen. */
+  if (ctx->cb_sequence != 0) {
+    ctx->cb_sequence = 9999;
+    error (g, "%s: internal error: reply callback called twice", "guestfs_lgetxattrs");
+    return;
+  }
+
+  ml->main_loop_quit (ml, g);
+
+  if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
+    error (g, "%s: failed to parse reply header", "guestfs_lgetxattrs");
+    return;
+  }
+  if (ctx->hdr.status == GUESTFS_STATUS_ERROR) {
+    if (!xdr_guestfs_message_error (xdr, &ctx->err)) {
+      error (g, "%s: failed to parse reply error", "guestfs_lgetxattrs");
+      return;
+    }
+    goto done;
+  }
+  if (!xdr_guestfs_lgetxattrs_ret (xdr, &ctx->ret)) {
+    error (g, "%s: failed to parse reply", "guestfs_lgetxattrs");
+    return;
+  }
+ done:
+  ctx->cb_sequence = 1;
+}
+
+struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *g,
+		const char *path)
+{
+  struct guestfs_lgetxattrs_args args;
+  struct lgetxattrs_ctx ctx;
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  int serial;
+
+  if (check_state (g, "guestfs_lgetxattrs") == -1) return NULL;
+  guestfs_set_busy (g);
+
+  memset (&ctx, 0, sizeof ctx);
+
+  args.path = (char *) path;
+  serial = guestfs__send_sync (g, GUESTFS_PROC_LGETXATTRS,
+        (xdrproc_t) xdr_guestfs_lgetxattrs_args, (char *) &args);
+  if (serial == -1) {
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  guestfs__switch_to_receiving (g);
+  ctx.cb_sequence = 0;
+  guestfs_set_reply_callback (g, lgetxattrs_reply_cb, &ctx);
+  (void) ml->main_loop_run (ml, g);
+  guestfs_set_reply_callback (g, NULL, NULL);
+  if (ctx.cb_sequence != 1) {
+    error (g, "%s reply failed, see earlier error messages", "guestfs_lgetxattrs");
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LGETXATTRS, serial) == -1) {
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  if (ctx.hdr.status == GUESTFS_STATUS_ERROR) {
+    error (g, "%s", ctx.err.error_message);
+    free (ctx.err.error_message);
+    guestfs_end_busy (g);
+    return NULL;
+  }
+
+  guestfs_end_busy (g);
+  /* caller will free this */
+  return safe_memdup (g, &ctx.ret.xattrs, sizeof (ctx.ret.xattrs));
+}
+
+struct setxattr_ctx {
+  /* This flag is set by the callbacks, so we know we've done
+   * the callbacks as expected, and in the right sequence.
+   * 0 = not called, 1 = reply_cb called.
+   */
+  int cb_sequence;
+  struct guestfs_message_header hdr;
+  struct guestfs_message_error err;
+};
+
+static void setxattr_reply_cb (guestfs_h *g, void *data, XDR *xdr)
+{
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  struct setxattr_ctx *ctx = (struct setxattr_ctx *) data;
+
+  /* This should definitely not happen. */
+  if (ctx->cb_sequence != 0) {
+    ctx->cb_sequence = 9999;
+    error (g, "%s: internal error: reply callback called twice", "guestfs_setxattr");
+    return;
+  }
+
+  ml->main_loop_quit (ml, g);
+
+  if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
+    error (g, "%s: failed to parse reply header", "guestfs_setxattr");
+    return;
+  }
+  if (ctx->hdr.status == GUESTFS_STATUS_ERROR) {
+    if (!xdr_guestfs_message_error (xdr, &ctx->err)) {
+      error (g, "%s: failed to parse reply error", "guestfs_setxattr");
+      return;
+    }
+    goto done;
+  }
+ done:
+  ctx->cb_sequence = 1;
+}
+
+int guestfs_setxattr (guestfs_h *g,
+		const char *xattr,
+		const char *val,
+		int vallen,
+		const char *path)
+{
+  struct guestfs_setxattr_args args;
+  struct setxattr_ctx ctx;
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  int serial;
+
+  if (check_state (g, "guestfs_setxattr") == -1) return -1;
+  guestfs_set_busy (g);
+
+  memset (&ctx, 0, sizeof ctx);
+
+  args.xattr = (char *) xattr;
+  args.val = (char *) val;
+  args.vallen = vallen;
+  args.path = (char *) path;
+  serial = guestfs__send_sync (g, GUESTFS_PROC_SETXATTR,
+        (xdrproc_t) xdr_guestfs_setxattr_args, (char *) &args);
+  if (serial == -1) {
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  guestfs__switch_to_receiving (g);
+  ctx.cb_sequence = 0;
+  guestfs_set_reply_callback (g, setxattr_reply_cb, &ctx);
+  (void) ml->main_loop_run (ml, g);
+  guestfs_set_reply_callback (g, NULL, NULL);
+  if (ctx.cb_sequence != 1) {
+    error (g, "%s reply failed, see earlier error messages", "guestfs_setxattr");
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_SETXATTR, serial) == -1) {
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  if (ctx.hdr.status == GUESTFS_STATUS_ERROR) {
+    error (g, "%s", ctx.err.error_message);
+    free (ctx.err.error_message);
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  guestfs_end_busy (g);
+  return 0;
+}
+
+struct lsetxattr_ctx {
+  /* This flag is set by the callbacks, so we know we've done
+   * the callbacks as expected, and in the right sequence.
+   * 0 = not called, 1 = reply_cb called.
+   */
+  int cb_sequence;
+  struct guestfs_message_header hdr;
+  struct guestfs_message_error err;
+};
+
+static void lsetxattr_reply_cb (guestfs_h *g, void *data, XDR *xdr)
+{
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  struct lsetxattr_ctx *ctx = (struct lsetxattr_ctx *) data;
+
+  /* This should definitely not happen. */
+  if (ctx->cb_sequence != 0) {
+    ctx->cb_sequence = 9999;
+    error (g, "%s: internal error: reply callback called twice", "guestfs_lsetxattr");
+    return;
+  }
+
+  ml->main_loop_quit (ml, g);
+
+  if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
+    error (g, "%s: failed to parse reply header", "guestfs_lsetxattr");
+    return;
+  }
+  if (ctx->hdr.status == GUESTFS_STATUS_ERROR) {
+    if (!xdr_guestfs_message_error (xdr, &ctx->err)) {
+      error (g, "%s: failed to parse reply error", "guestfs_lsetxattr");
+      return;
+    }
+    goto done;
+  }
+ done:
+  ctx->cb_sequence = 1;
+}
+
+int guestfs_lsetxattr (guestfs_h *g,
+		const char *xattr,
+		const char *val,
+		int vallen,
+		const char *path)
+{
+  struct guestfs_lsetxattr_args args;
+  struct lsetxattr_ctx ctx;
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  int serial;
+
+  if (check_state (g, "guestfs_lsetxattr") == -1) return -1;
+  guestfs_set_busy (g);
+
+  memset (&ctx, 0, sizeof ctx);
+
+  args.xattr = (char *) xattr;
+  args.val = (char *) val;
+  args.vallen = vallen;
+  args.path = (char *) path;
+  serial = guestfs__send_sync (g, GUESTFS_PROC_LSETXATTR,
+        (xdrproc_t) xdr_guestfs_lsetxattr_args, (char *) &args);
+  if (serial == -1) {
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  guestfs__switch_to_receiving (g);
+  ctx.cb_sequence = 0;
+  guestfs_set_reply_callback (g, lsetxattr_reply_cb, &ctx);
+  (void) ml->main_loop_run (ml, g);
+  guestfs_set_reply_callback (g, NULL, NULL);
+  if (ctx.cb_sequence != 1) {
+    error (g, "%s reply failed, see earlier error messages", "guestfs_lsetxattr");
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LSETXATTR, serial) == -1) {
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  if (ctx.hdr.status == GUESTFS_STATUS_ERROR) {
+    error (g, "%s", ctx.err.error_message);
+    free (ctx.err.error_message);
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  guestfs_end_busy (g);
+  return 0;
+}
+
+struct removexattr_ctx {
+  /* This flag is set by the callbacks, so we know we've done
+   * the callbacks as expected, and in the right sequence.
+   * 0 = not called, 1 = reply_cb called.
+   */
+  int cb_sequence;
+  struct guestfs_message_header hdr;
+  struct guestfs_message_error err;
+};
+
+static void removexattr_reply_cb (guestfs_h *g, void *data, XDR *xdr)
+{
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  struct removexattr_ctx *ctx = (struct removexattr_ctx *) data;
+
+  /* This should definitely not happen. */
+  if (ctx->cb_sequence != 0) {
+    ctx->cb_sequence = 9999;
+    error (g, "%s: internal error: reply callback called twice", "guestfs_removexattr");
+    return;
+  }
+
+  ml->main_loop_quit (ml, g);
+
+  if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
+    error (g, "%s: failed to parse reply header", "guestfs_removexattr");
+    return;
+  }
+  if (ctx->hdr.status == GUESTFS_STATUS_ERROR) {
+    if (!xdr_guestfs_message_error (xdr, &ctx->err)) {
+      error (g, "%s: failed to parse reply error", "guestfs_removexattr");
+      return;
+    }
+    goto done;
+  }
+ done:
+  ctx->cb_sequence = 1;
+}
+
+int guestfs_removexattr (guestfs_h *g,
+		const char *xattr,
+		const char *path)
+{
+  struct guestfs_removexattr_args args;
+  struct removexattr_ctx ctx;
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  int serial;
+
+  if (check_state (g, "guestfs_removexattr") == -1) return -1;
+  guestfs_set_busy (g);
+
+  memset (&ctx, 0, sizeof ctx);
+
+  args.xattr = (char *) xattr;
+  args.path = (char *) path;
+  serial = guestfs__send_sync (g, GUESTFS_PROC_REMOVEXATTR,
+        (xdrproc_t) xdr_guestfs_removexattr_args, (char *) &args);
+  if (serial == -1) {
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  guestfs__switch_to_receiving (g);
+  ctx.cb_sequence = 0;
+  guestfs_set_reply_callback (g, removexattr_reply_cb, &ctx);
+  (void) ml->main_loop_run (ml, g);
+  guestfs_set_reply_callback (g, NULL, NULL);
+  if (ctx.cb_sequence != 1) {
+    error (g, "%s reply failed, see earlier error messages", "guestfs_removexattr");
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_REMOVEXATTR, serial) == -1) {
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  if (ctx.hdr.status == GUESTFS_STATUS_ERROR) {
+    error (g, "%s", ctx.err.error_message);
+    free (ctx.err.error_message);
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  guestfs_end_busy (g);
+  return 0;
+}
+
+struct lremovexattr_ctx {
+  /* This flag is set by the callbacks, so we know we've done
+   * the callbacks as expected, and in the right sequence.
+   * 0 = not called, 1 = reply_cb called.
+   */
+  int cb_sequence;
+  struct guestfs_message_header hdr;
+  struct guestfs_message_error err;
+};
+
+static void lremovexattr_reply_cb (guestfs_h *g, void *data, XDR *xdr)
+{
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  struct lremovexattr_ctx *ctx = (struct lremovexattr_ctx *) data;
+
+  /* This should definitely not happen. */
+  if (ctx->cb_sequence != 0) {
+    ctx->cb_sequence = 9999;
+    error (g, "%s: internal error: reply callback called twice", "guestfs_lremovexattr");
+    return;
+  }
+
+  ml->main_loop_quit (ml, g);
+
+  if (!xdr_guestfs_message_header (xdr, &ctx->hdr)) {
+    error (g, "%s: failed to parse reply header", "guestfs_lremovexattr");
+    return;
+  }
+  if (ctx->hdr.status == GUESTFS_STATUS_ERROR) {
+    if (!xdr_guestfs_message_error (xdr, &ctx->err)) {
+      error (g, "%s: failed to parse reply error", "guestfs_lremovexattr");
+      return;
+    }
+    goto done;
+  }
+ done:
+  ctx->cb_sequence = 1;
+}
+
+int guestfs_lremovexattr (guestfs_h *g,
+		const char *xattr,
+		const char *path)
+{
+  struct guestfs_lremovexattr_args args;
+  struct lremovexattr_ctx ctx;
+  guestfs_main_loop *ml = guestfs_get_main_loop (g);
+  int serial;
+
+  if (check_state (g, "guestfs_lremovexattr") == -1) return -1;
+  guestfs_set_busy (g);
+
+  memset (&ctx, 0, sizeof ctx);
+
+  args.xattr = (char *) xattr;
+  args.path = (char *) path;
+  serial = guestfs__send_sync (g, GUESTFS_PROC_LREMOVEXATTR,
+        (xdrproc_t) xdr_guestfs_lremovexattr_args, (char *) &args);
+  if (serial == -1) {
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  guestfs__switch_to_receiving (g);
+  ctx.cb_sequence = 0;
+  guestfs_set_reply_callback (g, lremovexattr_reply_cb, &ctx);
+  (void) ml->main_loop_run (ml, g);
+  guestfs_set_reply_callback (g, NULL, NULL);
+  if (ctx.cb_sequence != 1) {
+    error (g, "%s reply failed, see earlier error messages", "guestfs_lremovexattr");
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  if (check_reply_header (g, &ctx.hdr, GUESTFS_PROC_LREMOVEXATTR, serial) == -1) {
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  if (ctx.hdr.status == GUESTFS_STATUS_ERROR) {
+    error (g, "%s", ctx.err.error_message);
+    free (ctx.err.error_message);
+    guestfs_end_busy (g);
+    return -1;
+  }
+
+  guestfs_end_busy (g);
+  return 0;
+}
+
 /* Structure-freeing functions.  These rely on the fact that the
  * structure format is identical to the XDR format.  See note in
  * generator.ml.
@@ -12846,3 +13490,31 @@ guestfs_free_dirent_list (struct guestfs_dirent_list *x)
   free (x);
 }
 
+void
+guestfs_free_version (struct guestfs_version *x)
+{
+  xdr_free ((xdrproc_t) xdr_guestfs_int_version, (char *) x);
+  free (x);
+}
+
+void
+guestfs_free_version_list (struct guestfs_version_list *x)
+{
+  xdr_free ((xdrproc_t) xdr_guestfs_int_version_list, (char *) x);
+  free (x);
+}
+
+void
+guestfs_free_xattr (struct guestfs_xattr *x)
+{
+  xdr_free ((xdrproc_t) xdr_guestfs_int_xattr, (char *) x);
+  free (x);
+}
+
+void
+guestfs_free_xattr_list (struct guestfs_xattr_list *x)
+{
+  xdr_free ((xdrproc_t) xdr_guestfs_int_xattr_list, (char *) x);
+  free (x);
+}
+
diff --git a/src/guestfs-actions.h b/src/guestfs-actions.h
index b09ce08..c637731 100644
--- a/src/guestfs-actions.h
+++ b/src/guestfs-actions.h
@@ -66,6 +66,7 @@ extern int guestfs_end_busy (guestfs_h *handle);
 extern int guestfs_set_memsize (guestfs_h *handle, int memsize);
 extern int guestfs_get_memsize (guestfs_h *handle);
 extern int guestfs_get_pid (guestfs_h *handle);
+extern struct guestfs_version *guestfs_version (guestfs_h *handle);
 extern int guestfs_mount (guestfs_h *handle, const char *device, const char *mountpoint);
 extern int guestfs_sync (guestfs_h *handle);
 extern int guestfs_touch (guestfs_h *handle, const char *path);
@@ -205,3 +206,10 @@ extern int guestfs_mknod_c (guestfs_h *handle, int mode, int devmajor, int devmi
 extern int guestfs_umask (guestfs_h *handle, int mask);
 extern struct guestfs_dirent_list *guestfs_readdir (guestfs_h *handle, const char *dir);
 extern int guestfs_sfdiskM (guestfs_h *handle, const char *device, char * const* const lines);
+extern char *guestfs_zfile (guestfs_h *handle, const char *method, const char *path);
+extern struct guestfs_xattr_list *guestfs_getxattrs (guestfs_h *handle, const char *path);
+extern struct guestfs_xattr_list *guestfs_lgetxattrs (guestfs_h *handle, const char *path);
+extern int guestfs_setxattr (guestfs_h *handle, const char *xattr, const char *val, int vallen, const char *path);
+extern int guestfs_lsetxattr (guestfs_h *handle, const char *xattr, const char *val, int vallen, const char *path);
+extern int guestfs_removexattr (guestfs_h *handle, const char *xattr, const char *path);
+extern int guestfs_lremovexattr (guestfs_h *handle, const char *xattr, const char *path);
diff --git a/src/guestfs-structs.h b/src/guestfs-structs.h
index 36ba35d..3a62c49 100644
--- a/src/guestfs-structs.h
+++ b/src/guestfs-structs.h
@@ -174,3 +174,32 @@ struct guestfs_dirent_list {
 extern void guestfs_free_dirent (struct guestfs_dirent *);
 extern void guestfs_free_dirent_list (struct guestfs_dirent_list *);
 
+struct guestfs_version {
+  int64_t major;
+  int64_t minor;
+  int64_t release;
+  char *extra;
+};
+
+struct guestfs_version_list {
+  uint32_t len;
+  struct guestfs_version *val;
+};
+
+extern void guestfs_free_version (struct guestfs_version *);
+extern void guestfs_free_version_list (struct guestfs_version_list *);
+
+struct guestfs_xattr {
+  char *attrname;
+  uint32_t attrval_len;
+  char *attrval;
+};
+
+struct guestfs_xattr_list {
+  uint32_t len;
+  struct guestfs_xattr *val;
+};
+
+extern void guestfs_free_xattr (struct guestfs_xattr *);
+extern void guestfs_free_xattr_list (struct guestfs_xattr_list *);
+
diff --git a/src/guestfs.c b/src/guestfs.c
index 66ab12a..f445ada 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -327,6 +327,25 @@ guestfs_close (guestfs_h *g)
   if (g->state != CONFIG)
     guestfs_kill_subprocess (g);
 
+  /* Close any sockets and deregister any handlers. */
+  if (g->stdout_watch >= 0)
+    g->main_loop->remove_handle (g->main_loop, g, g->stdout_watch);
+  if (g->sock_watch >= 0)
+    g->main_loop->remove_handle (g->main_loop, g, g->sock_watch);
+  g->stdout_watch = -1;
+  g->sock_watch = -1;
+
+  if (g->fd[0] >= 0)
+    close (g->fd[0]);
+  if (g->fd[1] >= 0)
+    close (g->fd[1]);
+  if (g->sock >= 0)
+    close (g->sock);
+  g->fd[0] = -1;
+  g->fd[1] = -1;
+  g->sock = -1;
+
+  /* Remove tmpfiles. */
   if (g->tmpdir) {
     snprintf (filename, sizeof filename, "%s/sock", g->tmpdir);
     unlink (filename);
@@ -678,6 +697,19 @@ guestfs_get_pid (guestfs_h *g)
   }
 }
 
+struct guestfs_version *
+guestfs_version (guestfs_h *g)
+{
+  struct guestfs_version *r;
+
+  r = safe_malloc (g, sizeof *r);
+  r->major = PACKAGE_VERSION_MAJOR;
+  r->minor = PACKAGE_VERSION_MINOR;
+  r->release = PACKAGE_VERSION_RELEASE;
+  r->extra = safe_strdup (g, PACKAGE_VERSION_EXTRA);
+  return r;
+}
+
 /* Add a string to the current command line. */
 static void
 incr_cmdline_size (guestfs_h *g)
diff --git a/src/guestfs_protocol.c b/src/guestfs_protocol.c
index dae179c..47980b6 100644
--- a/src/guestfs_protocol.c
+++ b/src/guestfs_protocol.c
@@ -308,6 +308,56 @@ xdr_guestfs_int_dirent_list (XDR *xdrs, guestfs_int_dirent_list *objp)
 }
 
 bool_t
+xdr_guestfs_int_version (XDR *xdrs, guestfs_int_version *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_quad_t (xdrs, &objp->major))
+		 return FALSE;
+	 if (!xdr_quad_t (xdrs, &objp->minor))
+		 return FALSE;
+	 if (!xdr_quad_t (xdrs, &objp->release))
+		 return FALSE;
+	 if (!xdr_string (xdrs, &objp->extra, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_int_version_list (XDR *xdrs, guestfs_int_version_list *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_array (xdrs, (char **)&objp->guestfs_int_version_list_val, (u_int *) &objp->guestfs_int_version_list_len, ~0,
+		sizeof (guestfs_int_version), (xdrproc_t) xdr_guestfs_int_version))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_int_xattr (XDR *xdrs, guestfs_int_xattr *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->attrname, ~0))
+		 return FALSE;
+	 if (!xdr_bytes (xdrs, (char **)&objp->attrval.attrval_val, (u_int *) &objp->attrval.attrval_len, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_int_xattr_list (XDR *xdrs, guestfs_int_xattr_list *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_array (xdrs, (char **)&objp->guestfs_int_xattr_list_val, (u_int *) &objp->guestfs_int_xattr_list_len, ~0,
+		sizeof (guestfs_int_xattr), (xdrproc_t) xdr_guestfs_int_xattr))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
 xdr_guestfs_mount_args (XDR *xdrs, guestfs_mount_args *objp)
 {
 	register int32_t *buf;
@@ -2536,6 +2586,124 @@ xdr_guestfs_sfdiskM_args (XDR *xdrs, guestfs_sfdiskM_args *objp)
 }
 
 bool_t
+xdr_guestfs_zfile_args (XDR *xdrs, guestfs_zfile_args *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->method, ~0))
+		 return FALSE;
+	 if (!xdr_string (xdrs, &objp->path, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_zfile_ret (XDR *xdrs, guestfs_zfile_ret *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->description, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_getxattrs_args (XDR *xdrs, guestfs_getxattrs_args *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->path, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_getxattrs_ret (XDR *xdrs, guestfs_getxattrs_ret *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_guestfs_int_xattr_list (xdrs, &objp->xattrs))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_lgetxattrs_args (XDR *xdrs, guestfs_lgetxattrs_args *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->path, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_lgetxattrs_ret (XDR *xdrs, guestfs_lgetxattrs_ret *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_guestfs_int_xattr_list (xdrs, &objp->xattrs))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_setxattr_args (XDR *xdrs, guestfs_setxattr_args *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->xattr, ~0))
+		 return FALSE;
+	 if (!xdr_string (xdrs, &objp->val, ~0))
+		 return FALSE;
+	 if (!xdr_int (xdrs, &objp->vallen))
+		 return FALSE;
+	 if (!xdr_string (xdrs, &objp->path, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_lsetxattr_args (XDR *xdrs, guestfs_lsetxattr_args *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->xattr, ~0))
+		 return FALSE;
+	 if (!xdr_string (xdrs, &objp->val, ~0))
+		 return FALSE;
+	 if (!xdr_int (xdrs, &objp->vallen))
+		 return FALSE;
+	 if (!xdr_string (xdrs, &objp->path, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_removexattr_args (XDR *xdrs, guestfs_removexattr_args *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->xattr, ~0))
+		 return FALSE;
+	 if (!xdr_string (xdrs, &objp->path, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
+xdr_guestfs_lremovexattr_args (XDR *xdrs, guestfs_lremovexattr_args *objp)
+{
+	register int32_t *buf;
+
+	 if (!xdr_string (xdrs, &objp->xattr, ~0))
+		 return FALSE;
+	 if (!xdr_string (xdrs, &objp->path, ~0))
+		 return FALSE;
+	return TRUE;
+}
+
+bool_t
 xdr_guestfs_procedure (XDR *xdrs, guestfs_procedure *objp)
 {
 	register int32_t *buf;
diff --git a/src/guestfs_protocol.h b/src/guestfs_protocol.h
index a272682..c6f0c37 100644
--- a/src/guestfs_protocol.h
+++ b/src/guestfs_protocol.h
@@ -157,6 +157,33 @@ typedef struct {
 	guestfs_int_dirent *guestfs_int_dirent_list_val;
 } guestfs_int_dirent_list;
 
+struct guestfs_int_version {
+	quad_t major;
+	quad_t minor;
+	quad_t release;
+	char *extra;
+};
+typedef struct guestfs_int_version guestfs_int_version;
+
+typedef struct {
+	u_int guestfs_int_version_list_len;
+	guestfs_int_version *guestfs_int_version_list_val;
+} guestfs_int_version_list;
+
+struct guestfs_int_xattr {
+	char *attrname;
+	struct {
+		u_int attrval_len;
+		char *attrval_val;
+	} attrval;
+};
+typedef struct guestfs_int_xattr guestfs_int_xattr;
+
+typedef struct {
+	u_int guestfs_int_xattr_list_len;
+	guestfs_int_xattr *guestfs_int_xattr_list_val;
+} guestfs_int_xattr_list;
+
 struct guestfs_mount_args {
 	char *device;
 	char *mountpoint;
@@ -1238,6 +1265,65 @@ struct guestfs_sfdiskM_args {
 };
 typedef struct guestfs_sfdiskM_args guestfs_sfdiskM_args;
 
+struct guestfs_zfile_args {
+	char *method;
+	char *path;
+};
+typedef struct guestfs_zfile_args guestfs_zfile_args;
+
+struct guestfs_zfile_ret {
+	char *description;
+};
+typedef struct guestfs_zfile_ret guestfs_zfile_ret;
+
+struct guestfs_getxattrs_args {
+	char *path;
+};
+typedef struct guestfs_getxattrs_args guestfs_getxattrs_args;
+
+struct guestfs_getxattrs_ret {
+	guestfs_int_xattr_list xattrs;
+};
+typedef struct guestfs_getxattrs_ret guestfs_getxattrs_ret;
+
+struct guestfs_lgetxattrs_args {
+	char *path;
+};
+typedef struct guestfs_lgetxattrs_args guestfs_lgetxattrs_args;
+
+struct guestfs_lgetxattrs_ret {
+	guestfs_int_xattr_list xattrs;
+};
+typedef struct guestfs_lgetxattrs_ret guestfs_lgetxattrs_ret;
+
+struct guestfs_setxattr_args {
+	char *xattr;
+	char *val;
+	int vallen;
+	char *path;
+};
+typedef struct guestfs_setxattr_args guestfs_setxattr_args;
+
+struct guestfs_lsetxattr_args {
+	char *xattr;
+	char *val;
+	int vallen;
+	char *path;
+};
+typedef struct guestfs_lsetxattr_args guestfs_lsetxattr_args;
+
+struct guestfs_removexattr_args {
+	char *xattr;
+	char *path;
+};
+typedef struct guestfs_removexattr_args guestfs_removexattr_args;
+
+struct guestfs_lremovexattr_args {
+	char *xattr;
+	char *path;
+};
+typedef struct guestfs_lremovexattr_args guestfs_lremovexattr_args;
+
 enum guestfs_procedure {
 	GUESTFS_PROC_MOUNT = 1,
 	GUESTFS_PROC_SYNC = 2,
@@ -1378,7 +1464,14 @@ enum guestfs_procedure {
 	GUESTFS_PROC_UMASK = 137,
 	GUESTFS_PROC_READDIR = 138,
 	GUESTFS_PROC_SFDISKM = 139,
-	GUESTFS_PROC_NR_PROCS = 139 + 1,
+	GUESTFS_PROC_ZFILE = 140,
+	GUESTFS_PROC_GETXATTRS = 141,
+	GUESTFS_PROC_LGETXATTRS = 142,
+	GUESTFS_PROC_SETXATTR = 143,
+	GUESTFS_PROC_LSETXATTR = 144,
+	GUESTFS_PROC_REMOVEXATTR = 145,
+	GUESTFS_PROC_LREMOVEXATTR = 146,
+	GUESTFS_PROC_NR_PROCS = 146 + 1,
 };
 typedef enum guestfs_procedure guestfs_procedure;
 #define GUESTFS_MESSAGE_MAX 4194304
@@ -1443,6 +1536,10 @@ extern  bool_t xdr_guestfs_int_statvfs (XDR *, guestfs_int_statvfs*);
 extern  bool_t xdr_guestfs_int_statvfs_list (XDR *, guestfs_int_statvfs_list*);
 extern  bool_t xdr_guestfs_int_dirent (XDR *, guestfs_int_dirent*);
 extern  bool_t xdr_guestfs_int_dirent_list (XDR *, guestfs_int_dirent_list*);
+extern  bool_t xdr_guestfs_int_version (XDR *, guestfs_int_version*);
+extern  bool_t xdr_guestfs_int_version_list (XDR *, guestfs_int_version_list*);
+extern  bool_t xdr_guestfs_int_xattr (XDR *, guestfs_int_xattr*);
+extern  bool_t xdr_guestfs_int_xattr_list (XDR *, guestfs_int_xattr_list*);
 extern  bool_t xdr_guestfs_mount_args (XDR *, guestfs_mount_args*);
 extern  bool_t xdr_guestfs_touch_args (XDR *, guestfs_touch_args*);
 extern  bool_t xdr_guestfs_cat_args (XDR *, guestfs_cat_args*);
@@ -1629,6 +1726,16 @@ extern  bool_t xdr_guestfs_umask_ret (XDR *, guestfs_umask_ret*);
 extern  bool_t xdr_guestfs_readdir_args (XDR *, guestfs_readdir_args*);
 extern  bool_t xdr_guestfs_readdir_ret (XDR *, guestfs_readdir_ret*);
 extern  bool_t xdr_guestfs_sfdiskM_args (XDR *, guestfs_sfdiskM_args*);
+extern  bool_t xdr_guestfs_zfile_args (XDR *, guestfs_zfile_args*);
+extern  bool_t xdr_guestfs_zfile_ret (XDR *, guestfs_zfile_ret*);
+extern  bool_t xdr_guestfs_getxattrs_args (XDR *, guestfs_getxattrs_args*);
+extern  bool_t xdr_guestfs_getxattrs_ret (XDR *, guestfs_getxattrs_ret*);
+extern  bool_t xdr_guestfs_lgetxattrs_args (XDR *, guestfs_lgetxattrs_args*);
+extern  bool_t xdr_guestfs_lgetxattrs_ret (XDR *, guestfs_lgetxattrs_ret*);
+extern  bool_t xdr_guestfs_setxattr_args (XDR *, guestfs_setxattr_args*);
+extern  bool_t xdr_guestfs_lsetxattr_args (XDR *, guestfs_lsetxattr_args*);
+extern  bool_t xdr_guestfs_removexattr_args (XDR *, guestfs_removexattr_args*);
+extern  bool_t xdr_guestfs_lremovexattr_args (XDR *, guestfs_lremovexattr_args*);
 extern  bool_t xdr_guestfs_procedure (XDR *, guestfs_procedure*);
 extern  bool_t xdr_guestfs_message_direction (XDR *, guestfs_message_direction*);
 extern  bool_t xdr_guestfs_message_status (XDR *, guestfs_message_status*);
@@ -1652,6 +1759,10 @@ extern bool_t xdr_guestfs_int_statvfs ();
 extern bool_t xdr_guestfs_int_statvfs_list ();
 extern bool_t xdr_guestfs_int_dirent ();
 extern bool_t xdr_guestfs_int_dirent_list ();
+extern bool_t xdr_guestfs_int_version ();
+extern bool_t xdr_guestfs_int_version_list ();
+extern bool_t xdr_guestfs_int_xattr ();
+extern bool_t xdr_guestfs_int_xattr_list ();
 extern bool_t xdr_guestfs_mount_args ();
 extern bool_t xdr_guestfs_touch_args ();
 extern bool_t xdr_guestfs_cat_args ();
@@ -1838,6 +1949,16 @@ extern bool_t xdr_guestfs_umask_ret ();
 extern bool_t xdr_guestfs_readdir_args ();
 extern bool_t xdr_guestfs_readdir_ret ();
 extern bool_t xdr_guestfs_sfdiskM_args ();
+extern bool_t xdr_guestfs_zfile_args ();
+extern bool_t xdr_guestfs_zfile_ret ();
+extern bool_t xdr_guestfs_getxattrs_args ();
+extern bool_t xdr_guestfs_getxattrs_ret ();
+extern bool_t xdr_guestfs_lgetxattrs_args ();
+extern bool_t xdr_guestfs_lgetxattrs_ret ();
+extern bool_t xdr_guestfs_setxattr_args ();
+extern bool_t xdr_guestfs_lsetxattr_args ();
+extern bool_t xdr_guestfs_removexattr_args ();
+extern bool_t xdr_guestfs_lremovexattr_args ();
 extern bool_t xdr_guestfs_procedure ();
 extern bool_t xdr_guestfs_message_direction ();
 extern bool_t xdr_guestfs_message_status ();
diff --git a/src/guestfs_protocol.x b/src/guestfs_protocol.x
index 8f81299..5a2e152 100644
--- a/src/guestfs_protocol.x
+++ b/src/guestfs_protocol.x
@@ -134,6 +134,22 @@ struct guestfs_int_dirent {
 
 typedef struct guestfs_int_dirent guestfs_int_dirent_list<>;
 
+struct guestfs_int_version {
+  hyper major;
+  hyper minor;
+  hyper release;
+  string extra<>;
+};
+
+typedef struct guestfs_int_version guestfs_int_version_list<>;
+
+struct guestfs_int_xattr {
+  string attrname<>;
+  opaque attrval<>;
+};
+
+typedef struct guestfs_int_xattr guestfs_int_xattr_list<>;
+
 struct guestfs_mount_args {
   string device<>;
   string mountpoint<>;
@@ -942,6 +958,55 @@ struct guestfs_sfdiskM_args {
   str lines<>;
 };
 
+struct guestfs_zfile_args {
+  string method<>;
+  string path<>;
+};
+
+struct guestfs_zfile_ret {
+  string description<>;
+};
+
+struct guestfs_getxattrs_args {
+  string path<>;
+};
+
+struct guestfs_getxattrs_ret {
+  guestfs_int_xattr_list xattrs;
+};
+
+struct guestfs_lgetxattrs_args {
+  string path<>;
+};
+
+struct guestfs_lgetxattrs_ret {
+  guestfs_int_xattr_list xattrs;
+};
+
+struct guestfs_setxattr_args {
+  string xattr<>;
+  string val<>;
+  int vallen;
+  string path<>;
+};
+
+struct guestfs_lsetxattr_args {
+  string xattr<>;
+  string val<>;
+  int vallen;
+  string path<>;
+};
+
+struct guestfs_removexattr_args {
+  string xattr<>;
+  string path<>;
+};
+
+struct guestfs_lremovexattr_args {
+  string xattr<>;
+  string path<>;
+};
+
 enum guestfs_procedure {
   GUESTFS_PROC_MOUNT = 1,
   GUESTFS_PROC_SYNC = 2,
@@ -1082,6 +1147,13 @@ enum guestfs_procedure {
   GUESTFS_PROC_UMASK = 137,
   GUESTFS_PROC_READDIR = 138,
   GUESTFS_PROC_SFDISKM = 139,
+  GUESTFS_PROC_ZFILE = 140,
+  GUESTFS_PROC_GETXATTRS = 141,
+  GUESTFS_PROC_LGETXATTRS = 142,
+  GUESTFS_PROC_SETXATTR = 143,
+  GUESTFS_PROC_LSETXATTR = 144,
+  GUESTFS_PROC_REMOVEXATTR = 145,
+  GUESTFS_PROC_LREMOVEXATTR = 146,
   GUESTFS_PROC_NR_PROCS
 };
 
diff --git a/inspector/Makefile.am b/v2v/Makefile.am
similarity index 66%
copy from inspector/Makefile.am
copy to v2v/Makefile.am
index a1df2ab..69ed98c 100644
--- a/inspector/Makefile.am
+++ b/v2v/Makefile.am
@@ -1,4 +1,4 @@
-# libguestfs virt-inspector
+# libguestfs virt-v2v
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -16,33 +16,33 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 EXTRA_DIST = \
-	run-inspector-locally \
-	virt-inspector.pl
+	run-v2v-locally \
+	virt-v2v.pl
 
-if HAVE_INSPECTOR
+if HAVE_V2V
 
-man_MANS = virt-inspector.1
+man_MANS = virt-v2v.1
 
-noinst_DATA = @top_builddir@/html/virt-inspector.1.html
+noinst_DATA = @top_builddir@/html/virt-v2v.1.html
 
-virt-inspector.1: virt-inspector.pl
+virt-v2v.1: virt-v2v.pl
 	$(POD2MAN) \
 	  --section 1 \
 	  -c "Virtualization Support" \
 	  --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
 	  $< > $@
 
- at top_builddir@/html/virt-inspector.1.html: virt-inspector.pl
+ at top_builddir@/html/virt-v2v.1.html: virt-v2v.pl
 	mkdir -p @top_builddir@/html
 	cd @top_builddir@ && pod2html \
 	  --css 'pod.css' \
-	  --title 'virt-inspector, display OS version, kernel, drivers, mount points, applications, etc. in a virtual machine' \
+	  --title 'virt-v2v, convert virtual machine from Xen to KVM' \
 	  --htmldir html \
-	  --outfile html/virt-inspector.1.html \
-	  inspector/$<
+	  --outfile html/virt-v2v.1.html \
+	  v2v/$<
 
 install-data-hook:
 	mkdir -p $(DESTDIR)$(bindir)
-	install -m 0755 virt-inspector.pl $(DESTDIR)$(bindir)/virt-inspector
+	install -m 0755 virt-v2v.pl $(DESTDIR)$(bindir)/virt-v2v
 
 endif
diff --git a/inspector/Makefile.in b/v2v/Makefile.in
similarity index 69%
copy from inspector/Makefile.in
copy to v2v/Makefile.in
index fa379e6..8d3e76b 100644
--- a/inspector/Makefile.in
+++ b/v2v/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,7 +15,7 @@
 
 @SET_MAKE@
 
-# libguestfs virt-inspector
+# libguestfs virt-v2v
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -33,8 +34,9 @@
 
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
@@ -49,7 +51,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-subdir = inspector
+subdir = v2v
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
@@ -65,8 +67,30 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 man1dir = $(mandir)/man1
 am__installdirs = "$(DESTDIR)$(man1dir)"
 NROFF = nroff
@@ -249,11 +273,11 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = \
-	run-inspector-locally \
-	virt-inspector.pl
+	run-v2v-locally \
+	virt-v2v.pl
 
- at HAVE_INSPECTOR_TRUE@man_MANS = virt-inspector.1
- at HAVE_INSPECTOR_TRUE@noinst_DATA = @top_builddir@/html/virt-inspector.1.html
+ at HAVE_V2V_TRUE@man_MANS = virt-v2v.1
+ at HAVE_V2V_TRUE@noinst_DATA = @top_builddir@/html/virt-v2v.1.html
 all: all-am
 
 .SUFFIXES:
@@ -266,9 +290,9 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  inspector/Makefile'; \
-	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign  inspector/Makefile
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign v2v/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign v2v/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
@@ -286,57 +310,51 @@ $(top_srcdir)/configure:  $(am__configure_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
 
 mostlyclean-libtool:
 	-rm -f *.lo
 
 clean-libtool:
 	-rm -rf .libs _libs
-install-man1: $(man1_MANS) $(man_MANS)
+install-man1: $(man_MANS)
 	@$(NORMAL_INSTALL)
 	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.1*) list="$$list $$i" ;; \
-	  esac; \
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+	  fi; \
 	done; \
-	for i in $$list; do \
-	  if test -f $$i; then file=$$i; \
-	  else file=$(srcdir)/$$i; fi; \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    1*) ;; \
-	    *) ext='1' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
-	  $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
-	done
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+	done; }
+
 uninstall-man1:
 	@$(NORMAL_UNINSTALL)
-	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
-	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
-	for i in $$l2; do \
-	  case "$$i" in \
-	    *.1*) list="$$list $$i" ;; \
-	  esac; \
-	done; \
-	for i in $$list; do \
-	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
-	  case "$$ext" in \
-	    1*) ;; \
-	    *) ext='1' ;; \
-	  esac; \
-	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
-	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
-	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
-	  echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
-	  rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
-	done
+	@list=''; test -n "$(man1dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+	  sed -n '/\.1[a-z]*$$/p'; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	test -z "$$files" || { \
+	  echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
+	  cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
 tags: TAGS
 TAGS:
 
@@ -345,6 +363,19 @@ CTAGS:
 
 
 distdir: $(DISTFILES)
+	@list='$(MANS)'; if test -n "$$list"; then \
+	  list=`for p in $$list; do \
+	    if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
+	  if test -n "$$list" && \
+	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
+	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
+	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
+	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    exit 1; \
+	  else :; fi; \
+	else :; fi
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
 	list='$(DISTFILES)'; \
@@ -360,13 +391,17 @@ distdir: $(DISTFILES)
 	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
 	  if test -d $$d/$$file; then \
 	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
 	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
-	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
 	    fi; \
-	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
 	  else \
-	    test -f $(distdir)/$$file \
-	    || cp -p $$d/$$file $(distdir)/$$file \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
 	    || exit 1; \
 	  fi; \
 	done
@@ -397,11 +432,12 @@ clean-generic:
 
 distclean-generic:
 	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 
 maintainer-clean-generic:
 	@echo "This command is intended for maintainers to use"
 	@echo "it deletes files that may require special tools to rebuild."
- at HAVE_INSPECTOR_FALSE@install-data-hook:
+ at HAVE_V2V_FALSE@install-data-hook:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool mostlyclean-am
@@ -416,6 +452,8 @@ dvi-am:
 
 html: html-am
 
+html-am:
+
 info: info-am
 
 info-am:
@@ -423,21 +461,30 @@ info-am:
 install-data-am: install-man
 	@$(NORMAL_INSTALL)
 	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
 install-dvi: install-dvi-am
 
+install-dvi-am:
+
 install-exec-am:
 
 install-html: install-html-am
 
+install-html-am:
+
 install-info: install-info-am
 
+install-info-am:
+
 install-man: install-man1
 
 install-pdf: install-pdf-am
 
+install-pdf-am:
+
 install-ps: install-ps-am
 
+install-ps-am:
+
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
@@ -475,25 +522,26 @@ uninstall-man: uninstall-man1
 	ps ps-am uninstall uninstall-am uninstall-man uninstall-man1
 
 
- at HAVE_INSPECTOR_TRUE@virt-inspector.1: virt-inspector.pl
- at HAVE_INSPECTOR_TRUE@	$(POD2MAN) \
- at HAVE_INSPECTOR_TRUE@	  --section 1 \
- at HAVE_INSPECTOR_TRUE@	  -c "Virtualization Support" \
- at HAVE_INSPECTOR_TRUE@	  --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
- at HAVE_INSPECTOR_TRUE@	  $< > $@
-
- at HAVE_INSPECTOR_TRUE@@top_builddir@/html/virt-inspector.1.html: virt-inspector.pl
- at HAVE_INSPECTOR_TRUE@	mkdir -p @top_builddir@/html
- at HAVE_INSPECTOR_TRUE@	cd @top_builddir@ && pod2html \
- at HAVE_INSPECTOR_TRUE@	  --css 'pod.css' \
- at HAVE_INSPECTOR_TRUE@	  --title 'virt-inspector, display OS version, kernel, drivers, mount points, applications, etc. in a virtual machine' \
- at HAVE_INSPECTOR_TRUE@	  --htmldir html \
- at HAVE_INSPECTOR_TRUE@	  --outfile html/virt-inspector.1.html \
- at HAVE_INSPECTOR_TRUE@	  inspector/$<
-
- at HAVE_INSPECTOR_TRUE@install-data-hook:
- at HAVE_INSPECTOR_TRUE@	mkdir -p $(DESTDIR)$(bindir)
- at HAVE_INSPECTOR_TRUE@	install -m 0755 virt-inspector.pl $(DESTDIR)$(bindir)/virt-inspector
+ at HAVE_V2V_TRUE@virt-v2v.1: virt-v2v.pl
+ at HAVE_V2V_TRUE@	$(POD2MAN) \
+ at HAVE_V2V_TRUE@	  --section 1 \
+ at HAVE_V2V_TRUE@	  -c "Virtualization Support" \
+ at HAVE_V2V_TRUE@	  --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
+ at HAVE_V2V_TRUE@	  $< > $@
+
+ at HAVE_V2V_TRUE@@top_builddir@/html/virt-v2v.1.html: virt-v2v.pl
+ at HAVE_V2V_TRUE@	mkdir -p @top_builddir@/html
+ at HAVE_V2V_TRUE@	cd @top_builddir@ && pod2html \
+ at HAVE_V2V_TRUE@	  --css 'pod.css' \
+ at HAVE_V2V_TRUE@	  --title 'virt-v2v, convert virtual machine from Xen to KVM' \
+ at HAVE_V2V_TRUE@	  --htmldir html \
+ at HAVE_V2V_TRUE@	  --outfile html/virt-v2v.1.html \
+ at HAVE_V2V_TRUE@	  v2v/$<
+
+ at HAVE_V2V_TRUE@install-data-hook:
+ at HAVE_V2V_TRUE@	mkdir -p $(DESTDIR)$(bindir)
+ at HAVE_V2V_TRUE@	install -m 0755 virt-v2v.pl $(DESTDIR)$(bindir)/virt-v2v
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/inspector/run-inspector-locally b/v2v/run-v2v-locally
similarity index 86%
copy from inspector/run-inspector-locally
copy to v2v/run-v2v-locally
index 156f3ae..4d792fb 100755
--- a/inspector/run-inspector-locally
+++ b/v2v/run-v2v-locally
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# libguestfs inspector
+# virt-v2v
 # Copyright (C) 2009 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -16,12 +16,12 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-# This script sets up the environment so you can run virt-inspector in place
-# without needing to do 'make install' first. You can also run virt-inspector
+# This script sets up the environment so you can run virt-v2v in place
+# without needing to do 'make install' first. You can also run virt-v2v
 # by creating a symlink to this script and putting it in your path.
 #
 # Use it like this:
-#   ./run-inspector-locally [usual virt-inspector args ...]
+#   ./run-v2v-locally [usual virt-v2v args ...]
 
 use strict;
 use warnings;
@@ -49,4 +49,4 @@ $ENV{LD_LIBRARY_PATH} = $path.'/src/.libs';
 $ENV{LIBGUESTFS_PATH} = $path.'/appliance';
 $ENV{PERL5LIB}        = $path.'/perl/blib/lib:'.$path.'/perl/blib/arch';
 
-exec('perl', $path.'/inspector/virt-inspector.pl', @ARGV);
+exec('perl', $path.'/v2v/virt-v2v.pl', @ARGV);
diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
new file mode 100755
index 0000000..fb1f220
--- /dev/null
+++ b/v2v/virt-v2v.pl
@@ -0,0 +1,276 @@
+#!/usr/bin/perl -w
+# virt-v2v
+# Copyright (C) 2009 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+use warnings;
+use strict;
+
+use Sys::Guestfs;
+use Sys::Guestfs::Lib qw(open_guest get_partitions resolve_windows_path
+  inspect_all_partitions inspect_partition
+  inspect_operating_systems mount_operating_system inspect_in_detail);
+use Pod::Usage;
+use Getopt::Long;
+use Data::Dumper;
+use File::Temp qw/tempdir/;
+use XML::Writer;
+use Locale::TextDomain 'libguestfs';
+
+=encoding utf8
+
+=head1 NAME
+
+virt-v2v - Convert Xen or VMWare guests to KVM
+
+=head1 SYNOPSIS
+
+ virt-v2v xen_name -o kvm_name
+
+ virt-v2v guest.ovf.zip -o kvm_name
+
+ virt-v2v guest.img [guest.img ...]
+
+=head1 DESCRIPTION
+
+Virt-v2v converts guests from one virtualization hypervisor to
+another.  Currently it is limited in what it can convert.  See the
+table below.
+
+ -------------------------------+----------------------------
+ SOURCE                         | TARGET
+ -------------------------------+----------------------------
+ Xen domain managed by          |
+ libvirt                        |
+                                |
+ Xen compatibility:             |
+   - PV or FV kernel            |  KVM guest managed by
+   - with or without PV drivers |  libvirt
+   - RHEL 3.9+, 4.8+, 5.3+      |    - with virtio drivers
+   - Windows XP, 2003           |
+                                |
+ -------------------------------+
+                                |
+ VMWare VMDK image with         |
+ OVF metadata, exported from    |
+ vSphere                        |
+                                |
+ VMWare compatibility:          |
+   - RHEL 3.9+, 4.8+, 5.3+      |
+   - VMWare tools               |
+                                |
+ -------------------------------+----------------------------
+
+=head2 CONVERTING XEN DOMAINS
+
+For Xen domains managed by libvirt, perform the initial conversion
+using:
+
+ virt-v2v xen_name -o kvm_name
+
+where C<xen_name> is the libvirt Xen domain name, and C<kvm_name> is
+the (new) name for the converted KVM guest.
+
+Then test boot the new guest in KVM:
+
+ virsh start kvm_name
+ virt-viewer kvm_name
+
+When you have verified that this works, shut down the new KVM domain
+and I<commit> the changes by doing:
+
+ virt-v2v --commit kvm_name
+
+I<This command will destroy the original Xen domain>.
+
+Or you can I<rollback> to the original Xen domain by doing:
+
+ virt-v2v --rollback kvm_name
+
+B<Very important note:> Do I<not> try to run both the original Xen
+domain and the KVM domain at the same time!  This will cause guest
+corruption.
+
+=head2 CONVERTING VMWARE GUESTS
+
+I<This section to be written>
+
+
+
+
+
+=head1 OPTIONS
+
+=over 4
+
+=cut
+
+my $help;
+
+=item B<--help>
+
+Display brief help.
+
+=cut
+
+my $version;
+
+=item B<--version>
+
+Display version number and exit.
+
+=cut
+
+my $uri;
+
+=item B<--connect URI> | B<-c URI>
+
+If using libvirt, connect to the given I<URI>.  If omitted,
+then we connect to the default libvirt hypervisor.
+
+Libvirt is only used if you specify a C<domname> on the
+command line.  If you specify guest block devices directly,
+then libvirt is not used at all.
+
+=cut
+
+my $output;
+
+=item B<--output name> | B<-o name>
+
+Set the output guest name.
+
+=cut
+
+=back
+
+=cut
+
+GetOptions ("help|?" => \$help,
+	    "version" => \$version,
+	    "connect|c=s" => \$uri,
+	    "output|o=s" => \$output,
+    ) or pod2usage (2);
+pod2usage (1) if $help;
+if ($version) {
+    my $g = Sys::Guestfs->new ();
+    my %h = $g->version ();
+    print "$h{major}.$h{minor}.$h{release}$h{extra}\n";
+    exit
+}
+pod2usage (__"virt-v2v: no image or VM names given") if @ARGV == 0;
+
+# XXX This should be an option.  Disable for now until we get
+# downloads working reliably.
+my $use_windows_registry = 0;
+
+my @params = (\@ARGV);
+if ($uri) {
+    push @params, address => $uri;
+}
+my ($g, $conn, $dom) = open_guest (@params);
+
+$g->launch ();
+$g->wait_ready ();
+
+# List of possible filesystems.
+my @partitions = get_partitions ($g);
+
+# Now query each one to build up a picture of what's in it.
+my %fses =
+    inspect_all_partitions ($g, \@partitions,
+			    use_windows_registry => $use_windows_registry);
+
+#print "fses -----------\n";
+#print Dumper(\%fses);
+
+my $oses = inspect_operating_systems ($g, \%fses);
+
+#print "oses -----------\n";
+#print Dumper($oses);
+
+# Only work on single-root operating systems.
+my $root_dev;
+my @roots = keys %$oses;
+die __"no root device found in this operating system image" if @roots == 0;
+die __"multiboot operating systems are not supported by v2v" if @roots > 1;
+$root_dev = $roots[0];
+
+# Mount up the disks and check for applications.
+
+my $os = $oses->{$root_dev};
+mount_operating_system ($g, $os);
+inspect_in_detail ($g, $os);
+$g->umount_all ();
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+=head1 SEE ALSO
+
+L<virt-inspector(1)>,
+L<guestfs(3)>,
+L<guestfish(1)>,
+L<Sys::Guestfs(3)>,
+L<Sys::Guestfs::Lib(3)>,
+L<Sys::Virt(3)>,
+L<http://libguestfs.org/>.
+
+For Windows registry parsing we require the C<reged> program
+from L<http://home.eunet.no/~pnordahl/ntpasswd/>.
+
+=head1 AUTHOR
+
+Richard W.M. Jones L<http://et.redhat.com/~rjones/>
+
+Matthew Booth L<mbooth at redhat.com>
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009 Red Hat Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

-- 
Libguestfs Debian packaging



More information about the Pkg-libvirt-commits mailing list