| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
For libvirt guests, the disk format is copied from libvirt (if
libvirt knows it).
For command line disk images, you can use --format to override
format auto-detection.
|
|
|
|
|
|
|
| |
Be more consistent in allowing the user to override use of the
temporary directory by specifying $TMPDIR. Also prefer P_tmpdir
macro (defined in <stdio.h>) if that is defined, rather than
hard-coding "/tmp" for the fallback location.
|
|
|
|
|
| |
This updates commit 8ea62c8d7f3f7f7e4057b93105cf979271aa13f4
so it doesn't try to free the optarg (stack-allocated) strings.
|
|
|
|
|
|
|
|
|
| |
Clear the in-memory history before exiting. This removes
some but not all memory leaks associated with using the GNU
History library. As far as I can tell it is not possible to
free up everything used by GNU History.
(Found by valgrind).
|
|
|
|
|
|
|
|
|
|
| |
Previously the list of -a, -d, -m, -N parameters were leaked. This
change frees them explicitly.
This is not such an important fix since guestfish is a one-shot
program, but it aids in finding other leaks in future.
(Found by valgrind).
|
|
|
|
|
| |
See also:
http://catless.ncl.ac.uk/Risks/26.17.html#subj13.3
|
|
|
|
|
|
| |
The guestfish-only commands such as 'alloc' and 'edit' are
now generated from one place in the generator instead of being
spread around ad-hoc in the C code.
|
|
|
|
|
| |
This corrects commit b5c287bcd456bdb02d8ec0443483df34f4fd6b5d
and commit 639ca1828b167bf59353f0cd3c8c79c6289bbd5d.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The progress bar is updated 3 times per second, and is not displayed
at all for operations which take less than two seconds.
You can disable progress bars by using the flag --no-progress-bars,
and you can enable progress bars in non-interactive sessions with
the flag --progress-bars.
A good way to test this is to use the following command:
guestfish --progress-bars \
-N disk:10G \
zero-device /dev/sda
(adjust "10G" to get different lengths of time).
|
|
|
|
|
|
| |
Provide a generic mechanism within guestfish to detect if
output if UTF-8 and to open the termcap (or terminfo) database
for the current terminal type.
|
|
|
|
|
|
|
|
|
|
|
|
| |
If this string was non-empty, then it broke a lot of things because
autoconf and other parts of the build system were expecting this
string to contain a simple MAJOR.MINOR.RELEASE version number.
This requires changes to guestfish and guestmount so they use the
guestfs_version API to fetch the version from the library. (The
Perl tools were already doing it this way). In a way this is more
accurate, because it's no longer hard-coded in the binary, but
fetched from the dynamically linked libguestfs.so.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't shell out to virt-inspector. Instead, use the new C-based
inspection APIs.
This is much faster.
The new syntax is slightly different:
guestfish -a disk.img -i
guestfish -d guest -i
However, the old syntax still works.
|
|
|
|
|
|
|
|
| |
The -d option lets you specify libvirt domains. The disks from
these domains are found and added, as if you'd named them with -a.
The -c option lets you specify a libvirt URI, which is needed
when we consult libvirt to implement the above.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a 'Key' parameter type, used for passing sensitive key material
into libguestfs.
Eventually the plan is to mlock() key material into memory. However
this is very difficult to achieve because the encoded XDR strings
end up in many places. Therefore users should note that key material
passed to libguestfs might end up in swap.
The only difference between 'Key' and 'String' currently is that
guestfish requests the key from /dev/tty with echoing turned off.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Testing this against a Fedora disk image:
$ ./fish/guestfish --ro -a F13.img -m /dev/sda1 --listen
export GUESTFISH_PID=6033
$ ./fish/guestfish --remote=6033 -- ping-daemon
$ ./fish/guestfish --remote=6033 -- ping-daemon
$ ./fish/guestfish --remote=6033 -- exit
Without this fix the first remote command would fail because
qemu would have already been killed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change, the exit status indicates error for non-existent
commands.
$ guestfish -h foo
foo: command not known, use -h to list all commands
$ echo $?
1
$ guestfish help foo
foo: command not known, use -h to list all commands
$ echo $?
1
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This checks all available optional groups and prints out which
ones are supported by the daemon. Note you must launch the appliance
first.
Example:
><fs> supported
augeas yes
inotify yes
linuxfsuuid yes
linuxmodules yes
linuxxattrs yes
lvm2 yes
mknod yes
ntfs3g yes
ntfsprogs yes
realpath yes
scrub yes
selinux yes
xz yes
zerofree yes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This small change uses the gnulib xstrtoll functionality to
enable suffixes on integer parameters in guestfish. For example:
truncate-size /file 1G
(previously you would have had to given the full number).
This also applies to the 'alloc' and 'sparse' commands (and
indirectly to the -N option). The specification for these commands
has changed slightly, in that 'alloc foo 1MB' would now use SI
units, allocating 1000000 bytes instead of a true megabyte. All
existing uses would use 'alloc foo 1M' which still allocates true
megabytes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The guestfs_write call can be used to create small files with
arbitrary 8 bit content, including \0 bytes.
This replaces and deprecates write-file, which cannot be modified
to use BufferIn because of an unfortunate choice in the ABI: the
size parameter to write-file, if zero, means that the daemon tries
to calculate the length of the buffer using strlen. However this
fails if we pass a zero-length buffer using BufferIn because then
the daemon tries to do strlen on a (really) zero length buffer, not
even containing a terminating \0 character, thus segfaulting.
|
|
|
|
|
|
| |
fish.c:1447: error: 'add_history_line' defined but not used [-Wunused-function]
(Reported by Matt Booth)
|
|
|
|
|
| |
Amend commit 1c6ed48bd3cd471dc so the prototype of
'print_shell_quote' function is correct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(RHBZ#507810).
This commit fixes a long-standing bug which prevented guestfish -i
and virt-inspector from working on disk images which had a space
in the filename (or other unsafe characters). It works by ensuring
that the strings passed between guestfish -i and virt-inspector are
quoted correctly in both directions.
Note that this commit adds a dependency from virt-inspector to
the perl module String::ShellQuote. We have previously used this
module in virt-make-fs.
|
| |
|
|
|
|
| |
This reverts commit 01fedcde05c930c1413e9fe0909fa1da1f360cdf.
|
| |
|
|
|
|
|
|
| |
This commit makes the launch function static and private to
'fish.c', and changes the generator so the function is no longer
called for the 'run/launch' command.
|
|
|
|
|
|
| |
Previously we had separate code paths for echoing commands (-x)
and tracing (guestfs_set_trace). This just unifies that so that
the guestfish -x option enables tracing.
|
| |
|
|
|
|
|
| |
This fixes a segfault in the guestfish -a option which you would
get when using guestfish 1.3.6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously you might have typed:
$ guestfish
><fs> alloc test1.img 100M
><fs> run
><fs> part-disk /dev/sda mbr
><fs> mkfs ext4 /dev/sda1
now you can do the same with:
$ guestfish -N fs:ext4
Some tests have also been updated to use this new
functionality.
|
|
|
|
|
|
|
|
|
|
|
|
| |
For example:
><fs> upload -<<END /foo
some data
some more data
END
><fs> cat /foo
some data
some more data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow -cmd on the command line to mean that normal exit on error
behaviour is overridden, ie. we will not exit.
This allows you to do:
guestfish -- command : -command : command
with the second command allowing errors. (Note that '--' is required
to stop getopt parsing -command as an option).
Also this fixes the remote case which is what the original
bug report was about.
|
|
|
|
|
|
|
|
| |
$ guestfish /tmp/disk.img
/tmp/disk.img: unknown command
Did you mean to open a disk image? guestfish -a disk.img
For a list of commands: guestfish -h
For complete documentation: man guestfish
|
| |
|
|
|
|
|
| |
OS X has an older version of readline with some differences
in the names of functions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
guestfs_mount adds -o sync implicitly. This causes a very large
performance problem for write-intensive programs (eg. virt-v2v).
Document this as a "gotcha".
Change the tests, guestfish, Sys::Guestfs::Lib, guestmount to use
mount-options instead.
(Note that this gotcha does not affect mount-ro).
The source of the performance problem was first identified by
Matthew Booth.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds the calls to setlocale &c to all of the current
C programs.
It also adds l10n support to hivexget and hivexml which lacked them
previously.
To test this, try:
LANG=pa_IN.UTF-8 guestfish --cmd-help
(You can only do this test after installing the package, or at
least the 'pa.mo' mo-file in the correct place).
|
|
|
|
|
|
|
|
|
|
| |
Convert by running these commands:
perl -pi -e 's/\b(usage ?)\(1\)/$1(EXIT_FAILURE)/' \
fish/fish.c fuse/guestmount.c
perl -pi -e 's/\b(usage ?)\(0\)/$1(EXIT_SUCCESS)/' \
fish/fish.c fuse/guestmount.c
* fish/fish.c (main): Replace 0/1 with EXIT_SUCCESS/EXIT_FAILURE.
* fuse/guestmount.c (main): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert all uses automatically, via these two commands:
git grep -l '\<exit *(1)' \
| grep -vEf .x-sc_prohibit_magic_number_exit \
| xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(1\)/$1(EXIT_FAILURE)/'
git grep -l '\<exit *(0)' \
| grep -vEf .x-sc_prohibit_magic_number_exit \
| xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(0\)/$1(EXIT_SUCCESS)/'
* .x-sc_prohibit_magic_number_exit: New file.
Edit (RWMJ): Don't change Java code.
|
|
|
|
|
|
| |
Display this output like a short manual page.
Don't put <..> around the parameters to the command.
|
|
|
|
|
| |
git grep -l 'strncasecmp *([^=]*== *0'|xargs \
perl -pi -e 's/\bstrncasecmp( *\(.*?\)) *== *0\b/STRCASEEQLEN$1/g'
|
|
|
|
|
| |
git grep -l 'strncasecmp *([^=]*!= *0'|xargs \
perl -pi -e 's/\bstrncasecmp( *\(.*?\)) *!= *0\b/STRCASENEQLEN$1/g'
|