Commit Graph

69 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
46ed232dc2 New API: guestfs_canonical_device_name.
This API makes device names canonical, eg. /dev/vda1 -> /dev/sda1.
2012-06-13 23:07:26 +01:00
Richard W.M. Jones
88a854cf7f virt-ls: Don't initialize path = NULL. 2012-05-17 17:19:09 +01:00
Richard W.M. Jones
32765e440c virt-ls: Fix --checksum option (RHBZ#822490). 2012-05-17 17:11:16 +01:00
Richard W.M. Jones
7d2027295f filesystems: Implement parents of MD and VG devices (RHBZ#805070). 2012-03-21 12:08:37 +00:00
Richard W.M. Jones
a8f8af950d filesystems: Allow the parents column to contain multiple parents.
A list of parents is passed for this column.

This column is rendered as an (internally) comma-separated list.
2012-03-20 19:38:05 +00:00
Richard W.M. Jones
606732d02e Use O_CLOEXEC / SOCK_CLOEXEC for almost all file descriptors.
The presumption is that all file descriptors should be created with
the close-on-exec flag set.  The only exception are file descriptors
that we want passed through to exec'd subprocesses (mainly pipes and
stdin/stdout/stderr).

For open calls, we pass O_CLOEXEC as an extra flag, eg:

  fd = open ("foo", O_RDONLY|O_CLOEXEC);

This is a Linux-ism, but using a macro we can easily make it portable.

For sockets, similarly:

  sock = socket (..., SOCK_STREAM|SOCK_CLOEXEC, ...);

For accepted sockets, we use the Linux accept4 system call which
allows flags to be supplied, but we use the Gnulib 'accept4' module to
make this portable.

For dup, dup2, we use the Linux dup3 system call, and the Gnulib
modules 'dup3' and 'cloexec'.
2012-03-14 19:30:46 +00: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
cd3d28491d filesystems: Fix memory leak found by valgrind. 2011-11-24 15:51:16 +00:00
Matthew Booth
04ea1375c5 Update FSF address. 2011-11-08 14:43:07 +00:00
Richard W.M. Jones
51672634fd virt-filesystems: Add MBR partition type byte to the output.
This adds an extra column containing this information, looking
like this:

Name       Type        VFS   Label  MBR  Size  Parent
/dev/sda1  filesystem  ntfs  -      -    6.0G  -
/dev/sda1  partition   -     -      07   6.0G  /dev/sda
/dev/sda   device      -     -      -    6.0G  -

In particular you can use this to tell if a partition is an extended
partition, because the field will contain '05' or '0f'.
2011-10-25 14:02:46 +01:00
Richard W.M. Jones
1e891d9007 virt-cat: Handle Windows paths and drive letters (RHBZ#693359). 2011-10-25 10:55:20 +01:00
Richard W.M. Jones
085a566906 cat: Small documentation correction. 2011-08-28 17:35: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
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
42e7ea6840 virt-ls: Add virt-ls -lR option for complex file iteration. 2011-06-04 22:20:05 +01:00
Richard W.M. Jones
bb965ded27 virt-ls: Refactor mode selection code.
This is just code motion.
2011-06-04 18:36:36 +01:00
Richard W.M. Jones
7177340a6f virt-ls: Small fix for output of --help option. 2011-06-04 18:36:36 +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
c49fc3831d doc: Use I<-...> for cross-references to command line options.
This is now used consistently across all the documentation.
2011-05-01 17:43:18 -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
ace1795d10 Add more missing include directives.
* cat/virt-cat.c: Include string.h and libintl.h.
* cat/virt-filesystems.c: Likewise.
* cat/virt-ls.c: Likewise.
2011-04-13 14:25:56 +01:00
Richard W.M. Jones
4de124debf cat, edit: Reference guestfish equivalent commands in the manual pages. 2011-04-05 18:34:35 +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
97339a0f43 virt-filesystems: Ignore errors when getting label and UUID (RHBZ#668112).
If virt-filesystems was pointed to an image that contained
bogus or blank filesystems, then calls to vfs-label and/or vfs-uuid
could fail, resulting in errors like this:

libguestfs: error: vfs_label: /dev/vda1:

These errors can be ignored and shouldn't stop virt-filesystems
from working.
2011-01-08 10:15:39 +00:00
Richard W.M. Jones
b8f9a20b03 New tools: virt-copy-in, virt-copy-out, virt-tar-in, virt-tar-out.
Relatively trivial wrappers around the equivalent guestfish
commands.  Change also includes new man pages.
2011-01-03 18:23:45 +00:00
Richard W.M. Jones
440cd23f54 filesystems: Document the columns in --long output. 2011-01-02 22:55:48 +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
ff99f399f0 cat: Remove some unused local variables in virt-cat.c and virt-ls.c. 2010-12-09 18:30:08 +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
866a6a0fa5 docs: Fix typo in virt-filesystems(1). 2010-11-27 18:43:23 +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
e1aca6323e build: Centralize all POD manipulation in 'podwrapper.sh' script. 2010-11-24 20:12:08 +00:00
Richard W.M. Jones
fa0c588d1e filesystems: Fix command synopsis in usage message.
This updates commit fbc2555903.
2010-11-23 12:06:12 +00:00
Richard W.M. Jones
fbc2555903 New tool: virt-filesystems
This tool replaces virt-list-filesystems and virt-list-partitions with
a new tool written in C with a more uniform command line structure
and output.

This existing Perl tools are deprecated but remain indefinitely.
2010-11-23 10:22:08 +00:00
Richard W.M. Jones
f6d3d56771 ls: Rewrite virt-ls in C. 2010-11-23 09:48:05 +00:00
Richard W.M. Jones
b875f8e115 cat: Fix documentation of -x option in usage.
This updates commit d29e9a552f.
2010-11-22 17:35:36 +00:00
Richard W.M. Jones
730d4db45e cat: Continue after encountering an error. 2010-11-22 13:09:38 +00:00