summaryrefslogtreecommitdiffstats
path: root/fish
Commit message (Collapse)AuthorAgeFilesLines
* Rename global 'xdr_str'.Richard Jones2010-08-261-2/+2
| | | | | | | | Two bits of XDR both contained a definition called 'str' which means that 'xdr_str' was being exported globally twice. Because of the linker script this didn't affect us. But it's best to rename this global so that conflicts cannot arise. (cherry picked from commit 27ef6f9171127afd248f38d280cf3d0eae51fdaf)
* fish: Don't fail if -m and --listen flags are both given (RHBZ#612178).Richard Jones2010-07-121-0/+11
| | | | | | | | | | | | | | | | | 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. For stable-1.2 branch: - Cherry picked from commit 8161ea9bb046c8450384b5b15e1f4b2f3dca582b - Rebased for older guestfish code.
* fish: help command return error for non-existent commands (RHBZ#597145).Richard Jones2010-06-022-23/+51
| | | | | | | | | | | | | | | | | | 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 For stable-1.2 branch: - cherry picked from commit f2b7a8e15c49ebc70c7ea56aefb340362aae5a99 - rebased for the 1.2 branch
* fish: Don't eat words when completing case-insensitive paths (RHBZ#582993).Richard Jones2010-06-023-1/+37
| | | | (cherry picked from commit 21bd2db7cf259a17cc3922409937b849e4b83c0f)
* fish: Sort returned paths so the list is stable across multiple calls.Richard Jones2010-06-021-0/+11
| | | | (cherry picked from commit 53c3b9d2b03fa5cb0ac7e86a5a51f2a18a2b91c1)
* fish: Create a separate FILES section in the manpage.Richard Jones2010-06-021-2/+27
| | | | (cherry picked from commit 7fd6e4bfb11d1f86c585de06fb2146aa5cbd400e)
* fish: Move 'EXIT CODE' section to a more logical place in the documentation.Richard Jones2010-06-021-5/+5
| | | | (cherry picked from commit 34a306ab2a7e6d9f468e8194cef8a05624325260)
* fish: Make the read/write warning more prominent.Richard Jones2010-06-021-5/+7
| | | | | | Follow the example on other manual pages by making the warning more prominent. (cherry picked from commit 57cc217335ff511e579b094e47b0de57d5c3aaef)
* fish: Fix build error if built without readline.Richard Jones2010-05-241-2/+4
| | | | | | | | fish.c:1447: error: 'add_history_line' defined but not used [-Wunused-function] (Reported by Matt Booth) (cherry picked from commit 5af010c96d687a7cf5251107a74770a231f42b77)
* fish: Make '-x' option enable traces instead of using separate echo path.Richard Jones2010-05-142-9/+7
| | | | | | | | | | | 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. (cherry picked from commit 8e007581c91a5193e6aec0f6f9aeb379a935c9d4 and commit a96d70113ffcd01f55262c3d0fbe711bee759fec and commit 87eecb507ee09a62f3a12f5f75d3417a09c0c8d4 which are all logically part of the same fix)
* docs: Routine refresh of the documentation for guestfs(3) and guestfish(1).Richard Jones2010-04-301-3/+22
| | | | | | | For stable branch: - cherry picked from commit ce95be8b185ce69 - updated the patch so it doesn't refer to any new guestfish features in the 1.3 branch
* fish docs: Be consistent about using I<-..> for options.Richard Jones2010-04-221-4/+4
| | | | (cherry picked from commit 89486c50eaeb8b1cc5a6ff388cb47e859f8565d1)
* fish docs: Use L</...> for internal links in the man page.Richard Jones2010-04-221-6/+6
| | | | (cherry picked from commit e3e67f63b0a6ce952ba92cb966b8ac5ef239dcf9)
* docs: Add virt-resize(1) link to guestfish(1) manpage.Richard Jones2010-04-201-0/+1
| | | | (cherry picked from commit 92d38b9ae3a0b1b4694da5e3d3a3cb155842cd91)
* fish: Autocomplete 'sparse' command (RHBZ#582899).Richard Jones2010-04-201-0/+1
| | | | | | I also rechecked the list of built-in commands against the actual commands to make sure no others were omitted. (cherry picked from commit 42fc0e02b094ef3b19dae115276a0a33116af6d5)
* fish: Allow '-' prefix on command line to override exit on error (RHBZ#578407).Richard Jones2010-04-141-2/+13
| | | | | | | | | | | | | | | | 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. (cherry picked from commit ad752b80d7fa064b7bdd3d4c8d47c95d79265b58)
* fish: Update documentation: Add another pipe example.Richard Jones2010-04-141-0/+1
| | | | (cherry picked from commit c076aaea7e6d9459c8d8a96d21abd71a0223f098)
* fish: Update documentation: Using 'lcd' command to change local directory.Richard Jones2010-04-141-0/+3
| | | | (cherry picked from commit c7c4a476a5957794dc2e9af0ec14b447ecef5740)
* Documentation updates.Richard Jones2010-04-121-2/+6
| | | | | | | | | Fix copyright years. Fix URLs to point to new PRC site. Make sure guestfish(1) and guestfs(3) manpages reference the current list of tools. (cherry picked from commit 9a608a1516bd339dc6d5ebe9952d3bced273c416)
* fish: Print extended help when the user types an unknown command first.Richard Jones2010-04-082-0/+21
| | | | | | | | | $ 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 (cherry picked from commit 4c50f4c38d9a50fbf983c79dd208d1b1598fef8a)
* Check error returns from posix_fallocate (RHBZ#579664).Richard Jones2010-04-081-1/+4
| | | | | | | | | | | | | | | | | | | | | | posix_fallocate has a non-standard way to return error indications. Thus all our calls to posix_fallocate were effectively unchecked. For example: $ guestfish alloc test.img 1P $ echo $? 0 $ ll test.img -rw-rw-r--. 1 rjones rjones 0 2010-04-06 11:02 test.img $ rm test.img With this change, errors are detected and reported properly: $ ./fish/guestfish alloc test.img 1P fallocate: File too large This is a fix for: https://bugzilla.redhat.com/show_bug.cgi?id=579664 (cherry picked from commit 2ade61d1f864c75ce65c358e4ac8a012a897b89a)
* Mac OS X: setlocale function requires <locale.h> header file.Richard Jones2010-03-221-0/+1
|
* Mac OS X: implement readline functions.Richard Jones2010-03-221-0/+4
| | | | | OS X has an older version of readline with some differences in the names of functions.
* Mac OS X: provide alternate implementation of posix_fallocate.Richard Jones2010-03-221-0/+19
|
* Mac OS X: Detect bindtextdomain.Richard Jones2010-03-221-0/+7
| | | | | These are missing on Mac OS X. I think you would need to install a gettext package to get these.
* Use mount-options instead of mount to avoid implicit -o sync.Richard Jones2010-02-101-4/+7
| | | | | | | | | | | | | | | 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.
* Set locale in C programs so l10n works (RHBZ#559962).Richard Jones2010-01-292-0/+5
| | | | | | | | | | | | | | | 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).
* guestfish: Use xstrtol to parse integers (RHBZ#557655).Richard Jones2010-01-251-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current code uses atoi to parse the generator Int type and atoll to parse the generator Int64 type. The problem with the ato* functions is that they don't cope with errors very well, and they cannot parse numbers that begin with 0.. or 0x.. for octal and hexadecimal respectively. This replaces the atoi call with a call to Gnulib xstrtol and the atoll call with a call to Gnulib xstrtoll. The generated code looks like this for all Int arguments: { strtol_error xerr; long r; xerr = xstrtol (argv[0], NULL, 0, &r, ""); if (xerr != LONGINT_OK) { fprintf (stderr, _("%s: %s: invalid integer parameter (%s returned %d)\n"), cmd, "memsize", "xstrtol", xerr); return -1; } /* The Int type in the generator is a signed 31 bit int. */ if (r < (-(2LL<<30)) || r > ((2LL<<30)-1)) { fprintf (stderr, _("%s: %s: integer out of range\n"), cmd, "memsize"); return -1; } /* The check above should ensure this assignment does not overflow. */ memsize = r; } and like this for all Int64 arguments (note we don't need the range check for these): { strtol_error xerr; long long r; xerr = xstrtoll (argv[1], NULL, 0, &r, ""); if (xerr != LONGINT_OK) { fprintf (stderr, _("%s: %s: invalid integer parameter (%s returned %d)\n"), cmd, "size", "xstrtoll", xerr); return -1; } size = r; } Note this also fixes an unrelated bug in guestfish handling of RBufferOut. We were using 'fwrite' without checking the return value, and this could have caused silent failures, eg. in the case where there was not enough disk space to store the resulting file, or even if the program was interrupted (but continued) during the write. Replace this with Gnulib 'full-write', and check the return value and report errors.
* Add guestfs.pod and guestfish.pod to EXTRA_DIST.1.0.81Richard Jones2010-01-131-1/+2
|
* Move guestfs(3) and guestfish(1) man pages into subdirectories.Richard Jones2009-12-312-1/+768
| | | | | | | | These manual pages have for a very long time 'lived' in the top source directory. Clean up this situation by moving those manual pages (plus associated generated files) into the src/ and fish/ subdirectories respectively.
* maint: use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1 in "usage", tooJim Meyering2009-11-201-2/+2
| | | | | | | | | | 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.
* maint: use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1 to exitJim Meyering2009-11-203-50/+50
| | | | | | | | | | | | | | | 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.
* build: Fix inter-directory dependenciesMatthew Booth2009-11-191-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds an explicit dependency on generator.ml for every file it generates, except java files. Java is left for another time because it's considerably trickier. It also adds a build rule for src/libguestfs.la so it can be rebuilt as required from other directories. It does this by creating a top level make file, subdir-rules.mk, which can be included from sub-directories. sub-directories need to define 'generator_built' to include local files which are built by generator.ml, and they will be updated automatically. This fixes parallel make, and will automatically re-create generated files when make is run from any directory. It also fixes the problem which efad4f53 was targetting. Specifically, src/guestfs_protocol.(c|h) had an erroneous dependency on stamp-generator, and therefore generator.ml, despite not being directly created by it. This caused them to be recreated every time generator.ml ran rather than only when src/guestfs_protocol.x was updated, which cascaded into a daemon and therefore appliance update. This patch also changes the contents of the distribution tarball by including files created by rpcgen.
* fish: Improve output of guestfish -h cmdRichard Jones2009-11-171-1/+1
| | | | | | Display this output like a short manual page. Don't put <..> around the parameters to the command.
* Don't export STREQ and friends in <guestfs.h>Richard Jones2009-11-101-0/+10
| | | | | Move these to private header file(s) and other places as required since these aren't part of the public API.
* Fix compilation if readline library is not present.Richard Jones2009-11-101-0/+4
|
* change strncasecmp() == 0 to STRCASEEQLEN()Jim Meyering2009-11-092-2/+2
| | | | | git grep -l 'strncasecmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrncasecmp( *\(.*?\)) *== *0\b/STRCASEEQLEN$1/g'
* change strncasecmp() == 0 to STRCASENEQLEN()Jim Meyering2009-11-091-1/+1
| | | | | git grep -l 'strncasecmp *([^=]*!= *0'|xargs \ perl -pi -e 's/\bstrncasecmp( *\(.*?\)) *!= *0\b/STRCASENEQLEN$1/g'
* use STREQ, not strcmp: part 2Jim Meyering2009-11-093-4/+4
| | | | | git grep -l 'strcmp *([^=]*!= *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *!= *0\b/STRNEQ$1/g'
* use STREQ, not strcmp: part 1Jim Meyering2009-11-092-5/+5
| | | | | git grep -l 'strcmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrcmp( *\(.*?\)) *== *0/STREQ$1/g'
* change strncmp() == 0 to STREQLEN()Jim Meyering2009-11-093-3/+3
| | | | | git grep -l 'strncmp *([^=]*== *0'|xargs \ perl -pi -e 's/\bstrncmp( *\(.*?\)) *== *0\b/STREQLEN$1/g'
* convert strcasecmp(...) != 0 to STRCASENEQ(...)Jim Meyering2009-11-091-5/+5
| | | | | git grep -E -l 'strcasecmp *\(.*!= ?0\b'|xargs \ perl -pi -e 's/\bstrcasecmp( ?\(.*?\)) != 0/STRCASENEQ$1/g'
* convert uses of strcasecmp to STRCASEEQJim Meyering2009-11-093-37/+37
| | | | | git grep -l 'strcasecmp *([^=]*== *0'| xargs \ perl -pi -e 's/\bstrcasecmp( *\(.*?\)) *== *0/STRCASEEQ$1/'
* Fixes for compiling on 32 bit.Richard W.M. Jones2009-11-061-7/+7
|
* fish: Allow <nn>P and <nn>E for petabyte and exabyte allocations.Richard Jones2009-11-042-0/+6
|
* fish: Allow <nn>T for terabyte allocations.Richard Jones2009-11-042-3/+6
|
* fish: New command 'sparse', like 'alloc' but to generate sparse files.Richard Jones2009-11-043-0/+83
| | | | | | | | | | | | | | | | | 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
* guestfish: Add win: prefix to use Windows paths.Richard Jones2009-10-262-0/+49
| | | | | | | 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
* avoid use of all ctype macrosJim Meyering2009-09-242-4/+3
| | | | | | | | | | | | | | | | | | | | * cfg.mk (disable_temporarily): Don't disable sc_avoid_ctype_macros. * fish/tilde.c: Remove unnecessary inclusion of ctype.h. * bootstrap: Add gnulib's c-ctype module to the list. * daemon/m4/gnulib-cache.m4: Likewise. * daemon/ext2.c: Include "c-ctype.h", not <ctype.h>. Use c_isspace, etc, rather than isspace. * daemon/guestfsd.c: Likewise. * daemon/lvm.c: Likewise. * daemon/proto.c: Likewise. * fish/fish.c: Likewise. * fish/tilde.c: Likewise. * src/generator.ml: Likewise. * src/guestfs.c: Likewise. * examples/to-xml.c: Likewise. * examples/Makefile.am (to_xml_CPPFLAGS): Add -I$(top_srcdir)/gnulib/lib so inclusion of "c-ctype.h" works. (to_xml_CPPFLAGS): Rename from to_xml_CFLAGS.
* Remove guestfs_wait_ready (turn it into a no-op).Richard Jones2009-09-211-2/+0
| | | | | | | | | | | | | | 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.