summaryrefslogtreecommitdiffstats
path: root/fish
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Move decl out for C99 compliance.Richard Jones2009-09-141-1/+3
|
* Fix type punning warning about use of CMSG_DATA in Rawhide.Richard Jones2009-09-141-2/+4
|
* guestfish: Enable grouping in string listsMatthew Booth2009-09-141-17/+133
| | | | | | | | | | | | | | | | | | | | | | This change adds the ability to group entries in a string list with single quotes. So the string: "'foo bar'" becomes 1 token rather than 2. Consequently single quotes must now be escaped: "\'" resolves to a literal single quote. Incidentally, this change also alters another, probably unintentional behaviour of the previous implementation, in that tokens are separated by any amount of whitespace rather than a single whitespace character. I.e.: "a b" resolves to: 'a' 'b' rather than: 'a' '' 'b' That last syntax can be used if an empty argument is still desired. Whitespace is now also defined to include tabs. parse_string_list can also now fail if it contains an unmatched open quote.
* guestfish: Redirect stdout when executing remote commandsMatthew Booth2009-09-141-8/+126
| | | | | | | | | | | guestfish --listen necessarily redirects its stdout to /dev/null so as not to interfere with eval. The remote protocol doesn't contain any other provision for collecting stdout for the caller, so executing guestfish --remote will never generate any output. This patch fixes that by forwarding the caller's STDOUT to the listener over the unix socket connection. The listener redirects its STDOUT to the caller's STDOUT for the duration of the command, then closes it again.
* build: don't define _GNU_SOURCE manuallyJim Meyering2009-08-242-4/+0
| | | | | | | | | | | | Now that we're using gnulib in earnest, any manual definition would provoke a redefinition warning. * fish/fish.c (_GNU_SOURCE): Don't define. * fish/destpaths.c (_GNU_SOURCE): Likewise. * src/guestfs.c (_GNU_SOURCE): Likewise. * bootstrap (modules): Add asprintf, strchrnul, strerror, strndup and vasprintf. * fish/fish.c (main): Set argv[0] to sanitized program_name, so functions like getopt_long that use argv[0] use the clean name.
* guestfish: diagnose stdout write failureJim Meyering2009-08-241-0/+3
| | | | | | | | Use gnulib's closeout module to ensure any failure to write to stdout is detected and reported. * fish/fish.c: Include "closeout.h". (main): Call atexit (close_stdout); * bootstrap (modules): Add closeout.
* guestfish: don't try to diagnose getopt failureJim Meyering2009-08-241-2/+0
| | | | | * fish/fish.c: ... getopt_long already does that. Instead, suggest "Try `guestfish --help' for more information."
* guestfish: write --help to stdout, use gnulib's progname moduleJim Meyering2009-08-242-45/+92
| | | | | | | | | | * fish/fish.c: Include "progname.h". (main): Call set_program_name to initialize. Don't hard-code guestfish everywhere. Use program_name. However, be careful when modifying argv[0], since it is used in the hopes that it is an absolute file name. (usage): Don't spew all of --help for a mis-typed option. Split long lines.
* fish/: enable -Werror and all of gcc's warning optionsJim Meyering2009-08-211-2/+2
| | | | * fish/Makefile.am: Use $(WARN_CFLAGS) $(WERROR_CFLAGS).
* destpaths.c: avoid signed/unsigned-comparison warningJim Meyering2009-08-211-1/+1
| | | | * fish/destpaths.c (free_words): Change param type: s/int/size_t/.
* fish.c: don't perform arithmetic on void* pointersJim Meyering2009-08-211-1/+2
| | | | * fish/fish.c (xwrite): Use char*.
* fish.c: avoid signed/unsigned-comparison warningJim Meyering2009-08-211-2/+2
| | | | * fish/fish.c (script): Change type of index to "unsigned int".
* fish.c: avoid "assignment discards qualifiers..." warningJim Meyering2009-08-212-1/+7
| | | | | * fish/fish.c (main): Cast-away-const. * fish/fish.h (bad_cast): Define. Safer than using an actual cast.
* tilde.c: avoid a warningJim Meyering2009-08-211-5/+3
| | | | | * fish/tilde.c (find_home_for_username): Change param type: s/int/size_t/ (try_tilde_expansion): Adjust caller.
* fish.c: avoid warningsJim Meyering2009-08-212-3/+1
| | | | | * fish/rc.c (UNIX_PATH_MAX): Remove unused definition. * fish/fish.h (rc_listen): Declare with __attribute__((noreturn)).
* edit.c: avoid warning about signed/unsigned comparisonJim Meyering2009-08-211-2/+3
| | | | | * fish/edit.c (load_file): Change type of param from int to size_t. (do_edit): Adjust caller.
* guestfish: detect more failed syscallsJim Meyering2009-08-191-8/+33
| | | | * fish/fish.c (issue_command): Detect/diagnose more failed syscalls.
* avoid compiler warnings about unused vars in generated codeJim Meyering2009-08-181-2/+10
| | | | | | | * fish/Makefile.am: Compile rc_protocol.c into a convenience library, so it can have its own CFLAGS, and link that into guestfish. generator.ml: Use TABs, not spaces for indentation.
* adjust const "**" pointers to avoid warningsJim Meyering2009-08-172-6/+6
| | | | | | Also, ... * src/generator.ml: Add DeviceList type, and propagate that change out to all calling/interface code.
* guestfish: Add --selinux option.Richard Jones2009-08-131-2/+7
|
* fish: don't read freed memoryJim Meyering2009-08-121-4/+4
| | | | | | | * fish/rc.c (rc_remote): Close file handle only *after* xdr_destroy, because that latter may flush its file handle (implicated via xdrstdio_create). FYI, this failure is triggered for me only when MALLOC_PERTURB_ is set to nonzero < 256 in my environment.
* Fix: segfault in tab completion (RHBZ#516024).Richard Jones2009-08-061-2/+2
| | | | | Actually this fixes two bugs: 'strs' was not being freed on every path, and the tab completion segfault described in the bug report.
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-037-361/+361
| | | | | | | | | | | 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 : $_'
* build: reenable "syntax-check" rule: sc_const_long_optionJim Meyering2009-08-031-1/+1
| | | | | | | * cfg.mk (disable_temporarily): Remove sc_const_long_option. * daemon/guestfsd.c (main): Declare long_options to be "const". * fish/fish.c (main): Likewise. * test-tool/test-tool.c (main): Likewise.
* guestfish: Make more strings translatable.Richard Jones2009-07-292-6/+4
| | | | | However this doesn't yet attempt to translate the POD command documentation. We need a plan to do that.
* guestfish -iv should print virt-inspector command (for debugging).Richard W.M. Jones2009-07-241-1/+3
|
* More misc fixes for non-srcdir builds.Richard Jones2009-07-161-3/+9
|
* guestfish: Add tilde expansion for paths (RHBZ#511372).Richard Jones2009-07-154-1/+138
| | | | | | | | | | | | | | | | | | | 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
* File missing from tarball: rc_protocol.xRichard W.M. Jones2009-07-141-0/+3
|
* Guestfish feature: remote control of guestfish over a pipe.Richard Jones2009-07-145-7/+395
| | | | | | | | | | | | | | | | | 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.
* Guestfish: implement -x option, echo commands before executing them.Richard W.M. Jones2009-07-111-2/+15
|
* Fix: '-D' was not recognized as a parameter to guestfish.Richard W.M. Jones2009-07-111-1/+1
|
* Guestfish: Add 'reopen' command to reopen the libguestfs handle.Richard W.M. Jones2009-07-114-4/+90
|
* Add missing documentation for "more" command in guestfish help output.Richard W.M. Jones2009-07-111-0/+2
|
* guestfish: Always fflush stdout between commands.Richard Jones2009-07-061-1/+5
|
* Make it possible to build in a separate directoryMatthew Booth2009-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | This patch allows you to do: mkdir build cd build ../configure ... make This will output all generated files to the build directory. Given that autogen automatically runs configure, you can also do: BUILDDIR=./build ./autogen.sh which will do the right thing. Also: * Fix a dependency bug which means that guestfs_protocol.h isn't automatically rebuilt. * Re-running autogen.sh with no arguments won't blow away your previous configure arguments.
* remove trailing blanksJim Meyering2009-07-038-8/+8
|
* Guestfish tab-completion on destination paths, fixed this time.Richard W.M. Jones2009-07-031-49/+74
| | | | Tab-completion on destination paths should now work correctly.
* Add the guestfish 'time' command.Richard W.M. Jones2009-07-024-9/+78
| | | | | ><fs> time sfdisk /dev/sda 0 0 0 , elapsed time: 6.12 seconds
* Remove generated code from git.Richard W.M. Jones2009-07-022-4111/+0
| | | | | | | | Git users now require the OCaml compiler in order to regenerate the generated code after a checkout. Generated code will remain in the tarball, so users of the source tarball will not need the OCaml compiler.
* Add 'readdir' call.Richard W.M. Jones2009-07-022-0/+40
| | | | | | | | | | | | This adds a readdir call (mostly intended for programs). The return value is a list of guestfs_dirent structures. This adds the new types 'struct guestfs_dirent' and 'struct guestfs_dirent_list', along with all the code to return these in the different language bindings. Also includes additional tests for OCaml and Perl bindings to test this.
* fish: handle some out-of-memory conditionsJim Meyering2009-07-011-29/+62
| | | | | | | | | | | | | * fish/destpaths.c (xalloc_oversized): Define. (complete_dest_paths_generator): Use size_t as type for a few variables, rather than int. Don't deref NULL or undef on failed heap alloc. Don't leak on failed realloc. Detect theoretical overflow when count_strings returns a very large number of strings. Handle asprintf failure. (APPEND_STRS_AND_FREE): Rewrite as do {...}while(0), so that each use can/must be followed by a semicolon. Better for auto-formatters.
* Generated code for the virtio_blk change.Richard W.M. Jones2009-07-011-3/+3
|
* Generated code for mknod, mkfifo, mknod_b, mknod_c, umask.Richard W.M. Jones2009-06-302-0/+132
|