summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* inspection: Temporary logo for Windows 8.HEADmasterRichard W.M. Jones2012-11-301-0/+50
| | | | | | | | | | | | | | See the comment from the code: NB about Windows 8: No location we've found so far contains a suitable icon for Win8. In particular, explorer.exe definitely does *not* contain any Windows logo as a resource (I checked). Therefore the "basket icon" that this produces is just a stand-in until we have a better idea for solving this problem. and: https://bugzilla.redhat.com/show_bug.cgi?id=801117
* inspection, virt-sysprep: Use /etc/hostname on F18+, RHEL7+ (RHBZ#881953, ↵Richard W.M. Jones2012-11-301-7/+8
| | | | RHBZ#858696).
* inspection: Don't probe partitions when we've probed the whole device ↵Richard W.M. Jones2012-11-291-0/+31
| | | | | | | (RHBZ#798979). So we don't get multiple <operatingsystem> entries, particularly for install ISOs.
* inspection: Read libosinfo database in order to inspect OS install ↵Richard W.M. Jones2012-11-295-10/+714
| | | | CD/DVD/ISOs (RHBZ#803650, RHBZ#805417).
* lib: Indent CFLAGS in Makefile.am.Richard W.M. Jones2012-11-291-6/+6
| | | | This is just a whitespace change.
* inspection: Move variable decls to top of function.Richard W.M. Jones2012-11-291-3/+5
| | | | This is just code motion.
* inspection: Implement "openbsd" type and distro.Richard W.M. Jones2012-11-292-0/+4
|
* lib: lpj: Refactor code.Richard W.M. Jones2012-11-261-27/+45
| | | | Only run one grep command to grep any number of files.
* lib: lpj: Only return first match in read_all function.Richard W.M. Jones2012-11-261-1/+2
| | | | | If there where several lpj=.. matches then the earlier matches would be leaked. Only return the first one and don't leak memory.
* lib: Get lpj= from /var/log/boot.msg (thanks Olaf Hering).Richard W.M. Jones2012-11-251-1/+15
|
* launch: appliance: Handle non-\0 terminated buffer correctly.Richard W.M. Jones2012-11-241-1/+1
| | | | | | | | | | | | | | The read_all function is used as a callback for guestfs___cmd_set_stdout_callback (cmd, read_all, [str], CMD_STDOUT_FLAG_WHOLE_BUFFER); As noted in the documentation for CMD_STDOUT_FLAG_WHOLE_BUFFER, the buffer returned is not \0-terminated, and so using memdup will create an unterminated string, and therefore potentially a memory overrun when reading or searching the string. Use strndup instead so the final string is \0-terminated.
* appliance: Pass lpj=... on the appliance command line (thanks Marcelo Tosatti).Richard W.M. Jones2012-11-246-4/+171
| | | | | | | | | | | | | | | | | | | | | Try to get the host's loops_per_jiffy value and pass this on the command line to the guest. In theory this should avoid the appliance having to recalculate this value in a VM with TCG (which is generally error-prone). This should avoid timing issues. We only do this when we are certain that the guest will be TCG. Currently we only have enough information to do this from the libvirt attach-method. So mostly this will only affect people using Fedora in a VM. The host loops_per_jiffy value is not exported by the kernel. It is only printed by the kernel early during boot, so if boot messages have "scrolled off" the kernel ring buffer, it won't be available. Some operating systems save early kernel messages in /var/log/dmesg but (a) Fedora 18+ seem to have abandoned this file and (b) on Ubuntu this file is unreadable for spurious "security" reasons. I have submitted a patch to make lpj available through /proc/cpuinfo.
* launch: libvirt: Refactor parameter passing to construct_libvirt_xml* functions.Richard W.M. Jones2012-11-241-100/+118
| | | | This is just code motion.
* launch: Refactor duplicate code which constructs the appliance command line.Richard W.M. Jones2012-11-234-67/+62
| | | | Move this into a common file.
* lib: Fix memory leak and simplify command code.Richard W.M. Jones2012-11-236-38/+16
| | | | | | | | | | | | | | | | | | | Fix the following memory leak found by valgrind: ==13629== 498 (112 direct, 386 indirect) bytes in 1 blocks are definitely lost in loss record 99 of 110 ==13629== at 0x4A06B2F: calloc (vg_replace_malloc.c:593) ==13629== by 0x4CA564E: guestfs_safe_calloc (alloc.c:71) ==13629== by 0x4CA9B02: guestfs___new_command (command.c:143) ==13629== by 0x4CA66E9: guestfs___build_appliance (appliance.c:690) ==13629== by 0x4CBD1B9: launch_libvirt (launch-libvirt.c:188) ==13629== by 0x402E7E: main (virt-filesystems.c:349) Also adjust the command code in several places to make it simpler. We can almost always call guestfs___cmd_close right after guestfs___cmd_run, avoiding any need to close the handle along error paths. Tested by running the test suite under valgrind.
* New APIs: Implement Linux filesystem capabilities.Richard W.M. Jones2012-11-221-1/+1
| | | | | | This adds the following new APIs: - cap_get_file - cap_set_file
* New APIs: Implement POSIX ACLs.Richard W.M. Jones2012-11-221-1/+1
| | | | | | | This adds the following new APIs: - acl_get_file - acl_set_file - acl_delete_def_file
* Update API support.1.19.62Richard W.M. Jones2012-11-203-0/+1881
|
* Add Lua bindings.Richard W.M. Jones2012-11-171-0/+7
| | | | | | | | These are relatively complete, although only lightly tested. Missing: - events - last_errno - user_cancel
* tests: Add 'make check-slow' rule to recursively run slow/long-running tests.Richard W.M. Jones2012-11-131-0/+4
|
* tests: Replace 'make extra-tests' with individual tests.Richard W.M. Jones2012-11-131-8/+53
| | | | | | | | | | | | | | | | | | | | | | | | | 'make extra-tests' was a monolithic set of tests that did all sorts of things: valgrind, tests over local guests, tests with upstream qemu, tests with upstream libvirt, tests with the appliance attach method. This made it hard to perform individual tests, eg. just valgrind testing. It was also hard to maintain because the tests were not located in the same directories as the programs and sometimes duplicated tests that were run elsewhere. This commit splits up 'make extra-tests' into 5 separate targets: make check-valgrind # run a subset of tests under valgrind make check-valgrind-local-guests # test under valgrind with local guests make check-with-appliance # test with attach-method == appliance make check-with-upstream-qemu # test with an alternate/upstream qemu make check-with-upstream-libvirt # test with an alternate/upstream libvirt (You can also still run 'make extra-tests' which is now simply a rule that runs the above 5 targets in order). This replaces everything that was in the tests/extra directory, so that has now gone.
* Various fixes to API support script.Richard W.M. Jones2012-11-1211-49/+5373
| | | | | Remove internal structures, fix it so it works with the new code layout under src/
* lib: Split up huge src/guestfs.c into logical compilation units.Richard W.M. Jones2012-11-128-540/+669
| | | | | | | | | | | | | | | | | | | This file had grown by accretion to include: - code related to handles (now in src/handle.c) - safe allocation (src/alloc.c) - debug, errors, warnings (src/errors.c) - private data (src/private-data.c) - miscellaneous functions (src/canonical-name.c, src/utils.c) This commit also removes about a dozen #include files which were probably not really used. This is just code motion.
* lib: Fix memory leak in tmpdir/cachedir code (found by valgrind).Richard W.M. Jones2012-11-101-0/+3
| | | | This fixes commit 1efed122c07792f4c66a4083159cfacfb1893212.
* lib: Modify library code to use guestfs_{push,pop}_error_handler.Richard W.M. Jones2012-11-095-34/+33
| | | | | This is less efficient than directly manipulating g->error_cb, but easier to maintain.
* lib: Add new C API calls: guestfs_push_error_handler,Richard W.M. Jones2012-11-093-11/+89
| | | | | | | | | | | | | | | | | guestfs_pop_error_handler. The addition of these calls makes it much simpler to temporarily disable or ignore errors: guestfs_push_error_handler (g, NULL, NULL); guestfs_mkdir (g, "/foo"); /* We don't care if this fails. */ guestfs_pop_error_handler (g); Note these calls are used by the C API only. They are not necessary in other languages, because those map errors to exceptions. The subsequent commits change existing code to use push/pop instead of laboriously saving and restoring the error handler.
* lib: Break long line in definition of guestfs_set_error_handler.Richard W.M. Jones2012-11-091-1/+2
| | | | This is just a whitespace change.
* lib: Rework temporary and cache directory code.Richard W.M. Jones2012-11-099-117/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New APIs: set-tmpdir, get-tmpdir, set-cachedir, get-cachedir. The current code has evolved over time and has a number of problems: (a) A single environment variable ($TMPDIR) controls the location of several directories. (b) It's hard for the library user to predict which directory libguestfs will use, unless the user simulates the same internal steps that libguestfs performs. This commit fixes these issues. (a) Now three environment variables control the location of all small temporary files, and the appliance cache: For temporary files: $LIBGUESTFS_TMPDIR or $TMPDIR or /tmp. For the appliance cache: $LIBGUESTFS_CACHEDIR or $TMPDIR or /var/tmp. The user can also set these directories explicitly through API calls (guestfs_set_tmpdir and guestfs_set_cachedir). (b) The user can also retrieve the actual directories that libguestfs will use, by calling guestfs_get_tmpdir and guestfs_get_cachedir. These functions are also used internally. This commit also: - reworks the internal tmpdir code - removes the internal (undocumented) guestfs_tmpdir call (replacing it with calls to the documented guestfs_get_tmpdir API instead) - changes the ./run script to set LIBGUESTFS_TMPDIR and LIBGUESTFS_CACHEDIR - adds a test - fixes a few places like libguestfs-make-fixed-appliance which depended on $TMPDIR
* lib: When parsing environment, handle LIBGUESTFS_TRACE first.Richard W.M. Jones2012-11-091-4/+4
| | | | So that we can trace all the later calls.
* lib: debian support for package arch inspectionJohn Eckersberg2012-11-051-3/+8
|
* 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
|