summaryrefslogtreecommitdiffstats
path: root/perl/t
Commit message (Collapse)AuthorAgeFilesLines
* perl: Add test of multiple independent handles.Richard W.M. Jones2012-11-191-0/+37
|
* perl: Clean up and update the tests.Richard W.M. Jones2012-11-173-4/+3
|
* perl: Small test of create with flags.Richard W.M. Jones2012-11-171-0/+25
|
* Replace mount-options with mount where appropriate.Richard W.M. Jones2012-08-182-2/+2
| | | | | | Since our minimum supported version is now 1.16 and mount was fixed in 1.13.16, it is now safe to replace mount-options + empty options with mount wherever it occurs.
* perl: Use $g instead of $h in documentation.Richard W.M. Jones2012-07-176-55/+55
| | | | $g is the "standard" name for libguestfs handles.
* generator: Rename 'add_drive_opts' API to 'add_drive'.Richard W.M. Jones2012-07-143-4/+5
| | | | | | By using the once_had_no_optargs flag, this change is backwards compatible for callers (except Haskell, PHP and GObject as discussed in earlier commit).
* tests: Rename test0* functions as internal_test*.Richard W.M. Jones2012-07-111-1/+0
| | | | | The internal_* prefix is reserved for internal functions such as these tests.
* launch: Treat /dev/null specially, for old KVM.Richard W.M. Jones2012-06-251-1/+1
| | | | | | | | | Old KVM can't add /dev/null readonly. Treat /dev/null as a special case. We also fix a few tests where /dev/null was being used with format=qcow2. This was always incorrect behaviour, but qemu appears to tolerate it.
* lib: Remove the BUSY state.Richard W.M. Jones2012-04-261-3/+6
| | | | | | | | | | | | | | | Originally this state was intended so that in some way you could find out if the appliance was running a command. However there was never a thread-safe way to access the state of the handle, so in effect you could never do anything useful safely with this information. This commit completely removes the BUSY state. The only visible change is to the guestfs_is_busy API. Previously you could never call this safely from another thread. If you called it from the same thread it would always return false (since the current thread can't be running a libguestfs command at that point by definition). Now it always returns false.
* Update FSF address.Matthew Booth2011-11-0813-13/+13
|
* perl: Add %guestfs_introspection hash with introspection information.Richard W.M. Jones2011-10-281-0/+42
| | | | | Because this is a useful introspection API, it is a candidate for being backported into older stable branches.
* perl: Binding and test for guestfs_last_errno (RHBZ#672491).Richard W.M. Jones2011-03-151-0/+76
|
* New event API - Perl bindings (RHBZ#664558).Richard W.M. Jones2011-03-151-0/+72
| | | | | | | | The methods $h->set_progress_callback and $h->clear_progress_callback have been removed, and replaced with a complete mechanism for setting and deleting general-purpose events. This also updates virt-resize to use the new API.
* perl: Ignore internal_* functions in POD coverage test.Richard W.M. Jones2011-01-291-1/+2
| | | | This updates commit 1d999540bddd7aea7c2d0fef8b15223d4acc645f.
* perl: Ignore debug functions in Test::Pod::Coverage.Richard W.M. Jones2010-11-111-1/+4
|
* generator: Optional arguments, add-drive-opts (RHBZ#642934,CVE-2010-3851).Richard W.M. Jones2010-10-221-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This large commit changes the generator so that optional arguments can be supported for functions. The model for arguments (known as the "style") is changed from (ret, args) to (ret, args, optargs) where optargs is a more limited list of arguments. One function has been added which takes optional arguments, it is "add-drive-opts", modelled as: (RErr, [String "filename"], #required [Bool "readonly"; String "format"; String "iface"]) #optional Note that this function is processed in the library (does not go over the RPC protocol to the daemon). This has allowed us to simplify the current implementation by omitting changes related to RPC or the daemon, although we plan to add these at some point in the future. From C this function can be called in 3 different ways as in these examples: guestfs_add_drive_opts (g, filename, GUESTFS_ADD_DRIVE_OPTS_READONLY, 1, GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw", -1); (the argument(s) between 'filename' and '-1' are the optional ones). guestfs_add_drive_opts_va (g, filename, args); where 'args' is a va_list. This works like the first version. struct guestfs_add_drive_opts_argv optargs = { .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK, .readonly = 1, } guestfs_add_drive_opts_argv (g, filename, &optargs); This last form lets you construct lists of optional arguments, and is used by guestfish and the language bindings. In guestfish optional arguments are used like this: add-drive-opts filename readonly:true In OCaml these are mapped naturally to OCaml optional arguments, eg: g#add_drive_opts ~readonly:true filename; In Perl these are mapped to extra arguments, eg: $g->add_drive_opts ($filename, readonly => 1); In Python these are mapped to optional arguments, eg: g.add_drive_opts ("file", readonly = 1, format = "qcow2") In Ruby these are mapped to a final hash argument, eg: g.add_drive_opts("file", {}) g.add_drive_opts("file", :readonly => 1) g.add_drive_opts("file", :readonly => 1, :iface => "virtio") In PHP these are mapped to extra parameters. This is not quite accurate since you cannot omit arbitrary optional parameters, but there's not much than can be done within the limitations of PHP as a language. Unimplemented in: Haskell, C#, Java.
* New API: file-architectureRichard Jones2010-08-171-70/+0
| | | | | | This change simply converts the existing Perl-only function file_architecture into a core API call. The core API call is written in C and available in all languages and from guestfish.
* perl: Add explicit close() method (RHBZ#602592).Richard Jones2010-06-101-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | This add an optional explicit $g->close method which may be used to force the handle to be closed immediately. Note the provisos about this method in the manual page entry. Callers should *not* normally use this method. The implementation of the handle also changes. Before, the handle was a blessed reference to an integer (the integer being the pointer to the C guestfs_h handle). Now we change this to a hashref containing currently the following field: _g => pointer to C guestfs_h handle (as an integer) If this field is not present, it means that the handle has been explicitly closed. This avoids double-freeing the handle. The user may add their own fields to this hash in order to store per-handle data. However any fields whose names begin with an underscore are reserved for use by the Perl bindings. This commit also adds a regression test. This commit also changes the existing warning when you call a method without a Sys::Guestfs handle as the first parameter, into an error. This is because such cases are always errors.
* Use mount-options instead of mount to avoid implicit -o sync.Richard Jones2010-02-101-1/+1
| | | | | | | | | | | | | | | guestfs_mount adds -o sync implicitly. This causes a very large performance problem for write-intensive programs (eg. virt-v2v). Document this as a "gotcha". Change the tests, guestfish, Sys::Guestfs::Lib, guestmount to use mount-options instead. (Note that this gotcha does not affect mount-ro). The source of the performance problem was first identified by Matthew Booth.
* Generic partition creation interface.Richard Jones2009-11-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a generic partition creation interface which should be future-proof and extensible, and partially replaces the old sfdisk-based interface. The implementation is based on parted but is hopefully not too dependent on the particulars of parted. The following new calls are introduced: guestfs_part_init: Initialize a disk with a partition table. Unlike the sfdisk- based interface, we also support GPT and other partition types, which is essential to scale to devices larger than 2TB. guestfs_part_add: Add a partition to an existing disk. guestfs_part_disk: Convenience function which combines part_init & part_add, creating a single partition that covers the whole disk. guestfs_part_set_bootable: guestfs_part_set_name: Set various aspects of existing partitions. guestfs_part_list: List partitions on a device. This returns a programming-friendly list of partition structs (in contrast to sfdisk-l which cannot be parsed). guestfs_part_get_parttype: Return the partition table type, eg. "msdos" or "gpt". The following calls are planned, but not added currently: guestfs_part_get_bootable guestfs_part_get_name guestfs_part_set_type guestfs_part_get_type
* Remove guestfs_wait_ready (turn it into a no-op).Richard Jones2009-09-213-9/+3
| | | | | | | | | | | | | | This commit changes guestfs_launch so that it both launches the appliance and waits until it is ready (ie. the daemon communicates back to us). Since we removed the pretence that we could implement a low-level asynchronous API, the need to call launch() followed by wait_ready() has looked a bit silly. Now guestfs_wait_ready() is basically a no-op. It is left in the API for backwards compatibility. Any calls to guestfs_wait_ready() can be removed from client code.
* tests: Found three more references to the squashfs, replaced with ISO.Richard W.M. Jones2009-08-191-2/+2
|
* Convert all TABs-as-indentation to spaces.Jim Meyering2009-08-032-6/+6
| | | | | | | | | | | Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
* Lib.pm: Skip tests if perl-libintl module is not available.Richard Jones2009-07-292-2/+23
|
* Lib.pm: Add file_architecture command.Richard Jones2009-07-292-0/+88
| | | | | This command detects the architecture of some types of binaries, libraries, kernel modules and initrd images.
* Add 'readdir' call.Richard W.M. Jones2009-07-021-0/+63
| | | | | | | | | | | | 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.
* Add the test0* functions, used to test language bindings.Richard W.M. Jones2009-05-281-1/+1
|
* Additional test programs for Perl, Python, OCaml bindings.Richard Jones2009-04-131-1/+1
|
* Lots, mainly Python bindings.Richard Jones2009-04-131-0/+60
|
* Added more Perl bindings tests.Richard Jones2009-04-083-7/+78
|
* Fixed Perl bindings, they now work properly.Richard Jones2009-04-083-0/+77