summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix for returning structures (hashes) from Perl calls.Richard Jones2009-07-101-23/+26
| | | | | | | | Calls such as stat and statvfs which returned a single structure were returning an array of values instead of a full hash of keys + values. Fix this by pushing the key names on the stack too.
* Properly close fds and unregister handlers in guestfs_close.Richard Jones2009-07-101-0/+19
| | | | | | | | | This caused a segfault if you tried to repeatedly open and close a guestfs handle in the same program. The reason is that the old handler remained registered (not always - it was racey). This adds proper cleanup to the guestfs_close path, also for file descriptors.
* Add Sys::Guestfs::Lib - useful functions for using libguestfs from Perl.Richard Jones2009-07-091-1/+8
| | | | | | | | | | This adds an extra Perl module called Sys::Guestfs::Lib which adds useful functions for using libguestfs from Perl. The intention is that common code shared between virt-inspector, virt-df and virt-v2v will move into this library. This patch also changes virt-inspector to use this library.
* Just whitespace changes in the generator code.Richard Jones2009-07-091-14/+14
|
* Fix checking of generator being run from the right directory.Richard W.M. Jones2009-07-071-1/+1
| | | | | | Originally it was looking for 'config.status', but this file might not exist until configure has been run. Make it look for HACKING instead.
* RHEL 5: for (int i = ...) is not permitted with this old version of GCC.Richard Jones2009-07-071-1/+8
|
* Generate structs and struct lists generically.Richard Jones2009-07-073-1228/+641
| | | | | | | | | | | This modifies the way that struct and struct lists are generated (for return values) so that there is no need to add an explicit new type when adding a new structure. All tests pass, and the C API should be compatible. I have also inspected the changes that are made to the generated code by hand.
* Add a debug message to the library cancellation path.Richard Jones2009-07-061-0/+4
|
* Add 'get-pid' command.Richard Jones2009-07-062-0/+20
| | | | | This is used to get the PID of the qemu subprocess, mainly for debugging and testing purposes.
* Make it possible to build in a separate directoryMatthew Booth2009-07-032-3/+7
| | | | | | | | | | | | | | | | | | | | | | This patch allows you to do: mkdir build cd build ../configure ... make This will output all generated files to the build directory. Given that autogen automatically runs configure, you can also do: BUILDDIR=./build ./autogen.sh which will do the right thing. Also: * Fix a dependency bug which means that guestfs_protocol.h isn't automatically rebuilt. * Re-running autogen.sh with no arguments won't blow away your previous configure arguments.
* generate slightly more "const-correct" codeJim Meyering2009-07-031-6/+6
| | | | * src/generator.ml: Add a few "const" attributes.
* use safe_malloc and safe_calloc in generated codeJim Meyering2009-07-033-23/+63
| | | | | | | | | | * src/generator.ml (safe_malloc): Define to guestfs_safe_malloc. (safe_calloc): Define to guestfs_safe_calloc. [most generated code]: Fail immediately upon failure of otherwise- unchecked malloc and calloc calls. * src/guestfs.c: Include <stddef.h>. (xalloc_oversized): Define. * src/guestfs.h (guestfs_safe_calloc): Declare.
* prefer sizeof *VAR over sizeof TYPE (no semantic change)Jim Meyering2009-07-021-10/+10
| | | | | * src/generator.ml: Slightly safer, in case the declared type ever changes.
* Add 'sfdiskM' command.Richard W.M. Jones2009-07-022-30/+42
| | | | | | | | | | This command is a saner interface to partitioning. All partition sizes are specified in megabytes (not cylinders). You don't need to specify the cyls/heads/secs parameters. All the test code has been updated to use this, so it is now CHS-independent (eg. when CHS changes as between IDE and virtio).
* Remove generated files guestfs_protocol.[ch].Richard W.M. Jones2009-07-022-4366/+0
| | | | | | These generated files were accidentally left in when we removed the other generated files in cset b3cb0b04eb2d38ba32c160a83d8e3894b376907b.
* Add ./configure --with-drive-if=(ide|scsi|virtio)Richard W.M. Jones2009-07-022-4/+4
| | | | | | | | With this flag the packager can decide to default to a particular qemu drive model. The current default is 'ide', however note that we intend to change this in future to 'virtio' once some upstream regressions are fixed. Packagers can force a particular drive model if they wish.
* Add list of function_names to the daemon.Richard W.M. Jones2009-07-021-0/+20
| | | | | Messages which include the proc_nr can now also include the name of the actual function being called.
* arrange to build some generated sourcesJim Meyering2009-07-021-0/+9
| | | | | * src/Makefile.am (BUILT_SOURCES): Define. ($(BUILT_SOURCES)): Depend on stamp-generator.
* Re-add src/MAX_PROC_NR (generated file).Richard W.M. Jones2009-07-021-0/+1
| | | | | This file is required by configure, so we need to add it so it is available after the git checkout.
* Memoize the output of pod2text function in the generator.Richard W.M. Jones2009-07-021-24/+45
| | | | This speeds up the generator greatly.
* Remove generated code from git.Richard W.M. Jones2009-07-026-14434/+0
| | | | | | | | Git users now require the OCaml compiler in order to regenerate the generated code after a checkout. Generated code will remain in the tarball, so users of the source tarball will not need the OCaml compiler.
* Generator now runs automatically when it has changed.Richard W.M. Jones2009-07-022-3/+23
|
* Add 'readdir' call.Richard W.M. Jones2009-07-0210-26/+581
| | | | | | | | | | | | This adds a readdir call (mostly intended for programs). The return value is a list of guestfs_dirent structures. This adds the new types 'struct guestfs_dirent' and 'struct guestfs_dirent_list', along with all the code to return these in the different language bindings. Also includes additional tests for OCaml and Perl bindings to test this.
* Change to use virtio_blk (virtio block device) by default.Richard W.M. Jones2009-07-012-14/+20
| | | | | | | | | | | | | virtio_blk is the fast, virt-native block device driver supported by qemu and KVM. Note that virtio_blk device names are called /dev/vd*. Existing scripts should continue working because device name translation will silently change device names of the form /dev/sd* to /dev/vd* as required. See also: http://libguestfs.org/guestfs.3.html#block_device_naming
* Don't dereference or free undefined "msg" upon OOM.Jim Meyering2009-07-011-1/+3
| | | | * src/guestfs.c (guestfs_error): Handle failing vasprintf.
* Change statvfs test so it doesn't depend on device size.Richard W.M. Jones2009-06-301-2/+1
| | | | | | | | Current statvfs test depended on a lot of filesystem details which can change if the CHS of the underlying block device changes (eg. with the switch from IDE -> virtio). These are not really necessary to test the call, so instead just check for filesystem features.
* Clean up the output of the C API test code.Richard W.M. Jones2009-06-301-4/+6
| | | | | | | Set output mode to unbuffered so that we see ordinary output messages and errors at the same time. Align "skipped" messages.
* Generated code for mknod, mkfifo, mknod_b, mknod_c, umask.Richard W.M. Jones2009-06-306-2/+760
|
* New commands: mknod, mkfifo, mknod_b, mknod_c and umask.Richard W.M. Jones2009-06-301-0/+70
| | | | | | | | | | These commands are used to create block and char device nodes or FIFOs (named pipes) in the filesystem. The umask command is required also because the permissions used by mknod are masked by the umask. Also document and guarantee that the umask starts as 022.
* Use octal numbers for modes in the test suite.Richard W.M. Jones2009-06-301-23/+23
| | | | | We have to use the OCaml convention (0o...). Note that in OCaml 0777 is a _decimal_ number. It'll catch you out.
* Generated code for 'set_memsize'/'get_memsize' calls.Richard W.M. Jones2009-06-301-0/+2
|
* Add 'set_memsize'/'get_memsize' calls.Richard W.M. Jones2009-06-302-11/+62
| | | | | | Allow the qemu memory size to be specified either by API calls or by setting the LIBGUESTFS_MEMSIZE environment variable.
* Generated code for the 'mkswap*' commands.Richard W.M. Jones2009-06-296-2/+347
|
* Implement 'mkswap', 'mkswap_L' and 'mkswap_U' commands.Richard W.M. Jones2009-06-291-0/+24
| | | | | | These commands are used to make Linux swap devices. The mkswap_L command makes one with a label. The mkswap_U command makes one with a known UUID.
* Fix for 'broken pipe' error when qemu dies (RHBZ#508713).Richard W.M. Jones2009-06-291-2/+5
|
* Generated code for mount-loop command.Richard W.M. Jones2009-06-296-2/+119
|
* Add mount-loop command (RHBZ#508668).Richard W.M. Jones2009-06-291-0/+8
| | | | | | | | | Loop device mounts don't work for the generic 'mount' commands because the first parameter should be a file not a device. We want to separate out files parameters from device parameters in the long term, so this adds a new mount-loop command for this purpose.
* Generated code for 'initrd-list'.Richard W.M. Jones2009-06-296-2/+148
|
* Add 'initrd-list' command to list contents of initrd images.Richard W.M. Jones2009-06-291-0/+16
| | | | | | Add 'initrd-list' command to list the files inside (new-style) initrd images. Update virt-inspector to use this instead of the less efficient download/unpack locally method.
* Generated code for 'du' command.Richard W.M. Jones2009-06-296-2/+139
|
* Added 'du' command.Richard W.M. Jones2009-06-291-0/+16
| | | | This command estimates file usage for files and directories.
* Generated code for df / df-h.Richard W.M. Jones2009-06-296-2/+226
|
* Add 'df' and 'df-h' commands.Richard W.M. Jones2009-06-291-0/+25
| | | | | | | df and df-h commands can be used interactively to show disk space usage. Use existing statvfs command from programs.
* Generated code for head/tail commands.Richard W.M. Jones2009-06-296-12/+608
|
* Implement "head", "head-n", "tail", "tail-n" commands.Richard W.M. Jones2009-06-291-0/+58
| | | | | These commands let you view parts of a large file without passing the whole file over the network connection.
* Prevent 'n' being used as a parameter name.Richard W.M. Jones2009-06-291-3/+3
| | | | | Parameters named 'n' sometimes break the Perl bindings, so check for this in the generator and prevent it.
* Generated code for 'wc_*' commands.Richard W.M. Jones2009-06-296-2/+413
|
* Implementation of 'wc_c', 'wc_w' and 'wc_l' commands.Richard W.M. Jones2009-06-291-0/+27
| | | | These commands count characters, words and lines in a file respectively.
* Implement TEST_ONLY environment variable to run selected tests only.Richard W.M. Jones2009-06-291-2/+5
| | | | | To run just selected tests, do: TEST_ONLY="hexdump mkfs" make -C capitests check
* Add large test files with standard content for the C API test.Richard W.M. Jones2009-06-291-1/+7
| | | | | Large test files with standard content for the C API test, and add a regression test for previous hexdump failure on large files.