summaryrefslogtreecommitdiffstats
path: root/src/guestfs-internal.h
Commit message (Collapse)AuthorAgeFilesLines
* Allow compilation without hivex (RHBZ#723474).Richard W.M. Jones2011-10-211-2/+3
|
* inspect: Add drive naming hintsMatthew Booth2011-10-191-0/+1
| | | | | | | | | | | We currently use a heuristic to guess how drive names we find referenced in the guest map to drive names in the appliance. If this heuristic fails it can cause inspection to fail. This change adds a new 'name' option to add_drive_opts, which allows the user to explicitly pass the name of a drive to libguestfs if it is known. This change also updates the fstab-parsing inspection code to use this information if it is available.
* launch: Store drive information in guestfs_hMatthew Booth2011-10-191-2/+17
| | | | | | | | | | | | | | | | | | This is a NFC on its own, but provides a place-holder for drive metadata which can be used after launch. Fixes by RWMJ: - Fix the tests: this requires a new internal function 'debug-drives' that dumps out the g->drives information so it can be checked in two of the tests. Previously these tests used 'debug-cmdline'. - Test file existence / use_cache_off in the add_drive_opts function, not when launching qemu in the child process. - Call free along error paths. - Add comments.
* Add basic support for netbsd detection.Michael Scherer2011-10-141-0/+3
|
* Add support for pkgsrc, default NetBSD package manager.Michael Scherer2011-10-141-1/+2
| | | | | | For now, only detect the tool, but support from reading installed package could be added later ( may require either a package of pkgsrc, or a smaller tool to read the db ).
* Add Opensuse and zypper detection supportMichael Scherer2011-10-141-0/+2
| | | | This would also erronously detect SLES as Opensuse.
* Detect Mageia distributionMichael Scherer2011-10-141-0/+1
|
* Add systemtap/DTrace probes.Richard W.M. Jones2011-10-101-0/+20
| | | | | Mainly this is a documentation change. However a sample of DTrace-compatible userspace probes are also added.
* New API: set-smp, get-smpRichard W.M. Jones2011-09-281-0/+2
| | | | | | | These calls allow you to change the number of virtual CPUs assigned to the appliance. This also adds a --smp option to virt-rescue.
* inspection: Add support for ttylinux (a minimal Linux).Richard W.M. Jones2011-09-161-0/+1
|
* Remove guestfs___print_timestamped_argv.Richard W.M. Jones2011-08-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | This function was used to print the qemu and febootstrap-supermin-helper command lines. Unfortunately in the qemu case it was used incorrectly: it called the internal debug function (ie. event API callback) from the forked qemu subprocess, which meant that higher level event callbacks might have been invoked from the child process. To fix this, convert the qemu case into a new function called print_qemu_command line which just prints the command line directly to stderr. This is called after stderr has been redirected into the pipe to the main process. Thus the qemu command line will be marshalled into the event API along with other qemu and appliance output. After fixing this, only one use of guestfs___print_timestamped_argv remained, for printing the febootstrap-supermin-helper command line. This is converted to a local function print_febootstrap_command_line. Also print_febootstrap_command_line is now called before we fork febootstrap-supermin-helper, so that messages no longer overlap.
* inspection: Better checking for Windows root disks (RHBZ#729075).Richard W.M. Jones2011-08-081-0/+3
| | | | | | | | | | | | | | | | | Previously any disk that had /autoexec.bat or /boot.ini or /ntldr would be picked up as a candidate for a Windows root disk. If further checking could not find any systemroot (eg. /windows) then this would result in complete failure of inspection. In particular, this got confused by Hp_recovery partitions which have /autoexec.bat, but don't have a systemroot in one of the usual places (they have /MiniNT instead). What we do now is to properly investigate all possible systemroot places before deciding this is a Windows systemroot, so the subsequent failure cannot occur. (Thanks to lorimar for reporting this bug).
* Require PCRE library.Richard W.M. Jones2011-07-251-7/+1
| | | | This library is widely available in distros.
* Add user cancellation to the C API.Richard W.M. Jones2011-07-151-0/+5
| | | | | | | | | This allows long transfers (FileIn and FileOut operations) to be cancelled by calling the signal and thread safe guestfs_user_cancel function. Most of this commit consists of a multithreaded program that tests user cancellation of uploads and downloads.
* New APIs: set-pgroup, get-pgroupRichard W.M. Jones2011-07-151-0/+2
| | | | | | | | | | | If the pgroup flag is set in the handle, then the qemu and recovery subprocesses are placed in separate process groups. The default is false. The purpose for setting up a process group is that ^C will not be passed from the main process down to these processes (killing them). This allows ^C and other keyboard events to be caught and handled in the main process.
* New API: inspect-get-icon returns the guest icon.Richard W.M. Jones2011-06-281-0/+3
| | | | | | | | | | This API returns the guest's favicon if found, else an icon representing the guest operating system. Currently supported by this patch: Fedora, RHEL and derivatives, Debian (but not Ubuntu), Windows XP, Windows 7. This also updates virt-inspector to include an <icon> element containing the icon in base64 encoding.
* Change download_to_tmp so it can work with multi-root operating systems.Richard W.M. Jones2011-06-281-1/+1
| | | | | | | | | | | | | | | | The previous guestfs___download_to_tmp function did not handle multiboot correctly. In particular it used the same cache name for downloaded files from different roots, which could have caused things like applications in each root to be confused. This changes the function so that the cache filename is prefixed with the root / fs number, eg. $tmpdir/0-Name instead of $tmpdir/Name. This change also requires the function to return the new name, so all places in the code which called this function had to be updated. This updates and fixes commit 3c1f762abed92f7a358f3bc93e3396d0606b18ad.
* internal: Use size_t instead of int for command line size.Richard W.M. Jones2011-04-301-3/+3
|
* inspect: "centos" and "scientificlinux" are now separate distros.Richard W.M. Jones2011-04-211-0/+2
| | | | Previously we returned "rhel" for these, which was not accurate.
* inspect: Get version and release of RPM packages.Richard W.M. Jones2011-04-141-2/+6
| | | | | | | | | | 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-141-0/+2
| | | | | | | | | | | 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-141-0/+40
| | | | | | | | | | | | | | | | | 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
* New API: inspect-get-drive-mappingsRichard W.M. Jones2011-04-051-0/+1
| | | | | | | | | | | | 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-051-0/+1
| | | | | | | | | | | | | | 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.
* Generate progress messages during launch.Richard W.M. Jones2011-04-011-0/+1
| | | | | | | | | | | | | | | | | | | 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).
* Shared function to send progress messages.Richard W.M. Jones2011-04-011-1/+3
| | | | This is just code motion.
* inspector: Add detection of Slackware.Richard W.M. Jones2011-03-251-0/+1
| | | | Notes: Labels: feature
* New API: guestfs_inspect_get_product_variantRichard W.M. Jones2011-03-231-0/+1
| | | | | | | | | | 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-221-0/+2
| | | | | Notes: Labels: bugfix, RHBZ#674130 Depends: 5776c145d411e5ae00072ecf422055f3d0bd29e2
* proto: Fix both-ends-cancel case.Richard W.M. Jones2011-03-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* New event API (RHBZ#664558).Richard W.M. Jones2011-03-151-10/+33
| | | | | | | | | | | | | 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-151-0/+1
| | | | | | | | 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).
* New APIs: set-attach-method, get-attach-method.Richard W.M. Jones2011-02-031-0/+6
| | | | | | | | | | 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.
* Use /var/tmp for the cached appliance (for FHS compliance).Richard W.M. Jones2011-01-191-0/+1
| | | | | | | | | | | | | | | | 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-151-0/+12
| | | | | For examples of the virt-inspector output, see the additional inspector/example-*.xml files in this commit.
* generator: Code to handle optional arguments in daemon functions.Richard W.M. Jones2010-12-021-1/+1
| | | | | | | | Previously we only supported optional arguments for library functions (commit 14490c3e1aac61c6ac90f28828896683f64f0dc9). This extends that work so that optional arguments can also be passed through to the daemon.
* protocol: Send progress_hint in header.Richard W.M. Jones2010-12-011-1/+1
| | | | | | For actions that have FileIn arguments, count the size of all the input files and send that in the progress_hint field of the request header.
* generator: trace mode prints return values.Richard W.M. Jones2010-11-171-0/+1
|
* New API: inspect-get-hostname to return the hostname of the guest.Richard W.M. Jones2010-11-161-0/+1
| | | | | This returns the hostname of the guest. Tested on RHEL, Fedora, Debian 5, Ubuntu 10.10, FreeBSD 8, Windows 7.
* inspect: Add support for Linux Mint and Mandriva.Richard Jones2010-11-151-0/+3
| | | | | | | | Linux Mint is derived from Ubuntu. Mandriva has a release file, but it also has /etc/lsb-release and the same parsing code can be reused. Mandriva has a package manager called urpmi.
* inspect: Inspection support for FreeBSD.Richard W.M. Jones2010-11-131-0/+2
| | | | | | | | | | This adds inspection support for FreeBSD. However this is not quite enough to allow guestfish -i freebsd.img to work, because guestfish will try to mount the filesystems, which cannot be done because Linux requires special mount options for the Universal Filesystem (UFS) used by *BSD. Nevertheless you can manually run the same commands.
* lib: Add match3 function.Richard W.M. Jones2010-11-131-0/+2
|
* lib: Add safe_asprintf function.Richard W.M. Jones2010-11-131-0/+3
|
* New APIs: inspect-get-package-format, inspect-get-package-management.Richard Jones2010-11-121-0/+21
| | | | This APIs reimplement some parts of virt-inspector in C.
* Don't need to include XDR headers in <guestfs.h>.Richard W.M. Jones2010-11-111-0/+3
| | | | | | | Include the XDR headers in the internal guestfs-internal.h instead. This is knock-on effects to several other source files which were implicitly relying on indirectly loaded headers.
* Add internal facility to checkpoint and roll back the command line.Richard Jones2010-11-101-0/+2
| | | | | This internal interface can be used to ensure that certain operations are atomic.
* lib: Make pcre, libmagic and hivex libraries optional.Richard Jones2010-11-101-0/+16
| | | | | | | | | | | | | | | This change makes these libraries optional. If they are not available at compile time then certain core API features will be disabled (see below). This also changes PCRE detection to use pkg-config instead of the ad hoc autoconf checks. The large inspect.c file has been split out into separate function-specific files. file-architecture: requires pcre & libmagic inspection: requires pcre & hivex
* lib: Expose errno through new API guestfs_last_errno.Richard W.M. Jones2010-11-031-1/+4
| | | | | | | If either the daemon sends back an errno, or a system call fails in the library, save the errno in the handle and then make it available to callers through the guestfs_last_errno function.
* Define internal safe_calloc shorthand.Richard W.M. Jones2010-11-031-0/+1
|
* inspect: Add support for MeeGo.stable-1.6Richard W.M. Jones2010-11-021-0/+1
|