summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* generator: Split up huge src/actions.c into separate files.Richard W.M. Jones2012-11-021-2/+14
| | | | | | | | Split the functions according to a simple hash across C.nr_actions_files files (this number can be increased later if necessary). This is just code motion.
* generator: actions: Move variant functions to a separate file.Richard W.M. Jones2012-11-021-0/+2
| | | | This is just code motion.
* generator: actions: Move 3 helper functions to a separate file.Richard W.M. Jones2012-11-023-0/+120
| | | | This is just code motion.
* New API: mklost_and_foundRichard W.M. Jones2012-11-021-1/+1
|
* lib: Add inspect_list_applications2 method (RHBZ#859949)John Eckersberg2012-11-012-44/+100
| | | | | | RWMJ: - Fix memory leak in guestfs__inspect_list_applications wrapper. - Don't document app2_spare* fields.
* build: Source 'localenv' in top-level Makefile.Richard W.M. Jones2012-10-301-0/+35
| | | | Also document 'local*' files.
* generator: Move struct-freeing functions to a separate source file.Richard W.M. Jones2012-10-301-0/+2
| | | | This is just code motion.
* lib: update inspect_list_applications to return all installed RPMs ↵John Eckersberg2012-10-291-46/+71
| | | | | | | (RHBZ#859885). Note that because of RHBZ#859949, this will return two identical entries for RPMs which differ only by arch.
* docs: Review and clarify ERROR HANDLING section of guestfs(3).Richard W.M. Jones2012-10-251-14/+32
|
* launch: libvirt: Disable CPU host-model.Richard W.M. Jones2012-10-251-0/+8
| | | | | | See the comment in the change. This "fixes" commit f7a67914c03db6d4c75671793964954640af7892.
* launch: libvirt: Fix <cpu> element.Richard W.M. Jones2012-10-251-1/+6
| | | | | | | | | Use <cpu mode="host-model"> (not model=... which was a typo). Also set fallback=allow so that libvirt knows it can use another CPU model if it wants. This fixes commit 890a4fbc8740b9b2019885a866aa06bc82566a41.
* filearch: Use command mini-library to run external cpio command.Richard W.M. Jones2012-10-181-8/+14
|
* fuse: Use command mini-library to run the fusermount command.Richard W.M. Jones2012-10-181-61/+28
|
* info: Use command mini-library to run 'qemu-img info' commands.Richard W.M. Jones2012-10-181-133/+91
|
* inspect: Use command mini-library to parse the output of db_dump command.Richard W.M. Jones2012-10-181-78/+103
|
* inspect: Change icon code to use command mini-lib instead of system(3).Richard W.M. Jones2012-10-181-46/+73
|
* launch: libvirt: Use command mini-library to run qemu-img create command.Richard W.M. Jones2012-10-181-87/+17
|
* launch: appliance: Use command mini-library to parse output of qemu -help etc.Richard W.M. Jones2012-10-181-64/+48
|
* appliance: Use command mini-library to run febootstrap-supermin-helper ↵Richard W.M. Jones2012-10-181-157/+70
| | | | (RHBZ#713678)
* lib: Change guestfs___remove_tmpdir function to use command mini-library.Richard W.M. Jones2012-10-185-32/+23
|
* lib: Add a new 'command' mini-library for running external commands.Richard W.M. Jones2012-10-183-0/+771
| | | | | | | | | | | | | This is a wrapper or mini-library for running external command, loosely based on libvirt's virCommand interface. Amongst the advantages are: - Can redirect errors into the error log (RHBZ#713678). - Can redirect output into a callback function. - Handles shell quoting properly. - Safely resets signal handlers, closes file descriptors, etc. - Single place where we can implement other improvements in future.
* NEW API: mktempWanlong Gao2012-10-171-1/+1
| | | | | | | | | | | | | | | | Used to create temporary directory or file with an optional suffix. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Split this out into a new file (daemon/mktemp.c). - I don't see a reason to deprecate the mkdtemp function which works fine. Instead remove complex dir-making code from the new function. - Test and fix the patch (missing close(fd)).
* lib: Fix guestfs_create_flags example program in man page.Richard W.M. Jones2012-10-151-2/+4
| | | | This fixes commit 9466060201600db47016133d80af22eb38091a49.
* libvirt: auth: Some clarifications of the API from Dan Berrange.Richard W.M. Jones2012-10-151-19/+8
| | | | This updates commit d83d17e9dbfb24496a0841fc2aed436181ca0341.
* New APIs: guestfs_create_flags, guestfs_parse_environment,Richard W.M. Jones2012-10-153-72/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | guestfs_parse_environment_list. Add a new function for creating a handle: guestfs_h *guestfs_create_flags (unsigned flags [, ...]); This variant lets you supply flags and extra arguments, although extra arguments are not used at the moment. Of particular interest is the ability to separate the creation of the handle from the parsing of environment variables like LIBGUESTFS_DEBUG. guestfs_create does both together, which prevents us from propagating errors from parsing environment variables back to the caller (guestfs_create has always printed any errors on stderr and then just ignored them). If you are interested in these errors, you can now write: g = guestfs_create_flags (GUESTFS_CREATE_NO_ENVIRONMENT); if (!g) exit (EXIT_FAILURE); r = guestfs_parse_environment (g); if (!r) exit (EXIT_FAILURE); Also you can *omit* the call to guestfs_parse_environment, which creates a handle unaffected by the environment (which was not possible before). This commit also includes new (backwards compatible) changes to the OCaml, Perl, Python, Ruby and Java constructors that let you use the flags.
* Update API support.Richard W.M. Jones2012-10-1425-0/+14338
|
* New APIs: Model libvirt authentication events through the API.Richard W.M. Jones2012-10-136-3/+523
| | | | | | | | | | | | | | | | | | | | | This commit models libvirt authentication events through the API, adding one new event (GUESTFS_EVENT_LIBVIRT_AUTH) and several new APIs: guestfs_set_libvirt_supported_credentials guestfs_get_libvirt_requested_credentials guestfs_get_libvirt_requested_credential_prompt guestfs_get_libvirt_requested_credential_challenge guestfs_get_libvirt_requested_credential_defresult guestfs_set_libvirt_requested_credential See the documentation and example which shows how to use the new API. This commit also changes existing calls to virConnectOpen* within the library so that the new API is used. Also included is an example (but not a test, because it's hard to see how to automatically test the libvirt API).
* configure: Add --without-libvirt option.Richard W.M. Jones2012-10-131-6/+0
| | | | | | | | | | | Normally we check if libvirt is installed, and the default is still to do this. However having this option makes it simpler to check if a change to the code has broken the case where libvirt is not installed. In fact, this change revealed one such place, which is also fixed in this commit.
* docs: Make 'EVENTS' into its own =head1 section.Richard W.M. Jones2012-10-131-2/+6
| | | | | For some reason it was stuck under "CALLS WITH OPTIONAL ARGUMENTS", which made no sense.
* launch: libvirt: Make handle data conditional on HAVE_LIBVIRT.Richard W.M. Jones2012-10-132-11/+18
| | | | | | This means that we can use virConnectPtr and virDomainPtr instead of using void* types. In the case where libvirt support is disabled or not present, effectively nothing changes.
* lib: Rename src/libvirtdomain.c -> src/libvirt-domain.c.Richard W.M. Jones2012-10-132-1/+1
| | | | No change, just code motion.
* lib: Pointer arg to safe_memdup function should be const.Richard W.M. Jones2012-10-132-2/+2
|
* launch: libvirt: Always set <qemu:env> TMPDIR.Richard W.M. Jones2012-10-111-13/+16
| | | | | | | | If TMPDIR is not set, we must choose one, because otherwise libvirt will use a random TMPDIR: http://bugzilla.redhat.com/865464 The convenient guestfs___persistent_tmpdir function does everything needed in this case.
* docs: Fix documentation about hotplugging.Richard W.M. Jones2012-10-101-3/+2
|
* docs: Fully document all subdirectories of the source.Richard W.M. Jones2012-10-091-4/+17
|
* docs: Add overview to guestfs(3)/EXTENDING LIBGUESTFS.Richard W.M. Jones2012-10-091-3/+34
|
* launch: appliance is optionalOlaf Hering2012-10-091-8/+14
| | | | | | | | | | | | | | | | | # virt-filesystems -v -d 6326ad4e-5805-2ab4-1338-d1dad8c76162 --all libguestfs: libvirt version = 10002 libguestfs: [00000ms] connect to libvirt libguestfs: [00001ms] get libvirt capabilities libguestfs: [00234ms] build appliance libguestfs: [00234ms] create libvirt XML libguestfs: error: error constructing libvirt XML at "xmlTextWriterWriteAttribute (xo, BAD_CAST "file", BAD_CAST appliance)": No such file or directory libguestfs: closing guestfs handle 0x656270 (state 0) # ls -lh /usr/lib64/guestfs/* -rw-r--r-- 1 root root 13M Oct 8 16:15 /usr/lib64/guestfs/initramfs.x86_64.img -rw-r--r-- 1 root root 3.7M Oct 6 09:25 /usr/lib64/guestfs/vmlinuz.x86_64 Signed-off-by: Olaf Hering <olaf@aepfle.de>
* Add support for hotplugging (removing disks).Richard W.M. Jones2012-10-095-4/+98
| | | | | | | | New API: remove-drive. Note because of a bug in fuser, this only works with psmisc >= 22.20. This also updates the hotplugging tests.
* Add support for hotplugging (adding disks) to the libvirt attach-method.Richard W.M. Jones2012-10-085-20/+202
| | | | | | | | | | | | | When libvirt is used, we can allow disks to be hotplugged. guestfs_add_drive can be called after launch to hot-add a disk. When a disk is hot-added, we first ask libvirt to add the disk to the appliance, then we make an internal call into the appliance to get it to wait for the disk to appear (ie. udev_settle ()). Hot-added disks are tracked in the g->drives array. This also adds a test.
* launch: Add add_drive 'label' option.Richard W.M. Jones2012-10-086-7/+70
| | | | | | | | | | | | | | | | | | | | | New API: list-disk-labels Allow the user to pass an optional disk label when adding a drive. This is passed through to qemu / libvirt using the disk serial field, and from there to the appliance which exposes it through udev, creating a special alias of the device /dev/disk/guestfs/<label>. Partitions are named /dev/disk/guestfs/<label><partnum>. virtio-blk and virtio-scsi limit the serial field to 20 bytes. We further limit the name to maximum 20 ASCII characters in [a-zA-Z]. list-devices and list-partitions are not changed: these calls still return raw block device names. However a new call, list-disk-labels, returns a hash table allowing callers to map between disk labels, and block device and partition names. This commit also includes a test.
* launch: libvirt: Create qcow2 overlays for read-only drives and the appliance.Richard W.M. Jones2012-10-081-79/+219
| | | | | | | | | | | | | Instead of adding the snapshot=on option via <qemu:arg>, create qcow2 overlays for any read-only drives and the appliance using 'qemu-img create' + a temporary file. This is a workaround for missing support for <transient/> in libvirt's qemu driver. Also for the unpredictable way that libvirtd handles $TMPDIR: we want to control where the temporary disk is created. Currently it is also much slower, because qemu-img is slow. However we hope to fix qemu upstream.
* launch: Make g->drives into an array (was a linked list).Richard W.M. Jones2012-10-087-89/+113
| | | | Using an array simplifies the implementation of hotplugging.
* launch: Add private data pointer to the struct drive.Richard W.M. Jones2012-10-062-0/+6
| | | | This can be used by the attach-method, eg. for libvirt-only data.
* launch: add_null_drive: Force null drive to be writable.Richard W.M. Jones2012-10-061-0/+5
| | | | | Because we create a special file, there is no point forcing qemu to create an overlay as well. Save time by setting readonly = 0.
* launch: Rearrange code for adding drives to the g->drives list in the handle.Richard W.M. Jones2012-10-062-42/+62
| | | | This is just code motion.
* launch: libvirt: The drive 'iface' parameter is not yet supported.Richard W.M. Jones2012-10-031-0/+6
| | | | | We could add support, but at the moment return an error if the user tries to use the iface parameter.
* syntax: Use __PATTERNS__ instead of @PATTERNS@ in podwrapper man pages.Richard W.M. Jones2012-10-032-6/+6
| | | | | It is slightly dangerous to use @PATTERNS@, since these might be substituted by autoconf when they appear in Makefile.am files.
* inspection: Fix calls to case_sensitive_path (RHBZ#858126).Richard W.M. Jones2012-09-282-19/+29
| | | | | | | | | | | | | | | | | | | | | Don't assume that if guestfs_case_sensitive_path returns NULL, that it means the file does not exist. The (previously undefined) behaviour of case_sensitive_path was that a NULL return meant "either the file doesn't exist or some other error". However in commit 973581780d8a006f336684fef6762801402d775d this was changed so that if the last element of the path didn't exist, it was assumed to be a new file and the (non-NULL) path of the new file is returned. This change breaks code (including in libguestfs) which tries to use case_sensitive_path as a dual-purpose call to fix-up a path for Windows and test if the file exists. Such code should be rewritten so that it explicitly tests for file existence after calling case_sensitive_path. I examined all the calls to case_sensitive_path in libguestfs and modified them where necessary.
* run: Label tmp directory.Richard W.M. Jones2012-09-261-5/+0
| | | | | | | | | There's not really any point just documenting that people should label the tmp directory, when we can just label it. So change the ./run script so it calls chcon. However it's not a failure if chcon doesn't work. If SELinux is not installed or is disabled, then labelling will fail.
* docs: Link to guestfs-recipes(1) from intro in guestfs(3).Richard W.M. Jones2012-09-251-0/+2
|