| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This is just code motion.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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'.
|
|
|
|
|
| |
Analyze all uses of 'int' in the code, and replace with 'size_t' where
appropriate.
|
|
|
|
|
| |
Return to the main program ('fish.c') and perform global cleanups when
the guestfish remote server exits.
|
|
|
|
|
|
|
|
| |
Add 'event', 'list-events' and 'delete-event' commands so that event
handlers can be registered, listed and deleted in guestfish. The
event handler is a shell script snippet or host command.
Cc: Pádraig Brady <P@draigBrady.com>
|
|
|
|
| |
This library could now be called from other virt tools.
|
|
|
|
|
| |
Calls to these functions are generated, so there is no need to declare
the functions by hand.
|
|
|
|
|
| |
eg:
*stdin*:37: libguestfs: error: luks_close: Device lukstest is busy.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This API allows more than one callback to be registered for each
event, makes it possible to call the API from other languages, and
allows [nearly all] log, debug and trace messages to be rerouted from
stderr.
An older version of this API was discussed on the mailing list here:
https://www.redhat.com/archives/libguestfs/2010-December/msg00081.html
https://www.redhat.com/archives/libguestfs/2011-January/msg00012.html
This also updates guestfish to use the new API for its progress bars.
|
|
|
|
|
|
| |
Note that 'time' and 'glob' (which both run subcommands) do not
correctly pass the exit_on_error flag in the remote case. This is not
a regression: the current code doesn't work either.
|
|
|
|
|
|
|
| |
This removes the dependency from guestfish to the external
pod2text program (and hence the final dependency on perl for
guestfish). This is done by storing the formatted pod2text
output in guestfish as the help text.
|
|
|
|
| |
(Thanks Eric Blake).
|
|
|
|
|
|
|
|
|
|
|
| |
This feature is also available in guestmount because of the
shared option parsing code.
You don't need to do anything to enable it, just using -i
will attempt decryption of encrypted partitions.
Only works for simple Fedora whole-disk encryption. It's a
work-in-progress to make it work for other types of encryption.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In guestfish, factor out the processing of the options -a, -c,
-d, -i, -m, -n, -r, -v, -V, -x into a separate set of files:
options.c, options.h, inspect.c, virt.c.
Change guestmount so that it uses these same files (from the
../fish directory) to process the same options.
This unifies the handling of these options between the two programs.
It also adds the useful inspection feature to guestmount, so you
can now do:
guestmount -d Guest -i --ro mnt/
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
| |
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 commit shouldn't change the semantics of the code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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 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
|
|
|
|
|
| |
I also rechecked the list of built-in commands against
the actual commands to make sure no others were omitted.
|
|
|
|
|
|
|
|
| |
$ 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
|
|
|
|
|
| |
These are missing on Mac OS X. I think you would need to install
a gettext package to get these.
|
|
|
|
|
| |
Move these to private header file(s) and other places as required
since these aren't part of the public API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With sparse you can make sparse files, which is fun because you
can experiment with really large devices:
><fs> sparse /tmp/test.img 100G
><fs> run
><fs> sfdiskM /dev/vda ,
><fs> mkfs ext2 /dev/vda1 # very long pause here ...
><fs> mount /dev/vda1 /
To see the real (ie. allocated) size of the sparse file, use the du
command, eg:
><fs> !du -h /tmp/test.img
1.6G -rw-rw-r-- 1 rjones rjones 100G 2009-11-04 17:40 /tmp/test.img
|
|
|
|
|
|
|
| |
Add a win: prefix for path arguments in guestfish:
><fs> file win:c:\windows\system32\config\system.log
MS Windows registry file, NT/2000 or above
|
|
|
|
|
| |
* fish/fish.c (main): Cast-away-const.
* fish/fish.h (bad_cast): Define. Safer than using an actual cast.
|
|
|
|
|
| |
* fish/rc.c (UNIX_PATH_MAX): Remove unused definition.
* fish/fish.h (rc_listen): Declare with __attribute__((noreturn)).
|
|
|
|
|
|
| |
Also, ...
* src/generator.ml: Add DeviceList type, and propagate that change
out to all calling/interface code.
|
|
|
|
|
|
|
|
|
|
|
| |
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 : $_'
|
|
|
|
|
| |
However this doesn't yet attempt to translate the POD
command documentation. We need a plan to do that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds tilde expansion for local users in guestfish:
><fs> echo "~"
~
><fs> echo ~
/home/rjones
><fs> echo ~foo
~foo
><fs> echo ~rjones/bar
/home/rjones/bar
><fs> echo ~roo
~roo
><fs> echo ~root/foo
/root/foo
><fs> echo ~root
/root
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The use case is to have a long-running guestfish process in
a shell script, and thus to avoid the overhead of starting
guestfish each time. Do:
eval `guestfish --listen`
guestfish --remote somecmd
guestfish --remote someothercmd
guestfish --remote exit
This patch also supports having multiple guestfish processes
at the same time.
The protocol is simple XDR messages over a Unix domain socket.
|