summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* inspect: Fix some small memory leaks in Windows inspection.Richard W.M. Jones2011-04-121-0/+3
| | | | Found using valgrind.
* Compile rpcgen-generated files with -fno-strict-aliasingMatthew Booth2011-04-071-7/+4
| | | | | rpcgen generates source which can't be safely compiled with strict-aliasing enabled.
* New API: inspect-get-drive-mappingsRichard W.M. Jones2011-04-052-1/+180
| | | | | | | | | | | | This returns the drive mappings from the Windows Registry. virt-inspector displays the drive mappings, giving output similar to this: <drive_mappings> <drive_mapping name="C">/dev/sda2</drive_mapping> <drive_mapping name="E">/dev/sdb1</drive_mapping> </drive_mappings>
* New API: inspect-get-windows-current-control-setRichard W.M. Jones2011-04-052-9/+66
| | | | | | | | | | | | | | This returns the actual registry key corresponding to CurrentControlSet (eg. it might be "ControlSet001"). Previously the inspection code was hard-coding ControlSet001. Now we use the correct control set, and also make it available to callers through the API. This commit also updates the virt-dhcp-address example so it uses this new API. virt-inspector displays the current control set when available.
* Rename resolve_windows_path_silently to case_sensitive_path_silently.Richard W.M. Jones2011-04-051-9/+9
| | | | | | A more accurate description of what this function does. This is just code motion.
* daemon: Introduce "pulse mode" progress events.Richard W.M. Jones2011-04-011-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a new form of progress event, where we don't know how much of the operation has taken place, but we nevertheless want to send back some indication of activity. Some progress bar indicators directly support this, eg. GtkProgressBar where it is known as "pulse mode". A pulse mode progress message is a special backwards-compatible form of the ordinary progress message. No change is required in callers, unless they want to add support for pulse mode. The daemon sends: - zero or more progress messages with position = 0, total = 1 - a single final progress message with position = total = 1 Note that the final progress message may not be sent if the call fails and returns an error. This is consistent with the behaviour of ordinary progress messages. The daemon allows two types of implementation. Either you can just call notify_progress (0, 1); ...; notify_progress (1, 1) as usual. Or you can call the functions pulse_mode_start, pulse_mode_end and/or pulse_mode_cancel (see documentation in daemon/daemon.h). For this second form of call, the guarantee is very weak: it *just* says the daemon is still capable of doing something, and it doesn't imply that if there is a subprocess that it is doing anything. However this does make it very easy to add pulse mode progress messages to all sorts of existing calls that depend on long-running external commands. To do: add a third variant that monitors a subprocess and only sends back progress messages if it's doing something, where "doing something" might indicate it's using CPU time or it's printing output.
* Generate progress messages during launch.Richard W.M. Jones2011-04-013-0/+54
| | | | | | | | | | | | | | | | | | | This commit generates approximate progress messages during the guestfs_launch call. Currently this code generates: 0 / 12: launch clock starts 3 / 12: appliance created 6 / 12: detected that guest kernel started 9 / 12: detected that /init script is running 12 / 12: launch completed successfully (Note this is not an ABI and may be changed or removed in a future version). Progress messages are only generated at all if 5 seconds have elapsed since the launch, and they are only generated for the ordinary appliance (not if using attach-method to attach to an existing virtio serial port).
* protocol: Sleep for 1ms before reading log messages.Richard W.M. Jones2011-04-011-1/+8
| | | | | | | | | | | | | | | As explained in the comment: /* QEMU's console emulates a 16550A serial port. The real 16550A * device has a small FIFO buffer (16 bytes) which means here we see * lots of small reads of 1-16 bytes in length, usually single * bytes. Sleeping here for a very brief period groups reads * together (so we usually get a few lines of output at once) and * improves overall throughput, as well as making the event * interface a bit more sane for callers. With a virtio-serial * based console (not yet implemented) we may be able to remove * this. XXX */
* Shared function to send progress messages.Richard W.M. Jones2011-04-012-5/+9
| | | | This is just code motion.
* Add prototype for timeval_diff.Richard W.M. Jones2011-04-011-1/+2
| | | | This is just code motion.
* docs: Progress messages don't necessarily reach 100% in the error case.Richard W.M. Jones2011-04-011-1/+2
| | | | | This should be obvious, and now it is documented to avoid any confusion.
* Update copyright date on main guestfs(3) man page.Richard W.M. Jones2011-04-011-1/+1
|
* inspect: Detect 32 bit applications running on WOW64 emulator (RHBZ#692545).Richard W.M. Jones2011-03-311-42/+56
| | | | | | | These applications are located along a different Registry path. See http://support.microsoft.com/kb/896459 for all the details. Thanks Jinxin Zheng for finding the bug and the solution.
* Rename $tmpdir/sock to $tmpdir/guestfsd.sock.Richard W.M. Jones2011-03-252-6/+6
| | | | | | | | No functional change; this simply makes the purpose of the socket clearer. Notes: Labels: cleanup
* inspector: Add detection of Slackware.Richard W.M. Jones2011-03-252-0/+13
| | | | Notes: Labels: feature
* New API: guestfs_inspect_get_product_variantRichard W.M. Jones2011-03-232-0/+26
| | | | | | | | | | This returns a product variant for inspected operating systems. In practice this is a useful way to distinguish between consumer and enterprise/server versions of Windows that otherwise have the same version number. Notes: Labels: feature
* inspect: Don't fail for Windows guests with multiple disks (RHBZ#674130).Richard W.M. Jones2011-03-222-2/+15
| | | | | Notes: Labels: bugfix, RHBZ#674130 Depends: 5776c145d411e5ae00072ecf422055f3d0bd29e2
* inspect: Simplify Windows root heuristic code.Richard W.M. Jones2011-03-221-12/+38
| | | | | | | | | Add special is_file_nocase and is_dir_nocase functions and remove the duplicate checks for files and directories with different cases. Notes: Labels: codemotion
* guestfs(3): 'kernel' -> 'supermin appliance'.Richard W.M. Jones2011-03-191-4/+4
|
* guestfs(3): Indent line to keep code together.Richard W.M. Jones2011-03-191-1/+1
|
* proto: Fix both-ends-cancel case.Richard W.M. Jones2011-03-182-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case where both ends cancel at the same time (eg. both ends realize there are errors before or during the transfer), previously we skipped sending back an error from the daemon, on the spurious basis that the library would not need it (the library is cancelling because of its own error). However this is wrong: we should always send back an error message from the daemon in order to preserve synchronization of the protocol. A simple test case is: $ guestfish -N fs -m /dev/sda1 upload nosuchfile / libguestfs: error: open: nosuchfile: No such file or directory libguestfs: error: unexpected procedure number (66/282) (Notice two things: there are errors at both ends, and the loss of synchronization). After applying this commit, the loss of synchronization does not occur and we just see the library error: $ guestfish -N fs -m /dev/sda1 upload nosuchfile / libguestfs: error: open: nosuchfile: No such file or directory The choice of displaying the library or the daemon error is fairly arbitrary in this case -- it would be valid to display either or even to combine them into one error. Displaying the library error only makes the code considerably simpler. This commit also (re-)enables a test for this case.
* proto: Don't drop outgoing message when daemon cancels (RHBZ#576879).Richard Jones2011-03-181-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a (potential) fix for the long standing protocol bug which causes loss of synchronization when a FileIn action fails very early on the daemon side. The canonical example would be the 'upload' action failing immediately if no filesystem is mounted. What's supposed to happen is this: (1) library sends request message (2) daemon processes request first chunk of data and sees that it will fail, sends cancellation (3) discards chunks of data (4) library sees daemon cancellation and stops sending chunks It was going wrong in step (1), in guestfs___send_to_daemon. In some (timing related) circumstances, send_to_daemon could receive the cancellation before sending the first chunk, at which point it would exit, *discarding the first chunk*. This causes the daemon to fail in step (3) since it reads the next request as if it was a chunk, thus losing synchronization. (The protocol specifies that you always have to send at least one chunk if there is a FileIn or FileOut parameter). The patch changes guestfs___send_to_daemon so that if it detects cancellation, it sends the remaining data in its output buffer instead of discarding it. (This also fixes another edge case to do with sending partial data although I don't think we ever saw that in practice).
* proto: Improve debug messages.Richard W.M. Jones2011-03-181-9/+58
|
* New event API (RHBZ#664558).Richard W.M. Jones2011-03-159-210/+734
| | | | | | | | | | | | | 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.
* New APIs: guestfs_first_private, guestfs_next_private to walk overRichard W.M. Jones2011-03-153-4/+139
| | | | | | | | the private data area. This commit adds new APIs for walking over the keys and pointers in the private data area associated with each handle (note this is only applicable to the C API).
* check the pid is > 0 before calling waitpid()Angus Salkeld2011-03-151-1/+1
| | | | Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
* check the pid is > 0 before calling waitpid()Angus Salkeld2011-03-141-1/+1
| | | | Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
* RHEL5: Make use of 'futimens' function optional.Richard W.M. Jones2011-03-111-0/+4
|
* Detect Red Hat Desktop as 'rhel' distro (RHBZ#682979).Richard W.M. Jones2011-03-081-3/+3
| | | | | | | | | | | | | /etc/redhat-release on Red Hat Desktop contains the following string: Red Hat Desktop release 4 (Nahant Update 8) Previously we matched against the string "Red Hat Enterprise Linux" but since this does not contain that string, this distro wasn't being detected correctly. Note this also changes the obsolete Perl code, for the benefit of virt-v2v.
* Fix inspection code when PCRE or hivex is missing.Richard W.M. Jones2011-03-031-0/+24
|
* Add documentation for attach method.Richard W.M. Jones2011-02-032-1/+59
|
* Add guestfs_add_domain 'live' flag.Richard W.M. Jones2011-02-031-25/+167
| | | | | | | | | | This optional flag controls whether this API call will try to connect to a running virtual machine 'guestfsd' process. If the flag is given and the virtual machine is running, then the libvirt XML is parsed looking for a suitable <channel> element, and 'guestfs_set_attach_method' is called with the corresponding virtio-serial socket path.
* lib: Implement attach-method unix:<path>Richard W.M. Jones2011-02-032-9/+95
| | | | | | | | | | | | | | | | | | | | | | | | | Allow connections to a Unix domain socket which is connected (via virtio-serial) to a guestfsd running free in an existing guest. In order to use this you have to add the following element to the libvirt XML: <channel type='unix'> <source mode='bind' path='/tmp/socket'/> <target type='virtio' name='org.libguestfs.channel.0'/> </channel> (or perform the equivalent on the qemu command line). Then in guestfish, you can do: guestfish \ attach-method unix:/tmp/socket : \ run : \ ll / (or any other commands as desired).
* New APIs: set-attach-method, get-attach-method.Richard W.M. Jones2011-02-032-0/+51
| | | | | | | | | | These allow you to get and set the attach method. The format is one of: * appliance * unix:<path> It's stored broken out into an enum and a string in the handle.
* lib: Move appliance launching to separate function.Richard W.M. Jones2011-02-031-14/+24
| | | | This is just code motion.
* perl: Translate C examples into Perl and include a manual page.Richard W.M. Jones2011-01-301-1/+1
|
* lib: Fix use-after-free bug in XPath parsing code.Richard W.M. Jones2011-01-281-1/+1
|
* Add a new internal-autosync API to perform autosync.Richard W.M. Jones2011-01-282-5/+3
| | | | | | | | | Instead of explicitly calling umount-all; sync, we add a daemon function called internal-autosync which does the same. Apart from slightly simplifying the process of closing the handle, the main advantage is we can modify the daemon for the standalone case so that internal-autosync does not do the umount-all operation.
* Use /var/tmp for the cached appliance (for FHS compliance).Richard W.M. Jones2011-01-194-4/+24
| | | | | | | | | | | | | | | | The FHS advises large files not to be stored in the root filesystem[1], and that /var/tmp is persistent across reboots[2] (whereas /tmp is possibly not[3]). Therefore we should store the large cached supermin appliance in /var/tmp instead of /tmp. /tmp is still used for all other temporary files and directories. In either case you can override this by setting $TMPDIR. [1] http://www.pathname.com/fhs/pub/fhs-2.3.html#THEROOTFILESYSTEM [2] http://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARYFILESPRESERVEDBETWEE [3] http://www.pathname.com/fhs/pub/fhs-2.3.html#TMPTEMPORARYFILES
* Add ability to inspect install disks and live CDs.Richard W.M. Jones2011-01-153-39/+563
| | | | | For examples of the virt-inspector output, see the additional inspector/example-*.xml files in this commit.
* inspect: Add macros for file size limits.Richard W.M. Jones2011-01-151-9/+37
| | | | | | This also bumps the file size limit for "small text files" up to 2 MB, since we want to parse Windows CD txtsetup.sif files that are usually around 500K in size.
* New API: resize2fs-M to resize ext2/3/4 to minimum size.Nikita A Menkovich2011-01-141-1/+1
|
* Add logo used on the website.Richard W.M. Jones2011-01-111-0/+4
|
* New tools: virt-copy-in, virt-copy-out, virt-tar-in, virt-tar-out.Richard W.M. Jones2011-01-031-1/+7
| | | | | Relatively trivial wrappers around the equivalent guestfish commands. Change also includes new man pages.
* docs: Refresh programming language list in guestfs(3).Richard W.M. Jones2010-12-301-5/+5
|
* docs: Refresh programming language equivalence example in guestfs(3).Richard W.M. Jones2010-12-301-3/+3
|
* docs: Fix missing g handle in guestfs(3) man page.Richard W.M. Jones2010-12-301-2/+2
|
* docs: Refresh guestfs(3)/DOWNLOADING.Richard W.M. Jones2010-12-301-4/+3
|
* docs: Refresh guestfs(3)/MOUNTINGRichard W.M. Jones2010-12-301-9/+15
|
* docs: Update API support.Richard W.M. Jones2010-12-1911-6/+4201
|