Commit Graph

55 Commits

Author SHA1 Message Date
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
927ef14c58 run: Set MALLOC_PERTURB_ to a random value.
MALLOC_PERTURB_ is a glibc feature which causes malloc to wipe memory
before and after it is used, allowing both use-after-free and
uninitialized reads to be detected with relatively little performance
penalty:

  http://udrepper.livejournal.com/11429.html?nojs=1

Modify the ./run script so that it always sets this.

We were already using MALLOC_PERTURB_ in most tests.  Since ./run is
now setting this, we can remove it from individual Makefiles.  Most
TESTS_ENVIRONMENT will now simply look like this:

  TESTS_ENVIRONMENT = $(top_builddir)/run --test
2012-06-28 13:19:39 +01:00
Richard W.M. Jones
05d4e07918 tests: Add ./run --test option.
This option, when added via
  TESTS_ENVIRONMENT = [...] $(top_builddir)/run --test
allows us to run the tests and only print the full output (including
debugging etc) when the test fails.
2012-06-26 23:34:30 +01:00
Richard W.M. Jones
8735e92a1d virt-df: Use guestfs_max_disks instead of hard-coding limit of 25.
And comprehensively fix it so it works with > 26 disks.
2012-06-13 23:07:26 +01:00
Richard W.M. Jones
e0f36898cb virt-df: Don't fail immediately if a disk is not accessible (RHBZ#789504). 2012-05-03 15:38:08 +01:00
Richard W.M. Jones
9e2cdd309b virt-alignment-scan, virt-df: Add newlines after error messages. 2012-05-03 15:23:14 +01:00
Richard W.M. Jones
6aa95e87c1 Remove "convenience header" "gettext.h" and use <libintl.h> instead.
gettextize provides a local file called "gettext.h".  Remove this and
use <libintl.h> from glibc headers instead.

Most of this change is mechanical: #include <libintl.h> in every C
file which uses any gettext function.  But also we remove the
gettext.h file, and adjust the "_" macros.

Note that this effectively removes the ./configure --disable-nls
option, although we don't know if that ever worked.
2012-05-01 08:57:55 +01:00
Richard W.M. Jones
5d6a323b93 Check library still compiles without libvirt. 2012-04-18 14:25:15 +01:00
Richard W.M. Jones
f1d10672c7 df: Avoid a compilation error if libxml2 is not available.
virt_df-domains.o: In function `add_domain':
/home/feeliwood/Downloads/libguestfs-1.17.21/df/domains.c:274: undefined reference to `guestfs___for_each_disk'

guestfs___for_each_disk is only available when libvirt _and_ libxml2
dependencies are available at compile time.

Thanks Tho Huynh.
2012-03-25 19:35:43 +01:00
Hilko Bengen
b6e0552ee5 Do not run appliance-related checks if not building appliance 2012-01-23 09:08:33 +00:00
Hilko Bengen
7004fafc69 Replace setting of environment variables with usage of local run script
(Includes fix by RWMJ)
2012-01-23 09:08:21 +00: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
Richard W.M. Jones
cd077b8229 tests: Split images -> tests/data + tests/guests 2011-12-22 15:48:11 +00:00
Richard W.M. Jones
9b102aae65 Don't rely on implicit promotion of float to double in printf args. 2011-11-22 16:41:48 +00:00
Richard W.M. Jones
7b3137e664 df, testing: Add notes on virt-df numbers (thanks Kashyap Chamarthy). 2011-11-22 13:21:17 +00:00
Richard W.M. Jones
6e6b3ff35f df: Disable part of virt-df test.
See:
https://www.redhat.com/archives/libguestfs/2011-November/msg00051.html
2011-11-11 17:30:04 +00:00
Matthew Booth
04ea1375c5 Update FSF address. 2011-11-08 14:43:07 +00:00
Richard W.M. Jones
163f7df845 libvirt: Detect if a disk has the <readonly/> flag.
This changes the private function guestfs___for_each_disk so that the
<readonly/> flag on libvirt disks is detected and passed through to
the callback function.
2011-10-26 17:47:34 +01:00
Richard W.M. Jones
f0f3e16211 man pages: Add a standard EXIT STATUS section to most pages. 2011-08-27 17:47:10 +01:00
Hilko Bengen
ff101adf7e out-of-tree build: fix documentation generation 2011-08-15 14:50:33 +01:00
Richard W.M. Jones
f7d18c84dd build: Set TMPDIR for local testing.
This avoids conflicts with the globally installed libguestfs
appliance, or lets us build in multiple local directories at the same
time without conflicts.
2011-08-08 12:41:54 +01:00
Richard W.M. Jones
01f6bce19d virt-df: Re-add documentation for --csv option.
The documentation for the --csv option disappeared between 1.6 and 1.8
when we rewrote virt-df in C.  Re-add it from 1.6 sources.
2011-07-26 12:48:59 +01:00
Richard W.M. Jones
a711777bed docs: Separate out combined =item 's in man pages.
Turn:

 =item B<-a> | B<--all>

into:

 =item B<-a>

 =item B<--all>

This gives a more natural-looking manual page, as well as making it
easier to directly link to these sections.
2011-07-16 15:20:29 +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
988a878464 df: Refresh virt-df(1) man page.
Add examples.

Refresh description.

Use I<...> to refer to command line options.
2011-05-01 14:53:23 -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
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
e5220b26f5 df: Skip final '/' character when calculating basename.
Previously it was including the final '/' character when calculating
the basename for the -a option eg:

Filesystem                                Size       Used  Available  Use%
/Ubuntu1010x64:/dev/sda1                  9.4G       2.3G       6.6G   25%

With this patch the '/' is not printed.
2011-01-11 13:55:23 +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
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
fdc8805362 df: Fix segfault when using virt-df -a filename
If 'filename' doesn't contain a '/' character then virt-df
was calculating NULL as the basename and later segfaulting.
2010-11-30 16:52:48 +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
18de192b0a df: Missing direct dependency on libvirt.
virt-df has an (optional) direct dependency on libvirt.  Because of
libtool's over-linking behaviour this was being missed.
2010-11-26 16:51:01 +00:00
Richard W.M. Jones
18374b5b7d df: Rewrite virt-df in C.
I have diffed the output from the original virt-df with this
new version, and they agree very closely.  Some differences:

 - Old virt-df have a divide-by-zero error in cases where the
   number of used inodes was 0.  New virt-df fixes this.

 - New virt-df uses gnulib human_readable library which displays
   numbers to 3 significant figures for -h output (old version
   used an ad hoc function).
2010-11-25 18:58:13 +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
Richard Jones
f8a96c6596 virt-df: Add note about parsing CSV. 2009-09-24 11:22:37 +01: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
8869adf1e8 Remove guestfs_wait_ready (turn it into a no-op).
This commit changes guestfs_launch so that it both launches
the appliance and waits until it is ready (ie. the daemon communicates
back to us).

Since we removed the pretence that we could implement a low-level
asynchronous API, the need to call launch() followed by wait_ready()
has looked a bit silly.

Now guestfs_wait_ready() is basically a no-op.  It is left in the
API for backwards compatibility.  Any calls to guestfs_wait_ready()
can be removed from client code.
2009-09-21 12:01:51 +01:00
Jim Meyering
2f1a50d816 Convert all TABs-as-indentation to spaces.
Do it by running this command:
[exempted files are matched via .x-sc_TAB_in_indentation]

  git ls-files \
    | pcregrep -vf .x-sc_TAB_in_indentation \
    | xargs pcregrep -l '^ *\t' \
    | xargs perl -MText::Tabs -ni -le \
      '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
2009-08-03 17:17:57 +02:00