capitests/tests
capitests/tests.c
capitests/test*.tmp
-cat/virt-cat.1
ChangeLog
*.class
*.cma
daemon/stubs.c
depcomp
.deps
-df/virt-df.1
-edit/virt-edit.1
emptydisk
examples/hello
examples/to-xml
python/guestfs-py.c
python/guestfs.pyc
regressions/test1.img
-rescue/virt-rescue.1
ruby/bindtests.rb
ruby/ext/guestfs/extconf.h
ruby/ext/guestfs/_guestfs.c
test-tool/libguestfs-test-tool.1
test-tool/libguestfs-test-tool
test-tool/libguestfs-test-tool-helper
+tools/virt-*.1
/GNUmakefile
/maint.mk
/build-aux
appliance/
The qemu appliance, build scripts and so on.
-cat/
- The virt-cat tool.
-
capitests/
Automated tests of the C API.
daemon/
The daemon that runs inside the guest and carries out actions.
-df/
- The virt-df tool.
-
-edit/
- The virt-edit tool.
-
examples/
The examples.
regressions/
Regression tests.
-rescue/
- The virt-rescue tool.
-
ruby/
Ruby bindings.
+tools/
+ Command line tools like virt-cat, virt-df, virt-edit and more.
+ In versions <= 1.0.73 these were all in separate directories
+ like cat/, df/, edit/, but since then we moved them all into
+ one directory to simplify builds.
+
src/
Source code to the C library.
Also contains the crucial generator program.
if HAVE_PERL
SUBDIRS += perl
endif
+
if HAVE_INSPECTOR
SUBDIRS += inspector
endif
+if HAVE_TOOLS
+SUBDIRS += tools
+endif
+
if HAVE_OCAML
SUBDIRS += ocaml ocaml/examples
endif
if HAVE_HASKELL
SUBDIRS += haskell
endif
-if HAVE_DF
-SUBDIRS += df
-endif
-if HAVE_CAT
-SUBDIRS += cat
-endif
-if HAVE_RESCUE
-SUBDIRS += rescue
-endif
-if HAVE_EDIT
-SUBDIRS += edit
-endif
EXTRA_DIST = \
guestfs.pod guestfs-actions.pod guestfs-structs.pod \
+++ /dev/null
-#!/usr/bin/perl
-# 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.
-
-# 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-cat-locally [usual virt-cat args ...]
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
- my $link = readlink($path) or die "readlink: $path: $!";
- if(File::Spec->file_name_is_absolute($link)) {
- $path = $link;
- } else {
- $path = File::Spec->catfile(dirname($path), $link);
- }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$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.'/cat/virt-cat', @ARGV);
fi
done
if test "x$missing_perl_modules" = "xyes"; then
- AC_MSG_WARN([some Perl modules required to compile virt-cat, virt-df, virt-edit, virt-inspector and virt-rescue are missing])
+ AC_MSG_WARN([some Perl modules required to compile virt-inspector and the other virt-* tools 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_EDIT],
- [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_RESCUE],
+AM_CONDITIONAL([HAVE_TOOLS],
[test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
dnl Library versioning.
ruby/Makefile ruby/Rakefile
java/Makefile
haskell/Makefile
- cat/Makefile
- df/Makefile
- edit/Makefile
inspector/Makefile
- rescue/Makefile
+ tools/Makefile
libguestfs.pc
gnulib/lib/Makefile
gnulib/tests/Makefile
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-edit ........................... "
-if test "x$HAVE_EDIT" = "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-rescue ......................... "
-if test "x$HAVE_RESCUE" = "x"; then echo "yes"; else echo "no"; fi
+echo -n "virt-* tools ........................ "
+if test "x$HAVE_TOOLS" = "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'"
+++ /dev/null
-# libguestfs 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.
-
-EXTRA_DIST = \
- run-df-locally \
- virt-df
-
-if HAVE_DF
-
-bin_SCRIPTS = virt-df
-man_MANS = virt-df.1
-
-noinst_DATA = $(top_builddir)/html/virt-df.1.html
-
-virt-df.1: virt-df
- $(POD2MAN) \
- --section 1 \
- -c "Virtualization Support" \
- --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
- $< > $@-t && mv $@-t $@
-
-$(top_builddir)/html/virt-df.1.html: virt-df
- mkdir -p $(top_builddir)/html
- cd $(top_builddir) && pod2html \
- --css 'pod.css' \
- --title 'virt-df, display free space on virtual filesystems' \
- --htmldir html \
- --outfile html/virt-df.1.html \
- df/$<
-
-endif
+++ /dev/null
-#!/usr/bin/perl
-# 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.
-
-# 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-df-locally [usual virt-df args ...]
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
- my $link = readlink($path) or die "readlink: $path: $!";
- if(File::Spec->file_name_is_absolute($link)) {
- $path = $link;
- } else {
- $path = File::Spec->catfile(dirname($path), $link);
- }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$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.'/df/virt-df', @ARGV);
+++ /dev/null
-# libguestfs virt-edit
-# 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.
-
-EXTRA_DIST = \
- run-edit-locally \
- virt-edit
-
-if HAVE_EDIT
-
-bin_SCRIPTS = virt-edit
-man_MANS = virt-edit.1
-
-noinst_DATA = $(top_builddir)/html/virt-edit.1.html
-
-virt-edit.1: virt-edit
- $(POD2MAN) \
- --section 1 \
- -c "Virtualization Support" \
- --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
- $< > $@-t && mv $@-t $@
-
-$(top_builddir)/html/virt-edit.1.html: virt-edit
- mkdir -p $(top_builddir)/html
- cd $(top_builddir) && pod2html \
- --css 'pod.css' \
- --title 'virt-edit, edit a file in a virtual machine' \
- --htmldir html \
- --outfile html/virt-edit.1.html \
- edit/$<
-
-endif
+++ /dev/null
-#!/usr/bin/perl
-# virt-edit
-# 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.
-
-# This script sets up the environment so you can run virt-edit in place
-# without needing to do 'make install' first. You can also run virt-edit
-# by creating a symlink to this script and putting it in your path.
-#
-# Use it like this:
-# ./run-edit-locally [usual virt-edit args ...]
-
-use strict;
-use warnings;
-
-use File::Basename qw(dirname);
-use File::Spec;
-use Cwd qw(abs_path);
-
-my $path = $0;
-
-# Follow symlinks until we get to the real file
-while(-l $path) {
- my $link = readlink($path) or die "readlink: $path: $!";
- if(File::Spec->file_name_is_absolute($link)) {
- $path = $link;
- } else {
- $path = File::Spec->catfile(dirname($path), $link);
- }
-}
-
-# Get the absolute path of the parent directory
-$path = abs_path(dirname($path).'/..');
-
-$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.'/edit/virt-edit', @ARGV);
-cat/virt-cat
daemon/augeas.c
daemon/blockdev.c
daemon/checksum.c
daemon/xattr.c
daemon/zero.c
daemon/zerofree.c
-df/virt-df
-edit/virt-edit
fish/alloc.c
fish/cmds.c
fish/completion.c
perl/lib/Sys/Guestfs/Lib.pm
python/guestfs-py.c
regressions/test-noexec-stack.pl
-rescue/virt-rescue
ruby/ext/guestfs/_guestfs.c
src/guestfs-actions.c
src/guestfs-bindtests.c
src/guestfs.c
test-tool/helper.c
test-tool/test-tool.c
+tools/virt-cat
+tools/virt-df
+tools/virt-edit
+tools/virt-rescue
+++ /dev/null
-# libguestfs virt-rescue
-# 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.
-
-EXTRA_DIST = \
- run-rescue-locally \
- virt-rescue
-
-if HAVE_RESCUE
-
-bin_SCRIPTS = virt-rescue
-man_MANS = virt-rescue.1
-
-noinst_DATA = $(top_builddir)/html/virt-rescue.1.html
-
-virt-rescue.1: virt-rescue
- $(POD2MAN) \
- --section 1 \
- -c "Virtualization Support" \
- --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
- $< > $@-t && mv $@-t $@
-
-$(top_builddir)/html/virt-rescue.1.html: virt-rescue
- mkdir -p $(top_builddir)/html
- cd $(top_builddir) && pod2html \
- --css 'pod.css' \
- --title 'virt-rescue, run a rescue shell on a virtual machine' \
- --htmldir html \
- --outfile html/virt-rescue.1.html \
- rescue/$<
-
-endif
-# libguestfs virt-cat
+# libguestfs virt-* tools
# Copyright (C) 2009 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+tools = cat df edit rescue
+
EXTRA_DIST = \
- run-cat-locally \
- virt-cat
+ run-locally \
+ $(tools:%=virt-%)
+
+if HAVE_TOOLS
-if HAVE_CAT
+bin_SCRIPTS = $(tools:%=virt-%)
-bin_SCRIPTS = virt-cat
-man_MANS = virt-cat.1
+# XXX Bug in automake? If you list virt-cat.1 explicitly, then it
+# builds and installs the man pages. However if this is removed,
+# then the man pages are neither built nor installed.
+man_MANS = virt-cat.1 $(patsubst %,virt-%.1,$(filter-out cat,$(tools)))
-noinst_DATA = $(top_builddir)/html/virt-cat.1.html
+noinst_DATA = $(tools:%=$(top_builddir)/html/virt-%.1.html)
-virt-cat.1: virt-cat
+virt-%.1: virt-%
$(POD2MAN) \
--section 1 \
-c "Virtualization Support" \
--release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
$< > $@-t && mv $@-t $@
-$(top_builddir)/html/virt-cat.1.html: virt-cat
+$(top_builddir)/html/virt-%.1.html: virt-%
mkdir -p $(top_builddir)/html
cd $(top_builddir) && pod2html \
--css 'pod.css' \
- --title 'virt-cat, display a file in a virtual machine' \
--htmldir html \
- --outfile html/virt-cat.1.html \
- cat/$<
+ --outfile html/$<.1.html \
+ tools/$<
endif
#!/usr/bin/perl
-# virt-rescue
# Copyright (C) 2009 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# 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-rescue in
+# This script sets up the environment so you can run virt-* tools in
# place without needing to do 'make install' first. You can also run
-# virt-rescue by creating a symlink to this script and putting it in
+# the tools by creating a symlink to this script and putting it in
# your path.
#
# Use it like this:
-# ./run-rescue-locally [usual virt-rescue args ...]
+# ./run-locally tool [usual virt-tool args ...]
+# eg:
+# ./run-locally cat domname /etc/passwd
use strict;
use warnings;
use Cwd qw(abs_path);
my $path = $0;
+my $tool = shift @ARGV;
# Follow symlinks until we get to the real file
while(-l $path) {
$ENV{LIBGUESTFS_PATH} = $path.'/appliance';
$ENV{PERL5LIB} = $path.'/perl/blib/lib:'.$path.'/perl/blib/arch';
-exec('perl', $path.'/rescue/virt-rescue', @ARGV);
+print (join " ", ("$path/tools/virt-$tool", @ARGV), "\n");
+exec('perl', "$path/tools/virt-$tool", @ARGV);