summaryrefslogtreecommitdiffstats
path: root/src/info.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: Fix memory leak and simplify command code.Richard W.M. Jones2012-11-231-5/+2
| | | | | | | | | | | | | | | | | | | 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.
* info: Use command mini-library to run 'qemu-img info' commands.Richard W.M. Jones2012-10-181-133/+91
|
* syntax: Remove definitions of O_CLOEXEC, except in examples (thanks Jim ↵Richard W.M. Jones2012-09-171-4/+0
| | | | | | | Meyering). The gnulib <fcntl.h> replacement header will now define this symbol if it's not defined already.
* lib: guestfs_disk_format: Set LC_ALL=C instead of LANG=C.Richard W.M. Jones2012-09-121-1/+1
| | | | | | LC_ALL takes precedence over LANG. See: http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html
* New APIs: disk-virtual-size and disk-has-backing-file.Richard W.M. Jones2012-09-041-0/+63
|
* lib: Reimplement qemu-img info parser for flexibility.Richard W.M. Jones2012-09-041-24/+52
| | | | | | | This allows other fields from the output of 'qemu-img info' to be parsed out. This updates commit 20902e7ce02fa375d5d336e6b984f615472ad1b1.
* Fix guestfs_disk_image API to work with relative paths.Richard W.M. Jones2012-09-041-1/+12
| | | | | | | | guestfs_disk_image makes a symbolic link to the real filename in order to sanitize the filename. However this fails if the filename is a relative path. Call realpath(3) to make the filename canonical. This fixes commit 20902e7ce02fa375d5d336e6b984f615472ad1b1.
* New API: guestfs_disk_formatRichard W.M. Jones2012-09-031-0/+161
Detect the disk image format of a file, in a secure way.