142 Commits

Author SHA1 Message Date
Richard W.M. Jones
5a2e320ec9 configure: Add --enable-code-profiling and --enable-code-coverage flags.
These configure flags enable code profiling (with gprof) and code
coverage (with gcov) respectively.

Although this is a nice idea, it's not currently very useful.

Libtool mangles filenames in such a way that gcov cannot locate its
datafiles.

Profiling is of dubious utility with libguestfs which is not CPU-bound
and relies extensively on running external programs (oprofile-like
system profiling that took into account libguestfs + qemu or
libguestfs + qemu + the appliance + filesystem tools *would* be
useful).

Also neither flag will help in capturing data from the appliance.
2012-12-04 14:11:14 +00:00
Wanlong Gao
f7f746a98e remove the useless "h" option
"h" option is not enabled in virt-cat, remove it.

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
2012-09-26 10:26:01 +01:00
Richard W.M. Jones
05beac65e5 rescue: Add an expect-driven test for the virt-rescue command.
This command was not tested at all.  As a result we didn't notice that
it was broken for a long time (RHBZ#853159).

This adds a test that drives the command through a pty.  It uses the
perl 'Expect' module, although this is not required.
2012-09-04 14:43:26 +01:00
Richard W.M. Jones
2e36adf83c rescue: If attach-method is 'libvirt', force it to be 'appliance'.
The libvirt backend currently doesn't support direct mode.  We should
make that work in future.  As a workaround, force the attach-method to
be 'appliance' in this case.
2012-09-04 12:04:31 +01:00
Richard W.M. Jones
6fdf1f40fa rescue: If -v / debugging enabled, don't mask error messages.
We set the error handler to NULL in order to mask "normal" error
messages that we expect to see because of the unusual way that
virt-rescue runs the appliance.  However if the user selected -v /
enabled debugging, then it is reasonable to expect they want to see
every message, so do not mask anything.
2012-09-04 11:56:20 +01:00
Richard W.M. Jones
2f97bf873b podwrapper: Add --license parameter, which is required.
This adds standard LICENSE and BUGS sections to all of the man pages
that are processed by podwrapper.

Modify all the calls to $(PODWRAPPER) to add the right --license
parameter according to the content.  Note that this relaxes the
license on some code example pages, making them effectively BSD-style
licensed.
2012-08-21 20:33:21 +01:00
Richard W.M. Jones
f1d98bbc79 man pages: Ensure consistent copyright/author sections, remove license
section.

Ensure each man page contains consistent COPYRIGHT and AUTHOR
sections.

Remove the LICENSE section.  We will add that back in podwrapper in a
later commit.
2012-08-21 20:16:29 +01:00
Richard W.M. Jones
6054051a9d fish: Rename fish/virt.c to fish/domain.c
This file handles the -d option for guestfish and other C command line
utilities.  Renaming this file makes it less confusing.
2012-07-19 16:11:26 +01:00
Richard W.M. Jones
f2ea617e22 build: Change calls to podwrapper.sh to use $(PODWRAPPER).
This will allow us to easily change the location of this
script in future.
2012-07-16 18:56:57 +01:00
Richard W.M. Jones
ffbf1475f7 New API: guestfs_shutdown: Cleanly shutdown the backend.
The new API splits orderly close into a two-step process:

  if (guestfs_shutdown (g) == -1) {
    /* handle the error, eg. qemu error */
  }
  guestfs_close (g);

Note that the explicit shutdown step is only necessary in the case
where you have made changes to the disk image and want to handle write
errors.  Read the documentation for further information.

This change also:

 - deprecates guestfs_kill_subprocess

 - turns guestfs_kill_subprocess into the same as guestfs_shutdown

 - changes guestfish and other tools to call shutdown + close
   where necessary (not for read-only tools)

 - updates documentation

 - updates examples
2012-07-03 21:27:29 +01:00
Richard W.M. Jones
8cb30dc805 rescue: Add --scratch option.
This lets you create temporary scratch disks.
2012-04-26 12:56:34 +01:00
Richard W.M. Jones
08840bab44 Tempus fugit.
Update all copyright dates to 2012.
2012-01-18 22:05:02 +00:00
Richard W.M. Jones
dd0707be5f fish options parsing: Allow add_drives to be called multiple times.
Ensure that the drv structure is always zeroed on allocation.

Don't leak old drv->device when add_drives is called multiple times.
2012-01-18 16:28:10 +00:00
Matthew Booth
04ea1375c5 Update FSF address. 2011-11-08 14:43:07 +00:00
Richard W.M. Jones
0257e27e17 rescue: Add --suggest option to suggest mount commands. 2011-11-01 09:58:29 +00:00
Richard W.M. Jones
04fbcc63eb New API: set-smp, get-smp
These calls allow you to change the number of virtual CPUs assigned to
the appliance.

This also adds a --smp option to virt-rescue.
2011-09-28 14:52:56 +01:00
Richard W.M. Jones
00fef9eed6 rescue: Ignore errno after guestfs_launch.
errno is pretty much random on the error path back from guestfs_launch
so there is nothing useful to be gained by checking it.

We could do with a better way to detect if appliance launch failed.
2011-08-23 16:41:07 +01:00
Richard W.M. Jones
9bab154d48 Coverity: Ignore return value from guestfs_launch in virt-rescue.
We expect guestfs_launch to fail in this program.
2011-08-23 16:34:06 +01:00
Hilko Bengen
ff101adf7e out-of-tree build: fix documentation generation 2011-08-15 14:50:33 +01:00
Richard W.M. Jones
34acb80a28 Enable deprecation warnings on all C programs. 2011-05-17 17:05:12 +01:00
Richard W.M. Jones
87fb6d852d fish: Allow -d UUID (specify libvirt domains by UUID).
This applies in all the commands which use the common C option parsing
code, ie:

* guestfish
* guestmount
* virt-cat
* virt-df
* virt-filesystems
* virt-inspector
* virt-ls
* virt-rescue
2011-05-06 13:04:19 -04:00
Richard W.M. Jones
5790f5bfaf Remove ad-hoc run*locally scripts, replace with './run'
Remove all the run*locally scripts and replace with a single top level
./run shell script.
2011-04-16 08:32:44 +01:00
Jim Meyering
6740028b33 Include string.h and libintl.h, as needed.
* df/df.c: As above.
* df/main.c: As above.
* df/output.c: As above.
* fuse/guestmount.c: As above.
* inspector/virt-inspector.c: As above.
* rescue/virt-rescue.c: As above.
2011-04-13 14:26:06 +01:00
Richard W.M. Jones
b8e1dee73a 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.
2011-03-31 15:42:13 +01:00
Richard W.M. Jones
4155d20014 rescue: Add -w|--rw option. 2011-03-30 16:33:14 +01:00
Richard W.M. Jones
a9d6b948b5 Include <locale.h> in compilation units that use setlocale function.
Fix required by gcc 4.6.0.
2011-03-07 19:30:31 +00:00
Richard W.M. Jones
a20e5c00c3 fish: Add guestfish --live, guestmount --live options.
The other programs have the variable, but the flag is not enabled
either because it doesn't make sense or because the implications are
not well understood.
2011-02-03 18:50:45 +00:00
Richard W.M. Jones
d72815578f Remove several unused local variables.
(Revealed by compiling under Debian where this is a warning).
2010-12-10 12:19:49 +00:00
Richard W.M. Jones
f3805e2166 rescue: Add notes about networking.
In particular the 'ping' command does not work because it is
using QEMU user networking.
2010-12-08 12:12:08 +00:00
Richard W.M. Jones
c5747bd436 rescue: Add note about using virt-rescue as root/non-root. 2010-12-08 12:11:53 +00:00
Richard W.M. Jones
9bc15f5d98 Remove ability to build static distribution.
We are now going to build binaries for each distribution so
there is no need to build the quasi-distro-independent static
binaries any more.
2010-12-06 18:17:30 +00:00
Richard W.M. Jones
94e1465129 docs: Remove ref to L</add-drive-opts> wrongly copied into some man pages. 2010-11-27 18:39:35 +00:00
Richard W.M. Jones
a6054bf90f rescue: Rewrite virt-rescue in C. 2010-11-26 15:12:25 +00:00
Richard Jones
945b6e0a08 Move virt tools (virt-cat, virt-edit etc) into tools/ subdirectory.
This moves the tool programs into a single directory:
  cat/* -> tools/virt-cat
  df/* -> tools/virt-df
  edit/* -> tools/virt-edit
  rescue/* -> tools/virt-rescue

This in itself simplifies the build process because we only need
one Makefile and one copy of 'run-locally'.

'run-*-locally' has become just 'run-locally' and takes an extra
parameter which is the name of the tool, eg:
  run-locally cat [virt-cat params...]

virt-inspector stays in its own directory, because this contains
more than just a single Perl script.
2009-10-19 10:18:46 +01:00
Richard Jones
5d01670e31 run-*-locally: The programs are now virt-[tool], not virt-[tool].pl
This fixes commit b488436cc5.
2009-10-01 15:22:12 +01:00
Jim Meyering
dc0c80b388 maint: use spaces, not TABs for indentation
"make syntax-check" was failing.  This fixes it.
* HACKING: Indent with spaces, not TABs.
* configure.ac: Likewise.
* rescue/virt-rescue: Likewise.
* src/generator.ml: Likewise.
2009-09-24 10:59:53 +02:00
Richard Jones
406d4aea4d Include virt tools in EXTRA_DIST.
Partially revert b488436cc5.
It turns out that automake doesn't automatically place bin_SCRIPTS
in EXTRA_DIST.
2009-09-23 14:03:05 +01:00
Richard Jones
b488436cc5 Rename virt-[tool].pl as virt-[tool] 2009-09-23 12:37:26 +01:00
Richard Jones
75b6338da3 Check return value from readlink. 2009-09-23 12:09:26 +01:00
Richard Jones
9adddc19e4 Create manpage atomically.
Don't fail with a partial file if disk full, etc.
2009-09-23 12:05:55 +01:00
Richard Jones
154370c0e8 Replace @...@ with $(...) in these common Makefile.am files. 2009-09-23 12:04:25 +01:00
Richard Jones
1b21ed4f5d Add 'virt-rescue' command.
This command runs a "rescue appliance" against a virtual machine
or disk image.  This is useful for making ad-hoc interactive
changes to virtual machines.

  $ virt-rescue --ro /dev/vg_trick/F11x64

  Welcome to virt-rescue, the libguestfs rescue shell.

  Note: The contents of / are the rescue appliance.
  You have to mount the guest's partitions under /sysroot
  before you will be able to examine them.

  bash: cannot set terminal process group (-1): Inappropriate ioctl for device
  bash: no job control in this shell
  ><rescue> mount /dev/vg_f11x64/lv_root /sysroot
  EXT4-fs (dm-0): barriers enabled
  kjournald2 starting: pid 269, dev dm-0:8, commit interval 5 seconds
  EXT4-fs (dm-0): internal journal on dm-0:8
  EXT4-fs (dm-0): delayed allocation enabled
  EXT4-fs: file extents enabled
  EXT4-fs: mballoc enabled
  EXT4-fs (dm-0): mounted filesystem with ordered data mode
  ><rescue> ls /sysroot/
  bin   dev  home  lib64       media  opt   root  selinux  sys  usr
  boot  etc  lib   lost+found  mnt    proc  sbin  srv      tmp  var
  ><rescue> exit
2009-09-23 11:18:45 +01:00