summaryrefslogtreecommitdiffstats
path: root/src/launch.c
Commit message (Collapse)AuthorAgeFilesLines
* Change link, since PostgreSQL switched to using git.Richard W.M. Jones2011-08-071-1/+1
| | | | (cherry picked from commit 3cf31c2fe0b356ea5c04117c5235b0a3cfe34971)
* appliance: Capture stderr from qemu to the event system.Richard W.M. Jones2011-07-271-1/+9
| | | | (cherry picked from commit 8b2e60ce4b46e86da093ee64d4e0b0ae3c998d55)
* appliance: Document pipe fds.Richard W.M. Jones2011-07-271-0/+2
| | | | (cherry picked from commit 70daccfe4e9939078436c2830928d8e53432dd84)
* appliance: Use qemu -machine option where available (RHBZ#700369).Richard W.M. Jones2011-06-131-14/+23
| | | | (Cherry picked from commit 64841fe8957f798df12a38bd81843c7011f2c278)
* Fix guestfs___rollback_cmdline when pos == 0.Richard W.M. Jones2011-05-181-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. (cherry picked from commit 607aa95de927b5b8e4b212655c71bf21acbba372)
* internal: Use size_t instead of int for command line size.Richard W.M. Jones2011-05-181-4/+4
| | | | (cherry picked from commit 10167cea98f93a74abe63f0a54d3a662997e7489)
* Generate progress messages during launch.Richard W.M. Jones2011-04-011-0/+35
| | | | | | | | | | | | | | | | | | | 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).
* Add prototype for timeval_diff.Richard W.M. Jones2011-04-011-1/+2
| | | | This is just code motion.
* Rename $tmpdir/sock to $tmpdir/guestfsd.sock.Richard W.M. Jones2011-03-251-5/+5
| | | | | | | | No functional change; this simply makes the purpose of the socket clearer. Notes: Labels: cleanup
* New event API (RHBZ#664558).Richard W.M. Jones2011-03-151-14/+24
| | | | | | | | | | | | | 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.
* check the pid is > 0 before calling waitpid()Angus Salkeld2011-03-141-1/+1
| | | | Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
* lib: Implement attach-method unix:<path>Richard W.M. Jones2011-02-031-1/+84
| | | | | | | | | | | | | | | | | | | | | | | | | 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).
* lib: Move appliance launching to separate function.Richard W.M. Jones2011-02-031-14/+24
| | | | This is just code motion.
* Use /var/tmp for the cached appliance (for FHS compliance).Richard W.M. Jones2011-01-191-0/+18
| | | | | | | | | | | | | | | | 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
* Remove several unused local variables.Richard W.M. Jones2010-12-101-1/+0
| | | | (Revealed by compiling under Debian where this is a warning).
* New API: debug-cmdline for printing QEMU command line (internal only).Richard W.M. Jones2010-11-101-0/+24
| | | | | This is an internal-only debugging API so may be changed or removed at any time in the future.
* Add internal facility to checkpoint and roll back the command line.Richard Jones2010-11-101-0/+20
| | | | | This internal interface can be used to ensure that certain operations are atomic.
* New internal function guestfs___print_timestamped_argvMatthew Booth2010-10-281-24/+24
| | | | | | | This function generalises the existing print_cmdline used to output the qemu command line to output any given command line, and exports it to other modules. It also adds a timestamp to the old print_cmdline output for consistency with guestfs___print_timestamped_message.
* Fix networking in the appliance.Matthew Booth2010-10-271-1/+1
| | | | | | | | | | Commit 4963be85 re-introduced networking to the appliance, but didn't configure the custom network the appliance expects since we switched to link local addressing. This patch configures QEMU to use the custom network again. Note that you still need to use guestfs_set_network (g, 1) to enable user networking.
* generator: Optional arguments, add-drive-opts (RHBZ#642934,CVE-2010-3851).Richard W.M. Jones2010-10-221-39/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This large commit changes the generator so that optional arguments can be supported for functions. The model for arguments (known as the "style") is changed from (ret, args) to (ret, args, optargs) where optargs is a more limited list of arguments. One function has been added which takes optional arguments, it is "add-drive-opts", modelled as: (RErr, [String "filename"], #required [Bool "readonly"; String "format"; String "iface"]) #optional Note that this function is processed in the library (does not go over the RPC protocol to the daemon). This has allowed us to simplify the current implementation by omitting changes related to RPC or the daemon, although we plan to add these at some point in the future. From C this function can be called in 3 different ways as in these examples: guestfs_add_drive_opts (g, filename, GUESTFS_ADD_DRIVE_OPTS_READONLY, 1, GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -1); (the argument(s) between 'filename' and '-1' are the optional ones). guestfs_add_drive_opts_va (g, filename, args); where 'args' is a va_list. This works like the first version. struct guestfs_add_drive_opts_argv optargs = { .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK, .readonly = 1, } guestfs_add_drive_opts_argv (g, filename, &optargs); This last form lets you construct lists of optional arguments, and is used by guestfish and the language bindings. In guestfish optional arguments are used like this: add-drive-opts filename readonly:true In OCaml these are mapped naturally to OCaml optional arguments, eg: g#add_drive_opts ~readonly:true filename; In Perl these are mapped to extra arguments, eg: $g->add_drive_opts ($filename, readonly => 1); In Python these are mapped to optional arguments, eg: g.add_drive_opts ("file", readonly = 1, format = "qcow2") In Ruby these are mapped to a final hash argument, eg: g.add_drive_opts("file", {}) g.add_drive_opts("file", :readonly => 1) g.add_drive_opts("file", :readonly => 1, :iface => "virtio") In PHP these are mapped to extra parameters. This is not quite accurate since you cannot omit arbitrary optional parameters, but there's not much than can be done within the limitations of PHP as a language. Unimplemented in: Haskell, C#, Java.
* Allow $TMPDIR to override most temporary directory uses.Richard W.M. Jones2010-09-241-5/+5
| | | | | | | Be more consistent in allowing the user to override use of the temporary directory by specifying $TMPDIR. Also prefer P_tmpdir macro (defined in <stdio.h>) if that is defined, rather than hard-coding "/tmp" for the fallback location.
* leak: Appliance name was leaked during guestfs_launch.Richard W.M. Jones2010-09-211-0/+2
| | | | | | | This frees the string containing the name of the appliance which was previously being leaked during launch. (Found by valgrind).
* syntax: Remove unused ignore-value.h header.Richard Jones2010-09-101-1/+0
|
* syntax: Remove unused c-ctype.h header.Richard Jones2010-09-101-1/+0
|
* syntax: Use spaces instead of tabs for indentation.Richard Jones2010-09-101-1/+1
|
* Add -nodefconfig command line option to qemu.Daniel Berrange2010-08-241-0/+3
| | | | | Without this option, qemu will read some defaults from /etc/qemu/ configuration files.
* New APIs: set-network and get-network to enable network support.Richard Jones2010-08-241-0/+8
| | | | guestfs_set_network (g, true) enables network support in the appliance.
* Use virtio-serial, remove other vmchannel methods.Richard Jones2010-08-241-267/+56
| | | | | | | | | | | | | This adds support for virtio-serial, and removes all other vmchannel methods. Virtio-serial is faster than other methods, and is now widely available. I tested this by using the guestfs_upload API on an 83 MB file: before: 6.12 seconds (14.1 MB/sec) after: 4.20 seconds (20.6 MB/sec) (note this is with the current 8K chunk size)
* Change to using ext2-based, cached supermin appliance.Richard Jones2010-08-231-184/+26
| | | | | | | | | | | | This changes the method used to build the supermin appliance to use the new ext2-based appliance supported by latest febootstrap. The appliance can also be cached, so we avoid rebuilding it each time it is used. Mailing list discussion goes into the rationale and details: https://www.redhat.com/archives/libguestfs/2010-August/msg00028.html Requires febootstrap >= 2.8.
* Make print_timestamped_message into a cross-module function.Richard Jones2010-08-231-6/+5
| | | | This is just code movement.
* Factor out code for locating the temporary directory.Richard Jones2010-08-231-11/+21
| | | | This is just code movement.
* Rename internal functions.Richard Jones2010-07-281-2/+2
| | | | | | | This is an update to commit 41f25ab3df5f306ac717fa7a6efd58328d30c1ae. Internal functions should be named guestfs___* (3 underscores) to avoid clashing with the implementation of actions (2 underscores).
* Rearrange library code into separate files.Richard Jones2010-07-271-0/+1250
We split the library code into these separate files: - guestfs.c: creating handles, closing handles, handle-related variables - actions.c: generated library-side stubs for each action - bindtests.c: generated code to test bindings - launch.c: launching the appliance - proto.c: the library side of the daemon communications protocol This is just code movement.