diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-08 15:02:39 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-08 15:02:39 +0100 |
commit | 9908e03e922b670437bcd89b6873f9ebc914567e (patch) | |
tree | 30d8b8adfb5cfbd864f7e91cf8268a29344366d0 /src | |
parent | 00e309d3608661eaa8c9cc69ba5bf175c612698d (diff) | |
download | libguestfs-9908e03e922b670437bcd89b6873f9ebc914567e.tar.gz libguestfs-9908e03e922b670437bcd89b6873f9ebc914567e.tar.xz libguestfs-9908e03e922b670437bcd89b6873f9ebc914567e.zip |
Fixed Perl bindings, they now work properly.
Diffstat (limited to 'src')
-rwxr-xr-x | src/generator.ml | 169 |
1 files changed, 159 insertions, 10 deletions
diff --git a/src/generator.ml b/src/generator.ml index 8b277986..98faa0f2 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -1574,19 +1574,112 @@ MODULE = Sys::Guestfs PACKAGE = Sys::Guestfs guestfs_h * _create () -CODE: - RETVAL = guestfs_create (); - if (!RETVAL) - croak (\"could not create guestfs handle\"); - guestfs_set_error_handler (RETVAL, error_handler, NULL); -OUTPUT: - RETVAL + CODE: + RETVAL = guestfs_create (); + if (!RETVAL) + croak (\"could not create guestfs handle\"); + guestfs_set_error_handler (RETVAL, error_handler, NULL); + OUTPUT: + RETVAL void DESTROY (g) - guestfs_h *g; -PPCODE: - guestfs_close (g); + guestfs_h *g; + PPCODE: + guestfs_close (g); + +void +add_drive (g, filename) + guestfs_h *g; + const char *filename; + CODE: + if (guestfs_add_drive (g, filename) == -1) + croak (\"add_drive: %%s\", last_error); + +void +add_cdrom (g, filename) + guestfs_h *g; + const char *filename; + CODE: + if (guestfs_add_cdrom (g, filename) == -1) + croak (\"add_cdrom: %%s\", last_error); + +void +config (g, param, value) + guestfs_h *g; + const char *param; + const char *value; + CODE: + if (guestfs_config (g, param, value) == -1) + croak (\"config: %%s\", last_error); + +void +launch (g) + guestfs_h *g; + CODE: + if (guestfs_launch (g) == -1) + croak (\"launch: %%s\", last_error); + +void +wait_ready (g) + guestfs_h *g; + CODE: + if (guestfs_wait_ready (g) == -1) + croak (\"wait_ready: %%s\", last_error); + +void +set_path (g, path) + guestfs_h *g; + const char *path; + CODE: + guestfs_set_path (g, path); + +SV * +get_path (g) + guestfs_h *g; +PREINIT: + const char *path; + CODE: + path = guestfs_get_path (g); + RETVAL = newSVpv (path, 0); + OUTPUT: + RETVAL + +void +set_autosync (g, autosync) + guestfs_h *g; + int autosync; + CODE: + guestfs_set_autosync (g, autosync); + +SV * +get_autosync (g) + guestfs_h *g; +PREINIT: + int autosync; + CODE: + autosync = guestfs_get_autosync (g); + RETVAL = newSViv (autosync); + OUTPUT: + RETVAL + +void +set_verbose (g, verbose) + guestfs_h *g; + int verbose; + CODE: + guestfs_set_verbose (g, verbose); + +SV * +get_verbose (g) + guestfs_h *g; +PREINIT: + int verbose; + CODE: + verbose = guestfs_get_verbose (g); + RETVAL = newSViv (verbose); + OUTPUT: + RETVAL "; @@ -1770,6 +1863,62 @@ sub new { return $self; } +=item $h->add_drive ($filename); + +=item $h->add_cdrom ($filename); + +This function adds a virtual machine disk image C<filename> to the +guest. The first time you call this function, the disk appears as IDE +disk 0 (C</dev/sda>) in the guest, the second time as C</dev/sdb>, and +so on. + +You don't necessarily need to be root when using libguestfs. However +you obviously do need sufficient permissions to access the filename +for whatever operations you want to perform (ie. read access if you +just want to read the image or write access if you want to modify the +image). + +The C<add_cdrom> variation adds a CD-ROM device. + +=item $h->config ($param, $value); + +=item $h->config ($param); + +Use this to add arbitrary parameters to the C<qemu> command line. +See L<qemu(1)>. + +=item $h->launch (); + +=item $h->wait_ready (); + +Internally libguestfs is implemented by running a virtual machine +using L<qemu(1)>. These calls are necessary in order to boot the +virtual machine. + +You should call these two functions after configuring the handle +(eg. adding drives) but before performing any actions. + +=item $h->set_path ($path); + +=item $path = $h->get_path (); + +See the discussion of C<PATH> in the L<guestfs(3)> +manpage. + +=item $h->set_autosync ($autosync); + +=item $autosync = $h->get_autosync (); + +See the discussion of I<AUTOSYNC> in the L<guestfs(3)> +manpage. + +=item $h->set_verbose ($verbose); + +=item $verbose = $h->get_verbose (); + +This sets or gets the verbose messages flag. Verbose +messages are sent to C<stderr>. + "; (* Actions. We only need to print documentation for these as |