summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* lib: Remove unused headers <arpa/inet.h> and <netinet/in.h>Richard W.M. Jones2012-09-152-4/+0
| | | | | These were used back in the day when we used TCP for the communications channel with the guest.
* syntax: Remove HAVE_*_H tests which are always true.Richard W.M. Jones2012-09-153-42/+7
| | | | | Gnulib supplies replacements for these headers, so there is no need to test.
* lib: These optargs structures are not modified, hence const.Richard W.M. Jones2012-09-151-3/+3
|
* docs: Fix documentation of syntax-check target, add extra-tests.Richard W.M. Jones2012-09-151-2/+7
|
* launch: libvirt: Enable sVirt.Richard W.M. Jones2012-09-141-21/+0
|
* build: Create new 'tmp' directory for tests.Richard W.M. Jones2012-09-141-0/+12
| | | | | | | | | | | | Having a separate directory means: (1) It's easy to clean up orphaned temporary files, the appliance, etc. (2) You can put an SELinux label on this directory so that qemu can write to it when you're using sVirt and SELinux is enforcing: chcon --reference=/tmp tmp
* launch: libvirt: Mark appliance disk as <shareable/> (thanks Dan Berrange).Richard W.M. Jones2012-09-141-0/+3
| | | | | | | | | | | This is a fix for multiprogramming: If two instances of libguestfs share the same appliance disk, then libvirt would unlabel the disk when one of the instances closes the handle, resulting in the other qemu being unable to continue accessing the appliance. Adding the flag makes libvirt understand that the disk is shared so it doesn't do this, and it apparently handles locking correctly too if we were using sanlock.
* lib: guestfs_disk_format: Set LC_ALL=C instead of LANG=C.Richard W.M. Jones2012-09-121-1/+1
| | | | | | LC_ALL takes precedence over LANG. See: http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html
* shutdown: Add 'check_for_errors' hint along the shutdown path.Richard W.M. Jones2012-09-046-10/+26
| | | | | | | | This hint tells the backend whether anyone cares about errors when the appliance is shut down. Currently this only has any effect on the libvirt backend, where it controls whether or not we use the VIR_DOMAIN_DESTROY_GRACEFUL flag.
* launch: libvirt: Add VIR_DOMAIN_DESTROY_GRACEFUL flag.Richard W.M. Jones2012-09-041-2/+1
| | | | | | We want libvirt to report failures when destroying the guest. See: https://bugzilla.redhat.com/show_bug.cgi?id=853369#c12
* proto: Don't set g->fd[] to /dev/null in direct mode, fixing virt-rescue ↵Richard W.M. Jones2012-09-041-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (RHBZ#853159). https://bugzilla.redhat.com/show_bug.cgi?id=853159 git bisect pointed to the following commit: commit ec8e3b6cad170d08ac18b580792dfb137eb171dc Author: Richard W.M. Jones <rjones@redhat.com> Date: Fri Jul 20 14:24:10 2012 +0100 launch: Abstract attach method operations. g->attach_ops points to a structure which contains the operations supported by each attach method backend (ie. appliance, unix, etc.). Since that commit was essentially just code motion, it wasn't clear why virt-rescue should be affected by it. In fact the reason is as follows: (1) In direct mode, we don't need g->fd[] (which would normally be connected to the stdin/stdout of qemu). So we opened them on /dev/null so they had some value. (2) accept_from_daemon / read_log_message_or_eof reads from g->fd[1]. Since this is connected to /dev/null, it always reads EOF. (3) This would cause child_cleanup to be called. This is completely unintentional: we don't want to cleanup the child at this point, even in direct mode. (4) Prior to the commit above, child_cleanup first waited for the process to exit (ie. waitpid). This happened to work, since we are effectively waiting for the user to exit virt-rescue. (5) After the commit above, the order of operations was changed so that we first killed qemu before waiting for it. This broke virt-rescue. The fix is to change direct mode so that it leaves g->fd[]'s as -1. The rest of the protocol code can deal with this situation -- it ignores the log fd instead of trying to read from it.
* launch: libvirt: Direct mode flag is not (yet) supported, so give an error ↵Richard W.M. Jones2012-09-041-0/+6
| | | | | | in this case. We definitely intend to support this in future.
* New APIs: disk-virtual-size and disk-has-backing-file.Richard W.M. Jones2012-09-041-0/+63
|
* lib: Reimplement qemu-img info parser for flexibility.Richard W.M. Jones2012-09-041-24/+52
| | | | | | | This allows other fields from the output of 'qemu-img info' to be parsed out. This updates commit 20902e7ce02fa375d5d336e6b984f615472ad1b1.
* Fix guestfs_disk_image API to work with relative paths.Richard W.M. Jones2012-09-041-1/+12
| | | | | | | | guestfs_disk_image makes a symbolic link to the real filename in order to sanitize the filename. However this fails if the filename is a relative path. Call realpath(3) to make the filename canonical. This fixes commit 20902e7ce02fa375d5d336e6b984f615472ad1b1.
* launch: libvirt: Use guestfs_disk_format API to autodetect input format.Richard W.M. Jones2012-09-031-85/+19
|
* guestfs(3): Document disk image formats and how to detect them.Richard W.M. Jones2012-09-031-0/+87
|
* New API: guestfs_disk_formatRichard W.M. Jones2012-09-032-0/+162
| | | | Detect the disk image format of a file, in a secure way.
* generator: Rename 'generator_*' as '*'.Richard W.M. Jones2012-09-021-10/+9
| | | | | | | | | This is a simple renaming of the files/modules. Note that in OCaml, module names are derived from filenames by capitalizing the first letter. Thus the old module names had the form "Generator_api_versions". The new modules names have the form "Api_versions".
* Copy the kernel so that libvirt can add an SELinux label to it. NB. This ↵Richard W.M. Jones2012-08-311-2/+3
| | | | requires febootstrap >= 3.20 with --copy-kernel flag.
* guestfs-internal.h: Organize functions by file.Richard W.M. Jones2012-08-311-45/+75
| | | | | | | | | | | This is almost just code motion. While doing this I discovered two prototypes for functions which no longer exist: * guestfs___launch_appliance * guestfs___launch_unix so these prototypes have been removed. The rest are rearranged more logically.
* src/dbdump.c: Shouldn't depend on HAVE_HIVEX (thanks Tao Zhou).Richard W.M. Jones2012-08-311-2/+2
|
* launch: appliance: app.virtio_scsi must not be bool.Richard W.M. Jones2012-08-301-1/+1
| | | | | | This is used to store values 0..3, so it mustn't be a bool. Ooops. RHEL 5's gcc revealed this bug.
* launch: libvirt: Remove code for creating sockdir.Richard W.M. Jones2012-08-301-107/+8
| | | | | | Create the sockets in g->tmpdir as usual. It's a bug in libvirt that it doesn't label the sockets correctly no matter where they are located.
* launch: libvirt: Avoid memory leak if sockdir is not created (found by ↵Richard W.M. Jones2012-08-301-0/+2
| | | | valgrind).
* NEW API:xfs:xfs_repairWanlong Gao2012-08-301-1/+1
| | | | | | | | | | Add a new api xfs_repair for repairing an XFS filesystem. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Fix non-error return path so it doesn't send two replies. - Document return code.
* Update inspection and example programs to use new hivex* APIs (RHBZ#852394).Richard W.M. Jones2012-08-299-364/+117
| | | | | | | | | | | | | | | | | | | | | | | I tested this by comparing the output of virt-inspector over Windows guests before and after the change, which was identical: $ md5sum `ls -1 /tmp/*.before /tmp/*.after` c292d6629b5a761eccb4a279754399b4 /tmp/Win2003.after c292d6629b5a761eccb4a279754399b4 /tmp/Win2003.before eb1e1ff29208a9ee46e9c100dfec26b2 /tmp/Win2012.after eb1e1ff29208a9ee46e9c100dfec26b2 /tmp/Win2012.before d060a95d7ffe5dce6c4e66feb80c2837 /tmp/Win7x32.after d060a95d7ffe5dce6c4e66feb80c2837 /tmp/Win7x32.before 8914eee70ac4f8a0317659e09e00dcdc /tmp/Win7x32Dynamic.after 8914eee70ac4f8a0317659e09e00dcdc /tmp/Win7x32Dynamic.before a2dcdfc0f9d64054640875aa791889e0 /tmp/Win7x32TwoDisks.after a2dcdfc0f9d64054640875aa791889e0 /tmp/Win7x32TwoDisks.before 5ed49568a5147dce7517c99de41ebf2e /tmp/Win8previewx64.after 5ed49568a5147dce7517c99de41ebf2e /tmp/Win8previewx64.before fdfc7d272b79a665ae3313ae1ae30660 /tmp/WinXP.after fdfc7d272b79a665ae3313ae1ae30660 /tmp/WinXP.before 3c705444be664f1316b21c5d8d3cb0be /tmp/WinXPRecConsole.after 3c705444be664f1316b21c5d8d3cb0be /tmp/WinXPRecConsole.before
* New API: guestfs_hivex_value_utf8Richard W.M. Jones2012-08-291-0/+85
| | | | | A convenience function that reads a value from the registry and returns it as UTF-8.
* New APIs: hivex_*Richard W.M. Jones2012-08-292-7/+10
| | | | | | | | | | | Transscribe many hivex(3) APIs into the libguestfs API. There is one hive handle per libguestfs handle, as with Augeas. Note that hivex uses iconv_open for some APIs (eg. hivex_value_string). But since we delete all the i18n files from the appliance, this doesn't work -- iconv_open returns EINVAL. Therefore hivex APIs which require iconv cannot be bound in the daemon.
* lib: Remove AUGEAS_CFLAGS, AUGEAS_LIBS.Richard W.M. Jones2012-08-291-2/+2
| | | | | | The library doesn't actually use libaugeas, except indirectly via the libguestfs API. The libguestfs API implements this in the daemon, so there's no need for the library to link to augeas at all.
* remove ulockmgr from fuse LDFLAGSOlaf Hering2012-08-291-1/+1
| | | | | | | | | | libguestfs fails to build with --enable-fuse on openSuSE 11.4 and earlier because the included fuse version does not include libulockmgr.so. configure already used pkgconfig to retrieve the correct CFLAGS, so there is no need to hardcode -lulockmgr. With this change the build succeeds again. Signed-off-by: Olaf Hering <olaf@aepfle.de>
* launch: libvirt: Don't crash if shutdown_libvirt is called early in launch.Richard W.M. Jones2012-08-281-8/+13
| | | | | | | | | | | The assert (conn != NULL) was being triggered with this stack trace: at launch-libvirt.c:1305 fd=<optimized out>, error_if_eof=error_if_eof@entry=0) at proto.c:222 size_rtn=size_rtn@entry=0x7fffffffdb34, buf_rtn=buf_rtn@entry=0x7fffffffdb58) at proto.c:548 libvirt_uri=<optimized out>) at launch-libvirt.c:391
* 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-48/+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.
* docs: Document null disks.Richard W.M. Jones2012-08-211-0/+61
| | | | | It's always been possible to use /dev/null as a disk image. Document this formally in the API.
* launch: libvirt: Always create /var/run/libguestfs.Richard W.M. Jones2012-08-211-2/+4
| | | | | This directory won't necessarily exist (esp. if /var/run is really /run). So create it each time.
* launch: libvirt: Minimum libvirt version is now 0.10.0.Richard W.M. Jones2012-08-211-9/+26
|
* New API: xfs: xfs_adminWanlong Gao2012-08-211-1/+1
| | | | | | | | | | | Add new api xfs_admin to change parameters of an XFS filesystem. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Remove printuuid, printlabel, since they don't change any settings. - Adjusted the documentation. - Fix the tests.
* Replace mount-options with mount where appropriate.Richard W.M. Jones2012-08-181-3/+3
| | | | | | 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.
* Update API support.Richard W.M. Jones2012-08-1825-1/+13114
|
* docs: Rewrite section on protocol limits again.Richard W.M. Jones2012-08-171-22/+20
| | | | This updates commit 92e241440d361e9491a9d96d23ad7a378cb2ab6a.
* docs: Update documentation to reflect no 2/4 MB protocol limits.Richard W.M. Jones2012-08-171-12/+21
|
* New API: fill-dir: Fill a directory with files (for testing).Richard W.M. Jones2012-08-171-1/+1
|
* guestfs_ls: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-0/+102
|
* New API: ls0 - List files, separated by \0 characters.Richard W.M. Jones2012-08-171-1/+1
| | | | | This API is not especially useful on its own. It will be used to reimplement guestfs_ls to work without protocol limits.
* guestfs_readlinklist: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-0/+41
|
* guestfs_lstatlist, guestfs_lxattrlist: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-0/+125
| | | | | Note that the code to do this was already in virt-ls, so this is change is mostly just moving the code into the core library.
* guestfs_write, guestfs_write_append: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-0/+79
| | | | | | | | Note that we keep the old daemon calls, but rename them as "internal_write" and "internal_write_append". This lets us implement the new library-side calls more efficiently in the common case when the uploaded content is smaller than the message buffer. In most cases the new calls won't end up using a temporary file.
* guestfs_read_lines: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-0/+66
| | | | This also makes a larger test suite for this command.
* guestfs_read_file: Reimplement to avoid protocol limits.Richard W.M. Jones2012-08-171-0/+12
|