summaryrefslogtreecommitdiffstats
path: root/edit
Commit message (Collapse)AuthorAgeFilesLines
* tools: Modify existing tools to use guestfs_{push,pop}_error_handler.Richard W.M. Jones2012-11-091-10/+4
| | | | | This is a shorter and more convenient way to disable errors temporarily across calls.
* lib: Rework temporary and cache directory code.Richard W.M. Jones2012-11-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New APIs: set-tmpdir, get-tmpdir, set-cachedir, get-cachedir. The current code has evolved over time and has a number of problems: (a) A single environment variable ($TMPDIR) controls the location of several directories. (b) It's hard for the library user to predict which directory libguestfs will use, unless the user simulates the same internal steps that libguestfs performs. This commit fixes these issues. (a) Now three environment variables control the location of all small temporary files, and the appliance cache: For temporary files: $LIBGUESTFS_TMPDIR or $TMPDIR or /tmp. For the appliance cache: $LIBGUESTFS_CACHEDIR or $TMPDIR or /var/tmp. The user can also set these directories explicitly through API calls (guestfs_set_tmpdir and guestfs_set_cachedir). (b) The user can also retrieve the actual directories that libguestfs will use, by calling guestfs_get_tmpdir and guestfs_get_cachedir. These functions are also used internally. This commit also: - reworks the internal tmpdir code - removes the internal (undocumented) guestfs_tmpdir call (replacing it with calls to the documented guestfs_get_tmpdir API instead) - changes the ./run script to set LIBGUESTFS_TMPDIR and LIBGUESTFS_CACHEDIR - adds a test - fixes a few places like libguestfs-make-fixed-appliance which depended on $TMPDIR
* virt-edit: If case_sensitive_path returns an error, exit.Richard W.M. Jones2012-09-281-0/+2
| | | | | | | The 'windows_path' function was blindly copied from virt-cat. In virt-cat, errors are checked by the caller to 'windows_path'. But virt-edit lacks this check. Change the function in virt-edit to add a check and exit on error.
* remove the useless "h" optionWanlong Gao2012-09-261-3/+0
| | | | | | "h" option is not enabled in virt-cat, remove it. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* tests: Attach copyright and license (GPLv2+) notices to various test scripts.Richard W.M. Jones2012-08-311-0/+16
| | | | For some reason these tests did not have license notices.
* podwrapper: Add --license parameter, which is required.Richard W.M. Jones2012-08-211-0/+1
| | | | | | | | | | This adds standard LICENSE and BUGS sections to all of the man pages that are processed by podwrapper. Modify all the calls to $(PODWRAPPER) to add the right --license parameter according to the content. Note that this relaxes the license on some code example pages, making them effectively BSD-style licensed.
* man pages: Ensure consistent copyright/author sections, remove licenseRichard W.M. Jones2012-08-211-14/+0
| | | | | | | | | | section. Ensure each man page contains consistent COPYRIGHT and AUTHOR sections. Remove the LICENSE section. We will add that back in podwrapper in a later commit.
* Replace mount-options with mount where appropriate.Richard W.M. Jones2012-08-181-1/+1
| | | | | | Since our minimum supported version is now 1.16 and mount was fixed in 1.13.16, it is now safe to replace mount-options + empty options with mount wherever it occurs.
* fish: Rename fish/virt.c to fish/domain.cRichard W.M. Jones2012-07-191-2/+2
| | | | | This file handles the -d option for guestfish and other C command line utilities. Renaming this file makes it less confusing.
* docs: Use L<...> for links.Richard W.M. Jones2012-07-171-1/+1
| | | | | Instead of working around bugs, podwrapper has been fixed so that links work in all output formats.
* build: Change calls to podwrapper.sh to use $(PODWRAPPER).Richard W.M. Jones2012-07-161-1/+1
| | | | | This will allow us to easily change the location of this script in future.
* New API: guestfs_shutdown: Cleanly shutdown the backend.Richard W.M. Jones2012-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The new API splits orderly close into a two-step process: if (guestfs_shutdown (g) == -1) { /* handle the error, eg. qemu error */ } guestfs_close (g); Note that the explicit shutdown step is only necessary in the case where you have made changes to the disk image and want to handle write errors. Read the documentation for further information. This change also: - deprecates guestfs_kill_subprocess - turns guestfs_kill_subprocess into the same as guestfs_shutdown - changes guestfish and other tools to call shutdown + close where necessary (not for read-only tools) - updates documentation - updates examples
* tests: Use qemu-img to create an overlay for testing, instead of copying.Richard W.M. Jones2012-06-291-7/+9
| | | | | | | | | | Replace: cp tests/guests/fedora.img test.img with the longer but possibly more space-efficient equivalent: qemu-img create -F raw -b tests/guests/fedora.img -f qcow2 test.qcow2
* run: Set MALLOC_PERTURB_ to a random value.Richard W.M. Jones2012-06-281-5/+1
| | | | | | | | | | | | | | | | | 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
* tests: Add ./run --test option.Richard W.M. Jones2012-06-261-1/+1
| | | | | | | 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.
* virt-edit: Document CVE-2012-2690.Richard W.M. Jones2012-06-141-0/+14
|
* edit: Preserve file permissions, UID, GID, SELinux context on edited files. ↵Richard W.M. Jones2012-02-092-0/+91
| | | | (RHBZ#788641)
* Do not run appliance-related checks if not building applianceHilko Bengen2012-01-231-0/+2
|
* Replace setting of environment variables with usage of local run scriptHilko Bengen2012-01-231-3/+1
| | | | (Includes fix by RWMJ)
* Tempus fugit.Richard W.M. Jones2012-01-183-4/+4
| | | | Update all copyright dates to 2012.
* fish options parsing: Allow add_drives to be called multiple times.Richard W.M. Jones2012-01-181-3/+2
| | | | | | Ensure that the drv structure is always zeroed on allocation. Don't leak old drv->device when add_drives is called multiple times.
* tests: Split images -> tests/data + tests/guestsRichard W.M. Jones2011-12-221-1/+1
|
* Update FSF address.Matthew Booth2011-11-083-3/+3
|
* man pages: Add a standard EXIT STATUS section to most pages.Richard W.M. Jones2011-08-271-0/+5
|
* out-of-tree build: fix documentation generationHilko Bengen2011-08-151-1/+1
|
* build: Set TMPDIR for local testing.Richard W.M. Jones2011-08-081-1/+2
| | | | | | This avoids conflicts with the globally installed libguestfs appliance, or lets us build in multiple local directories at the same time without conflicts.
* docs: Separate out combined =item 's in man pages.Richard W.M. Jones2011-07-161-1/+3
| | | | | | | | | | | | | | | 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.
* Enable deprecation warnings on all C programs.Richard W.M. Jones2011-05-171-0/+1
|
* edit: Reorganize options alphabetically.Richard W.M. Jones2011-05-091-13/+13
|
* edit: Fix reference to virt-cat in the documentation.Richard W.M. Jones2011-05-091-1/+1
| | | | This updates commit 2b5fbc882a0a79646b668c7b95442f0b3673d63a.
* Rewrite virt-edit in C.Richard W.M. Jones2011-05-094-0/+1164
|
* Move virt tools (virt-cat, virt-edit etc) into tools/ subdirectory.Richard Jones2009-10-193-307/+0
| | | | | | | | | | | | | | | | | | This moves the tool programs into a single directory: cat/* -> tools/virt-cat df/* -> tools/virt-df edit/* -> tools/virt-edit rescue/* -> tools/virt-rescue This in itself simplifies the build process because we only need one Makefile and one copy of 'run-locally'. 'run-*-locally' has become just 'run-locally' and takes an extra parameter which is the name of the tool, eg: run-locally cat [virt-cat params...] virt-inspector stays in its own directory, because this contains more than just a single Perl script.
* run-*-locally: The programs are now virt-[tool], not virt-[tool].plRichard Jones2009-10-011-1/+1
| | | | This fixes commit b488436cc54288fcae8988493749f2e6c87f274c.
* Include virt tools in EXTRA_DIST.Richard Jones2009-09-231-1/+2
| | | | | | Partially revert b488436cc54288fcae8988493749f2e6c87f274c. It turns out that automake doesn't automatically place bin_SCRIPTS in EXTRA_DIST.
* Rename virt-[tool].pl as virt-[tool]Richard Jones2009-09-232-8/+4
|
* Check return value from readlink.Richard Jones2009-09-231-1/+1
|
* Create manpage atomically.Richard Jones2009-09-231-1/+1
| | | | Don't fail with a partial file if disk full, etc.
* Replace @...@ with $(...) in these common Makefile.am files.Richard Jones2009-09-231-4/+4
|
* New tool: virt-editRichard Jones2009-09-233-0/+310
Edit any file in a guest. This was possibly previously using guestfish, but having a separate command makes it simpler. The usage is simply: virt-edit mydomain /some/file It runs $EDITOR or vi on the file, and if the user changes it, uploads the result back to the VM.