summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--HACKING18
-rw-r--r--Makefile.am17
-rwxr-xr-xcat/run-cat-locally52
-rw-r--r--configure.ac25
-rw-r--r--df/Makefile.am45
-rwxr-xr-xdf/run-df-locally52
-rw-r--r--edit/Makefile.am45
-rwxr-xr-xedit/run-edit-locally52
-rw-r--r--po/POTFILES.in8
-rw-r--r--rescue/Makefile.am45
-rw-r--r--tools/Makefile.am (renamed from cat/Makefile.am)29
-rwxr-xr-xtools/run-locally (renamed from rescue/run-rescue-locally)13
-rwxr-xr-xtools/virt-cat (renamed from cat/virt-cat)0
-rwxr-xr-xtools/virt-df (renamed from df/virt-df)0
-rwxr-xr-xtools/virt-edit (renamed from edit/virt-edit)0
-rwxr-xr-xtools/virt-rescue (renamed from rescue/virt-rescue)0
17 files changed, 46 insertions, 360 deletions
diff --git a/.gitignore b/.gitignore
index 508f13a7..4467a63c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,7 +23,6 @@ capitests/test*.img
capitests/tests
capitests/tests.c
capitests/test*.tmp
-cat/virt-cat.1
ChangeLog
*.class
*.cma
@@ -47,8 +46,6 @@ daemon/names.c
daemon/stubs.c
depcomp
.deps
-df/virt-df.1
-edit/virt-edit.1
emptydisk
examples/hello
examples/to-xml
@@ -179,7 +176,6 @@ python/guestfs.py
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
@@ -201,6 +197,7 @@ stamp-h1
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
diff --git a/HACKING b/HACKING
index bdb82871..ca5b9a97 100644
--- a/HACKING
+++ b/HACKING
@@ -68,9 +68,6 @@ Directories
appliance/
The qemu appliance, build scripts and so on.
-cat/
- The virt-cat tool.
-
capitests/
Automated tests of the C API.
@@ -80,12 +77,6 @@ contrib/
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.
@@ -125,12 +116,15 @@ python/
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.
diff --git a/Makefile.am b/Makefile.am
index c4a84f78..73d4f63b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,9 +26,14 @@ SUBDIRS = gnulib/lib src daemon appliance fish po examples images \
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
@@ -44,18 +49,6 @@ 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 \
diff --git a/cat/run-cat-locally b/cat/run-cat-locally
deleted file mode 100755
index 7c31aaf9..00000000
--- a/cat/run-cat-locally
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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);
diff --git a/configure.ac b/configure.ac
index 2d4cd33c..ab425612 100644
--- a/configure.ac
+++ b/configure.ac
@@ -675,18 +675,12 @@ for pm in Pod::Usage Getopt::Long Sys::Virt Data::Dumper XML::Writer Locale::Tex
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.
@@ -723,11 +717,8 @@ AC_CONFIG_FILES([Makefile
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
@@ -755,16 +746,10 @@ 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-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'"
diff --git a/df/Makefile.am b/df/Makefile.am
deleted file mode 100644
index f333f973..00000000
--- a/df/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-# 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
diff --git a/df/run-df-locally b/df/run-df-locally
deleted file mode 100755
index 94697b0c..00000000
--- a/df/run-df-locally
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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);
diff --git a/edit/Makefile.am b/edit/Makefile.am
deleted file mode 100644
index 6afdd628..00000000
--- a/edit/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-# 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
diff --git a/edit/run-edit-locally b/edit/run-edit-locally
deleted file mode 100755
index 127463fb..00000000
--- a/edit/run-edit-locally
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 7ccadcf3..b99493b4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,4 +1,3 @@
-cat/virt-cat
daemon/augeas.c
daemon/blockdev.c
daemon/checksum.c
@@ -55,8 +54,6 @@ daemon/wc.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
@@ -81,10 +78,13 @@ perl/lib/Sys/Guestfs.pm
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
diff --git a/rescue/Makefile.am b/rescue/Makefile.am
deleted file mode 100644
index b532e258..00000000
--- a/rescue/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-# 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
diff --git a/cat/Makefile.am b/tools/Makefile.am
index 6b9a1bbd..d5fc23c2 100644
--- a/cat/Makefile.am
+++ b/tools/Makefile.am
@@ -1,4 +1,4 @@
-# libguestfs virt-cat
+# libguestfs virt-* tools
# Copyright (C) 2009 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -15,31 +15,36 @@
# 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
diff --git a/rescue/run-rescue-locally b/tools/run-locally
index 18097cf9..0bf1c0a7 100755
--- a/rescue/run-rescue-locally
+++ b/tools/run-locally
@@ -1,5 +1,4 @@
#!/usr/bin/perl
-# virt-rescue
# Copyright (C) 2009 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
@@ -16,13 +15,15 @@
# 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;
@@ -32,6 +33,7 @@ use File::Spec;
use Cwd qw(abs_path);
my $path = $0;
+my $tool = shift @ARGV;
# Follow symlinks until we get to the real file
while(-l $path) {
@@ -50,4 +52,5 @@ $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.'/rescue/virt-rescue', @ARGV);
+print (join " ", ("$path/tools/virt-$tool", @ARGV), "\n");
+exec('perl', "$path/tools/virt-$tool", @ARGV);
diff --git a/cat/virt-cat b/tools/virt-cat
index 329ba6e3..329ba6e3 100755
--- a/cat/virt-cat
+++ b/tools/virt-cat
diff --git a/df/virt-df b/tools/virt-df
index 78eb25c9..78eb25c9 100755
--- a/df/virt-df
+++ b/tools/virt-df
diff --git a/edit/virt-edit b/tools/virt-edit
index 46e86a17..46e86a17 100755
--- a/edit/virt-edit
+++ b/tools/virt-edit
diff --git a/rescue/virt-rescue b/tools/virt-rescue
index 9ad2fa4f..9ad2fa4f 100755
--- a/rescue/virt-rescue
+++ b/tools/virt-rescue