summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite virt-edit in C.Richard W.M. Jones2011-05-091-0/+4
|
* Fix guestfs___rollback_cmdline when pos == 0.Richard W.M. Jones2011-05-081-1/+1
| | | | | | | | Because of the previous change to size_t, when pos == 0 the loop would wrap around and cause a segmentation fault. This fixes a regression introduced by commit 10167cea98f93a74abe63f0a54d3a662997e7489.
* add-domain: Add allowuuid flag to allow UUIDs to be used for names.Richard W.M. Jones2011-05-061-1/+11
| | | | | | This makes a backwards-compatible change to the add-domain API. If the optional allowuuid flag is true then UUIDs can be used instead of names in the domain name parameter.
* add-domain: Suppress libvirt errors on stderr.Richard W.M. Jones2011-05-061-0/+12
| | | | | | | | | | | Install an error handler on the libvirt error connection so that errors are not printed on stderr (instead they go up through the usual libguestfs error mechanism). Unfortunately this doesn't suppress initial connection error messages to stderr. I cannot see how to do this without affecting the global libvirt error handler, which is not acceptable for a library to be doing.
* guestfs(3): Note that host file size limits affect guest disk limits.Richard W.M. Jones2011-04-301-0/+9
|
* guestfs(3): Refresh documentation for private data area keys.Richard W.M. Jones2011-04-301-5/+6
|
* guestfs(3): Document that old callback functions still work.Richard W.M. Jones2011-04-301-1/+2
|
* guestfs(3): Referenced section is above, not below.Richard W.M. Jones2011-04-301-1/+1
|
* guestfs(3): Refresh autosync gotcha documentation.Richard W.M. Jones2011-04-301-3/+3
|
* guestfs(3): Writing to a file descriptor, not just a pipe.Richard W.M. Jones2011-04-301-1/+1
|
* guestfs(3): Refresh documentation for guestfs_create, guestfs_close.Richard W.M. Jones2011-04-301-5/+12
|
* Add a trace message to guestfs_close.Richard W.M. Jones2011-04-301-0/+7
| | | | | | | | | | Only the "first half" (ie. the call) is traced, because by the time the function returns the handle has gone and there's no way to generate events. You should see: libguestfs: trace: close
* internal: Use size_t instead of int for command line size.Richard W.M. Jones2011-04-304-9/+9
|
* guestfs_close: Move local variables close to code that uses them.Richard W.M. Jones2011-04-301-3/+4
| | | | This is just code motion.
* guestfs_close: Remove unused local variable.Richard W.M. Jones2011-04-301-2/+1
|
* guestfs(3): Document limits.Richard W.M. Jones2011-04-271-23/+91
|
* inspect: Look for %systemroot%/system32 for Windows heuristic.Richard W.M. Jones2011-04-211-3/+3
| | | | | The virt-v2v transfer ISO had a /windows directory. The core inspection code thought this was a Windows root filesystem.
* list-applications: If software hive is missing, this is an error.Richard W.M. Jones2011-04-211-5/+5
| | | | | virt-inspector would exit silently if list-applications failed along this error path.
* inspect: "centos" and "scientificlinux" are now separate distros.Richard W.M. Jones2011-04-214-3/+79
| | | | Previously we returned "rhel" for these, which was not accurate.
* inspect: Get version and release of RPM packages.Richard W.M. Jones2011-04-142-12/+159
| | | | | | | | | | This commit downloads the Packages RPM database allowing us to find other details about installed RPM packages (via inspect-list-applications). This adds version and release. Epoch cannot yet be found. This commit also updates the Fedora example image so that it contains a dummy RPM Packages database with some data.
* inspect: Abstract out db_dump code for listing RPM applications.Richard W.M. Jones2011-04-144-81/+251
| | | | | | | | | | | There are two changes here: (1) The code for listing RPM applications ran db_dump and parsed the output. We abstract out that parsing code into a separate reusable module (src/dbdump.c). (2) The old db_dump parsing code used db_dump -p (printable) format. Instead use db_dump -k (hex) format so we can read binary fields.
* inspect: Split code into separate files.Richard W.M. Jones2011-04-148-2533/+2879
| | | | | | | | | | | | | | | | | The src/inspect.c file had grown rather large -- 3,500 lines. Split it across several files according to function. This is just moving code. After the split the files are more evenly divided: 536 src/inspect_apps.c 766 src/inspect.c 537 src/inspect_fs.c 404 src/inspect_fs_cd.c 785 src/inspect_fs_unix.c 535 src/inspect_fs_windows.c 3563 total
* inspect: Move shared PCRE match functions to separate file.Richard W.M. Jones2011-04-133-98/+128
| | | | This is just moving code around.
* inspect: Cache downloaded files in the handle g->tmpdir.Richard W.M. Jones2011-04-131-56/+72
| | | | | | | | | | | | | | | | | | During inspection we download various files such as the Windows 'software' and 'system' registries. Previously these were downloaded as temporary files and discarded immediately after use. This meant that the 'software' registry was being downloaded twice by virt-inspector (it's required once for basic OS inspection, and a second time to list Windows applications). This commit changes this so that these files are cached in g->tmpdir, and thus the second time we just reuse the file we've already downloaded. Callers shouldn't be relying on inspect-list-applications to reread the actual registry from the VM (unless you close and reopen the handle). It says in the documentation that the results of inspection may be cached in the handle.
* Remove temporary directory containing arbitrary files.Richard W.M. Jones2011-04-131-9/+40
| | | | | | | | In preparation for caching inspection information in the temporary directory (g->tmpdir), allow the temporary directory to contain arbitrary files, and remove all of them when the handle is closed. This just generalizes the previous method of cleaning up the tmpdir.
* Avoid warning about implicit declaration of strlen.Jim Meyering2011-04-131-0/+1
| | | | * src/events.c: Include <string.h>, for use of strlen.
* guestfs(3): Fix documentation for drive letters.Richard W.M. Jones2011-04-121-8/+7
| | | | We can now get drive letter mappings through the inspection API.
* 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
|