summaryrefslogtreecommitdiffstats
path: root/rescue
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-03-30 17:03:11 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-03-31 15:42:13 +0100
commitb8e1dee73a1deef1bfd5937e2abfbe9afef7b1ef (patch)
tree2c523527cf6d52c719722c2400df1bcbf6bd3699 /rescue
parent4155d20014b24b2203c4dd8b00e2e19450a7e3bb (diff)
downloadlibguestfs-b8e1dee73a1deef1bfd5937e2abfbe9afef7b1ef.tar.gz
libguestfs-b8e1dee73a1deef1bfd5937e2abfbe9afef7b1ef.tar.xz
libguestfs-b8e1dee73a1deef1bfd5937e2abfbe9afef7b1ef.zip
Add /etc/libguestfs-tools.conf configuration file.
This allows the default for --ro or --rw to be controlled for the three tools guestfish, guestmount and virt-rescue.
Diffstat (limited to 'rescue')
-rw-r--r--rescue/Makefile.am5
-rw-r--r--rescue/virt-rescue.c2
-rwxr-xr-xrescue/virt-rescue.pod23
3 files changed, 27 insertions, 3 deletions
diff --git a/rescue/Makefile.am b/rescue/Makefile.am
index f6f5b258..a4903416 100644
--- a/rescue/Makefile.am
+++ b/rescue/Makefile.am
@@ -1,5 +1,5 @@
# libguestfs virt-rescue
-# Copyright (C) 2010 Red Hat Inc.
+# Copyright (C) 2010-2011 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
@@ -26,6 +26,7 @@ CLEANFILES = stamp-virt-rescue.pod
bin_PROGRAMS = virt-rescue
SHARED_SOURCE_FILES = \
+ ../fish/config.c \
../fish/inspect.c \
../fish/keys.c \
../fish/options.h \
@@ -41,9 +42,11 @@ virt_rescue_CFLAGS = \
-I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
-DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ $(LIBCONFIG_CFLAGS) \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
virt_rescue_LDADD = \
+ $(LIBCONFIG_LIBS) \
$(top_builddir)/src/libguestfs.la \
../gnulib/lib/libgnu.la
diff --git a/rescue/virt-rescue.c b/rescue/virt-rescue.c
index 8341e975..f129b1c8 100644
--- a/rescue/virt-rescue.c
+++ b/rescue/virt-rescue.c
@@ -95,6 +95,8 @@ main (int argc, char *argv[])
bindtextdomain (PACKAGE, LOCALEBASEDIR);
textdomain (PACKAGE);
+ parse_config ();
+
enum { HELP_OPTION = CHAR_MAX + 1 };
static const char *options = "a:c:d:m:rvVx";
diff --git a/rescue/virt-rescue.pod b/rescue/virt-rescue.pod
index 9dbdd5ec..f56acd00 100755
--- a/rescue/virt-rescue.pod
+++ b/rescue/virt-rescue.pod
@@ -167,6 +167,8 @@ The option must always be used if the disk image or virtual machine
might be running, and is generally recommended in cases where you
don't need write access to the disk.
+See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>.
+
=item B<--selinux>
Enable SELinux in the rescue appliance. You should read
@@ -188,7 +190,9 @@ Display version number and exit.
=item B<--rw>
-This option does nothing at the moment.
+This changes the I<-a> and I<-d> options so that disks are
+added and mounts are done read-write.
+
See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>.
=item B<-x>
@@ -261,6 +265,21 @@ have meaning to the shell such as C<#> and space. You may need to
quote or escape these characters on the command line. See the shell
manual page L<sh(1)> for details.
+=head1 FILES
+
+=over 4
+
+=item $HOME/.libguestfs-tools.rc
+
+=item /etc/libguestfs-tools.conf
+
+This configuration file controls the default read-only or read-write
+mode (I<--ro> or I<--rw>).
+
+See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>.
+
+=back
+
=head1 SEE ALSO
L<guestfs(3)>,
@@ -275,7 +294,7 @@ Richard W.M. Jones L<http://people.redhat.com/~rjones/>
=head1 COPYRIGHT
-Copyright (C) 2009-2010 Red Hat Inc.
+Copyright (C) 2009-2011 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