summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* qemu: Move -nodefaults etc logically together.Richard W.M. Jones2012-05-141-13/+16
| | | | | | This is just code motion. (cherry picked from commit 157f6fb18b7197f688ea761a4e52cd39287024f2)
* arm: Set minimum LIBGUESTFS_MEMSIZE at 128.Richard W.M. Jones2012-05-141-1/+1
| | | | | | | | | For ARM Versatile ("versatilepb") architecture, memsize must be set to 256 (megabytes) else the appliance is unable to boot. Previously setting LIBGUESTFS_MEMSIZE=256 was not allowed. Versatile Express has larger limits. (cherry picked from commit a3718c6b8be9bcbfd1e753c699f030d1852bc26e)
* configure: Allow systemtap/DTrace userspace probes to be disabled.Richard W.M. Jones2012-05-141-2/+2
| | | | | | | | | | './configure --disable-probes' will disable these probes. Otherwise they are autodetected as before. The <sys/sdt.h> produces lots of errors when you try to compile with these probes enabled under clang, so it is necessary to provide a way to disable them for clang users. (cherry picked from commit a1680f03b7d38bf007d29ac23035e5af33736b0e)
* doc: Rewrite description section in man page guestfs(3).Richard W.M. Jones2012-05-011-31/+12
| | | | | | Make the introduction in the man page shorter and punchier, so it leads readers directly to other pages of interest. (cherry picked from commit 922052c70fdc66859c78bbc89a7817aad141862a)
* Move 'libguestfs.pc' (pkgconfig file) to src/ directory.Richard W.M. Jones2012-05-012-0/+17
| | | | | Since it describes the C library, it's better in the src/ directory. (cherry picked from commit bb73cf0941ba9d34eb2ecf82d10ecb5fc5d2362d)
* Check library still compiles without libvirt.Richard W.M. Jones2012-04-241-0/+2
| | | | (cherry picked from commit 5d6a323b9358bb01233681b784fa67414a5d2c6d)
* Don't abort inspection if mdadm.conf ARRAY doesn't have a uuidMatthew Booth2012-04-241-1/+1
| | | | (cherry picked from commit 4542401fee7a141204baea98dcdc9fa557878f85)
* inspection: Remove spurious warning for Ubuntu 10.04 with encrypted swap ↵Richard W.M. Jones2012-04-131-1/+1
| | | | | | (RHBZ#811872). (cherry picked from commit 96b6504b09461aeb6850bb2e7b870a0a4c2f5edf)
* docs: Add libguestfs-test-tool(1) to guestfs(3) man page.Richard W.M. Jones2012-04-111-1/+2
| | | | | Cherry picked from commit 307e8bc51a7416fa62ec43568cb8ba1876490a62 and modified to make it appropriate for the stable-1.16 branch.
* launch: Set error when qemu fails early during launch (RHBZ#811650).Richard W.M. Jones2012-04-111-1/+4
| | | | | | This caused the Python bindings (and probably others) to segfault because guestfs_last_error(g) would return NULL. (cherry picked from commit 0f7de2279a4af0bb259c9e36fca5e5c3aa835301)
* inspection: Support Fedora 17+ (RHBZ#809361).Richard W.M. Jones2012-04-031-2/+5
| | | | | | Recognize grub2 as a bootloader, and /bin being a symlink to /usr/bin (ie. UsrMove feature added in Fedora 17+). (cherry picked from commit 5c8a241e5cd119f436a050ddbbf7ea73f83ff8e4)
* Don't provoke -Wstrict-overflow warning from map_app_md_devices function.Richard Jones2012-03-301-2/+2
| | | | | Unclear if this is a real bug or not. (cherry picked from commit 3d174b39bff6118bca3068c20ff874924cbfa1fd)
* Work around -Wstrict-overflow warning on gcc 4.5.1.Richard Jones2012-03-301-1/+5
| | | | (cherry picked from commit f2fae5151f33e933f4d574dc4324b7a8a2ee393c)
* inspection: Set last errno to ENOTSUP when inspection APIs are not available.Richard W.M. Jones2012-03-211-1/+1
| | | | | | | | | | | | | | | | Previously there was no programmatic way to tell if inspection APIs were unavailable because they are not compiled in (because hivex isn't around). This contrasts with daemon APIs where the availability is covered by the guestfs_available API. Change the inspection APIs so that when they are not available, the last errno is set to ENOTSUP. (Note that ENOTSUP must be defined on all POSIX platforms). This allows programs to detect if they are using a version of libguestfs that was compiled without support for inspection, without having to parse error messages. (cherry picked from commit c7dff02ccbb6bbe505c73df5d83bea8afdc188c3)
* inspect: Fedora/RHEL CDs are multipart if totaldiscs > 1, not > 0.Richard W.M. Jones2012-03-161-1/+1
| | | | (cherry picked from commit 974dffc6769b732befe85bcd8f614b9600927631)
* inspect: Add comment documenting findings of RHEL 5, 6 install CDs.Richard W.M. Jones2012-03-161-0/+58
| | | | (cherry picked from commit 5749de39c2b44644662fb176784731bce851b828)
* inspect: Ignore missing HKLM\SYSTEM\MountedDevices (RHBZ#803664).Richard W.M. Jones2012-03-161-4/+6
| | | | | | | When a Windows guest doesn't have a HKLM\SYSTEM\MountedDevices node, inspection fails. However inspection should not completely fail just because we cannot get the drive letter mapping from a guest. (cherry picked from commit 91cede3465cd2496a01a89d5c8815df7c326c2ec)
* Fix strict-overflow bugs and reenable this warning.Richard W.M. Jones2012-03-131-3/+3
| | | | | | | | | In two places, we were counting things in an array using an 'int'. In theory, the int could overflow, so gcc determines this to be undefined behaviour. The fix is to use size_t or ssize_t instead. (cherry picked from commit d66dd2260c724bdfe57a8595aac37c8e9173cee5)
* inspect: Move variable decl to top of function.Richard W.M. Jones2012-03-131-1/+3
| | | | (cherry picked from commit 46d1280100b025de2a448331306e794d688748bd)
* lib: Remove some unused variables.Richard W.M. Jones2012-03-134-7/+1
| | | | (cherry picked from commit cd3f2986eee8dbadc8253d4c3462f7e214f1236d)
* lib: Use size_t for allocation size in safe realloc function.Richard W.M. Jones2012-03-132-2/+2
| | | | (cherry picked from commit b8cdf6c2b9d12df6acbe295fd75c8c59c8b7eec1)
* Close all file descriptors and remove all signal handlers in the recovery ↵Richard W.M. Jones2012-03-131-0/+25
| | | | | | | | | | | | | | | | | | process. If the parent process uses a pipe (or any fd, but pipes are a particular problem), then the recovery process would hold open the file descriptor(s) of the pipe, meaning that it could not be fully closed in the parent. Because the recovery process doesn't use exec(2), this wasn't avoidable even using FD_CLOEXEC. Avoid this by closing all file descriptors when starting the recovery process. After discussion with Dan Berrange, he points out that it's also a good idea to set signal handlers to the default after forking, so that any signal handlers set up in the parent don't affect the child. (cherry picked from commit f1f045adf8d00549dd3efa3619e1162f9004b61e)
* inspect_apps: Avoid double-close on error path (found by Coverity) ↵Richard W.M. Jones2012-03-081-0/+1
| | | | | | | | | (RHBZ#801298). Error: USE_AFTER_FREE: /builddir/build/BUILD/libguestfs-1.16.5/src/inspect_apps.c:392: freed_arg: "fclose" frees "fp". /builddir/build/BUILD/libguestfs-1.16.5/src/inspect_apps.c:404: deref_arg: Calling "fclose" dereferences freed pointer "fp". (cherry picked from commit 270daae52b6a96b4d05cbe03e0b31a0b2e4ac1ae)
* dbdump: Avoid double-close on error path (found by Coverity).Richard W.M. Jones2012-03-081-0/+1
| | | | | | | Error: USE_AFTER_FREE: /builddir/build/BUILD/libguestfs-1.16.5/src/dbdump.c:132: freed_arg: "pclose" frees "pp". /builddir/build/BUILD/libguestfs-1.16.5/src/dbdump.c:142: deref_arg: Calling "pclose" dereferences freed pointer "pp". (cherry picked from commit 3f3b08a6bc610ca0886e02972257dfcb633a9d40)
* daemon: proto: Close fd along error paths (found by Coverity).Richard W.M. Jones2012-03-081-0/+3
| | | | | | | | | | Error: RESOURCE_LEAK: /builddir/build/BUILD/libguestfs-1.16.5/src/proto.c:894: open_fn: Calling opening function "open". /builddir/build/BUILD/libguestfs-1.16.5/src/proto.c:894: var_assign: Assigning: "fd" = handle returned from "open(filename, 0)". /builddir/build/BUILD/libguestfs-1.16.5/src/proto.c:903: noescape: Variable "fd" is not closed or saved in function "read". /builddir/build/BUILD/libguestfs-1.16.5/src/proto.c:911: leaked_handle: Handle variable "fd" going out of scope leaks the handle. /builddir/build/BUILD/libguestfs-1.16.5/src/proto.c:918: leaked_handle: Handle variable "fd" going out of scope leaks the handle. (cherry picked from commit d0453c02545c825810fec6e5874c55d7ac5ec678)
* proto: Close file along error and cancel paths (found by Coverity).Richard W.M. Jones2012-03-081-1/+5
| | | | | | | | | | Error: RESOURCE_LEAK: /builddir/build/BUILD/libguestfs-1.16.5/src/proto.c:1125: open_fn: Calling opening function "open". /builddir/build/BUILD/libguestfs-1.16.5/src/proto.c:1125: var_assign: Assigning: "fd" = handle returned from "open(filename, 833, 438)". /builddir/build/BUILD/libguestfs-1.16.5/src/proto.c:1133: noescape: Variable "fd" is not closed or saved in function "xwrite". /builddir/build/BUILD/libguestfs-1.16.5/src/proto.c:1146: leaked_handle: Handle variable "fd" going out of scope leaks the handle. /builddir/build/BUILD/libguestfs-1.16.5/src/proto.c:1173: leaked_handle: Handle variable "fd" going out of scope leaks the handle. (cherry picked from commit 855aaf414af3b8c8ca1f722a589fd251cc8317ee)
* Check return values from calloc (found by Coverity).Richard W.M. Jones2012-03-081-25/+29
| | | | | | | | | | | | Error: NULL_RETURNS: /builddir/build/BUILD/libguestfs-1.16.5/src/inspect.c:417: returned_null: Function "calloc" returns null (checked 67 out of 81 times). /builddir/build/BUILD/libguestfs-1.16.5/src/inspect.c:417: var_assigned: Assigning: "ret" = null return value from "calloc". /builddir/build/BUILD/libguestfs-1.16.5/src/inspect.c:418: dereference: Dereferencing a null pointer "ret". [...] /builddir/build/BUILD/libguestfs-1.16.5/src/inspect.c:374: returned_null: Function "calloc" returns null (checked 67 out of 81 times). /builddir/build/BUILD/libguestfs-1.16.5/src/inspect.c:374: var_assigned: Assigning: "ret" = null return value from "calloc". /builddir/build/BUILD/libguestfs-1.16.5/src/inspect.c:375: dereference: Dereferencing a null pointer "ret". (cherry picked from commit 35d5be22b1c09c3a99b445f65453601ec25b9f60)
* Dead code: 'lvs' cannot be true here (found by Coverity).Richard W.M. Jones2012-03-081-1/+1
| | | | | | | | | | | | | | Remove dead code; however only comment it out since if we change the preceeding code we may need this line again. Error: DEADCODE: /builddir/build/BUILD/libguestfs-1.16.5/src/listfs.c:107: dead_error_condition: On this path, the condition "lvs" cannot be true. /builddir/build/BUILD/libguestfs-1.16.5/src/listfs.c:54: const: After this line, the value of "lvs" is equal to 0. /builddir/build/BUILD/libguestfs-1.16.5/src/listfs.c:91: const: After this line, the value of "lvs" is equal to 0. /builddir/build/BUILD/libguestfs-1.16.5/src/listfs.c:54: assignment: Assigning: "lvs" = "NULL". /builddir/build/BUILD/libguestfs-1.16.5/src/listfs.c:91: new_values: Noticing condition "lvs == NULL". /builddir/build/BUILD/libguestfs-1.16.5/src/listfs.c:107: dead_error_line: Execution cannot reach this statement "guestfs___free_string_list(...". (cherry picked from commit 109d3ad34aac8d50a1c02437928a64d9bad9f1a6)
* Ignore return values from some functions in guestfs_close (Coverity warning).Richard W.M. Jones2012-03-081-2/+3
| | | | | | | | | | | | | | | | | Error: CHECKED_RETURN: /builddir/build/BUILD/libguestfs-1.16.5/java/com_redhat_et_libguestfs_GuestFS.c:9552: example_assign: Assigning: "r" = return value from "guestfs_internal_autosync(g)". /builddir/build/BUILD/libguestfs-1.16.5/java/com_redhat_et_libguestfs_GuestFS.c:9555: example_checked: "r" has its value checked in "r == -1". /builddir/build/BUILD/libguestfs-1.16.5/ocaml/guestfs_c_actions.c:5584: example_assign: Assigning: "r" = return value from "guestfs_internal_autosync(g)". /builddir/build/BUILD/libguestfs-1.16.5/ocaml/guestfs_c_actions.c:5586: example_checked: "r" has its value checked in "r == -1". /builddir/build/BUILD/libguestfs-1.16.5/perl/Guestfs.xs:5990: example_assign: Assigning: "r" = return value from "guestfs_internal_autosync(g)". /builddir/build/BUILD/libguestfs-1.16.5/perl/Guestfs.xs:5991: example_checked: "r" has its value checked in "r == -1". /builddir/build/BUILD/libguestfs-1.16.5/python/guestfs-py.c:13702: example_assign: Assigning: "r" = return value from "guestfs_internal_autosync(g)". /builddir/build/BUILD/libguestfs-1.16.5/python/guestfs-py.c:13707: example_checked: "r" has its value checked in "r == -1". /builddir/build/BUILD/libguestfs-1.16.5/ruby/ext/guestfs/_guestfs.c:16000: example_assign: Assigning: "r" = return value from "guestfs_internal_autosync(g)". /builddir/build/BUILD/libguestfs-1.16.5/ruby/ext/guestfs/_guestfs.c:16001: example_checked: "r" has its value checked in "r == -1". /builddir/build/BUILD/libguestfs-1.16.5/src/guestfs.c:191: check_return: Calling function "guestfs_internal_autosync" without checking return value (as is done elsewhere 5 out of 6 times). /builddir/build/BUILD/libguestfs-1.16.5/src/guestfs.c:191: unchecked_value: No check of the return value of "guestfs_internal_autosync(g)". (cherry picked from commit 07a8c3c0c25974e0b9496966a7a1354be9ee844f)
* Comment change.Richard W.M. Jones2012-03-081-1/+1
| | | | (cherry picked from commit 4d8ae8f5a2e309a6a518fdb0b6f65685aa9137e0)
* Hide stderr of bmptopng.Richard W.M. Jones2012-03-081-2/+3
| | | | | This program is noisy on stderr. Send that to /dev/null. (cherry picked from commit e40f408faeea204417bc46024590a07272eeda92)
* build: Make netpbm and icoutils into proper optional dependencies.Richard W.M. Jones2012-03-081-4/+18
| | | | | | | | | Netpbm and icoutils (wrestool) have always been dependencies. Since they are not always present, make these into optional dependencies (which they were, sort of, before). Also document these dependencies in the README file. (cherry picked from commit 2c9c0525ebda105f37e6a6eea2307db4cb2f0a73)
* Whitespace change.Richard W.M. Jones2012-03-081-1/+1
| | | | (cherry picked from commit b106dda97c9e18563bb27a44a025016fef6dec97)
* Add a 'fixed' style of appliance.Richard W.M. Jones2012-03-031-3/+33
| | | | | | | | | | | This is just the 'kernel', 'initrd' and 'root' files, copied from one machine to another, along with a 'README.fixed' file which is also used for identification. This allows the appliance to be copied from one machine to another, making it easier for us to distribute a starter appliance for people who cannot get febootstrap or appliance-building working. (cherry picked from commit 5e8a4627d9f0d313485f186a63dc2250f6fd5c01)
* Rebrand 'ordinary appliance' as 'old-style appliance'.Richard W.M. Jones2012-03-032-8/+8
| | | | | This is just code motion. (cherry picked from commit 49726b9269490e331e740d55952da87552ca2500)
* appliance: Make appliance building thread-safe (RHBZ#790721).Richard W.M. Jones2012-03-011-1/+12
| | | | | | | | | | | | | | | | Appliance building can be called from multiple processes, but this is only safe if each process holds a lock on the 'checksum' file. However threads within a process are not excluded by a file lock, and so this strategy completely failed for a multithreaded program calling guestfs_launch in parallel. Since it makes no sense for threads in a single program to race each other to try to create the appliance, add a lock around appliance building. This serialises building the appliance, but the rest of guestfs_launch (eg. starting up qemu) can run in parallel. (cherry picked from commit afed7e493dcd594620f19b93e9fb73e58553f60a)
* docs: Note that JRuby should use the Java bindings.Richard W.M. Jones2012-02-101-0/+2
| | | | (cherry picked from commit 6ca8a2db6d6f1028a35ece616af44538074483fc)
* Enable running the daemon under valgrind.Richard W.M. Jones2012-01-242-0/+18
| | | | | | | | | | | | | | | | | | This commit allows you to run the daemon under valgrind. You have to enable it at configure time: ./configure --enable-valgrind-daemon This should *not* be done for production builds. When this feature is enabled, valgrind is added to the appliance and the daemon is run under valgrind. Log messages from valgrind are passed back over a virtio-serial channel into a file called 'valgrind.log.$PID' in the top build directory. Running 'make check', 'make extra-tests' etc causes many valgrind.log.* files to be created which must be examined by hand. (cherry picked from commit d08806adfc5d111b4b6c761540ff508d3f25b66e)
* API support: Fix src/api-support/added file.Richard W.M. Jones2012-01-231-470/+470
| | | | | This fixes commit 37e07db1598b433c12ee643302712d81b2c5415d. (cherry picked from commit 734b1f662f4e563cc8baad3aca8cf751314e0e49)
* Update API support.Richard W.M. Jones2012-01-2324-474/+11234
|
* gobject: Document these bindings in guestfs(3).Richard W.M. Jones2012-01-221-0/+7
|
* Tempus fugit.Richard W.M. Jones2012-01-1814-14/+14
| | | | Update all copyright dates to 2012.
* lib: Use -fvisibilty=hidden by default; only ABI symbols are now visible.Richard W.M. Jones2012-01-181-3/+5
| | | | http://gcc.gnu.org/wiki/Visibility
* New tool: virt-format: erase and make blank disks.Richard W.M. Jones2012-01-181-0/+5
| | | | | This tool allows you to easily reformat a disk, creating a blank disk with optional partition, LVM and empty filesystem.
* NEW API: add a new api e2fsckWanlong Gao2012-01-131-1/+1
| | | | | | | | | | | | | | m: Wanlong Gao <gaowanlong@cn.fujitsu.com> Add a new api e2fsck with two options: correct: same as '-p' option of e2fsck forceall: same as '-y' option of e2fsck Thanks for Rich's idea. v1->v2: use optargs_bitmask v2->v3: change the optargs_bitmask check Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* Allow /dev/null to be added multiple times.Richard W.M. Jones2012-01-101-1/+8
| | | | | | | | Change the test for duplicate drives so that you're allowed to add /dev/null multiple times. This corresponds to traditional usage. This amends commit be47b66c3033105a2b880dbc10bfc2b163b7eafe.
* launch: move the filename checking to a wrapperWanlong Gao2012-01-091-6/+12
| | | | | | Move the filename's comma character checking to a wrapper. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* launch: don't add a drive twiceWanlong Gao2012-01-091-2/+12
| | | | | | | | | | | | | | 1. Change the g->path to restore a absolute path instead of the mixed. 2. Check that if the adding drive is duplicated with the added drive. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> RWMJ: - Make sure abs_path is NULL before it is assigned, so freeing it will work along the error path. - Fix the test which added /dev/null multiple times.
* launch: add a goto label when add_drive errorWanlong Gao2012-01-091-18/+11
| | | | | | | Code cleanup. Add a goto label to simplify the code. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
* lib: Try harder to remove temporary directory along error paths (RHBZ#769680).Richard W.M. Jones2011-12-231-1/+11
|