X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=perl%2Flib%2FSys%2FGuestfs.pm;h=17ab740ceedfcc90d9f69791682d62e3ff497c08;hp=c708a29c77979b6e307f01abfb9ed48f91778124;hb=5365ebd501850ea10d9a5b28fc6480ea34dbe16d;hpb=b4d2a01828e5de85e5eee3631f7fe3925a0312ca;ds=sidebyside diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index c708a29..17ab740 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -271,6 +271,34 @@ Only numeric uid and gid are supported. If you want to use names, you will need to locate and parse the password file yourself (Augeas support makes this relatively easy). +=item $output = $h->command (\@arguments); + +This calls runs a command from the guest filesystem. The +filesystem must be mounted, and must contain a compatible +operating system (ie. something Linux, with the same +or compatible processor architecture). + +The single parameter is an argv-style list of arguments. +The first element is the name of the program to run. +Subsequent elements are parameters. The list must be +non-empty (ie. must contain a program name). + +The C<$PATH> environment variable will contain at least +C and C. If you require a program from +another location, you should provide the full path in the +first parameter. + +Shared libraries and data files required by the program +must be available on filesystems which are mounted in the +correct places. It is the caller's responsibility to ensure +all filesystems that are needed are mounted at the right +locations. + +=item @lines = $h->command_lines (\@arguments); + +This is the same as C<$h-Ecommand>, but splits the +result into a list of lines. + =item $h->config ($qemuparam, $qemuvalue); This can be used to add arbitrary qemu command line parameters @@ -289,6 +317,16 @@ This returns C if and only if there is a file, directory See also C<$h-Eis_file>, C<$h-Eis_dir>, C<$h-Estat>. +=item $description = $h->file ($path); + +This call uses the standard L command to determine +the type or contents of the file. This also works on devices, +for example to find out whether a partition contains a filesystem. + +The exact command which runs is C. Note in +particular that the filename is not prepended to the output +(the C<-b> option). + =item $autosync = $h->get_autosync (); Get the autosync flag.