X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=perl%2Flib%2FSys%2FGuestfs.pm;h=655624a9dc1a959fb39b522d7b2f0befcc813180;hp=f8e6b7746bf35d10ca5be01513bb186fc25fca67;hb=e492608f2f3809a824cb70ee03ff305964b69dd7;hpb=d1a1ab972bb22f4c38a21fcc73f81650aaa03b4e diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index f8e6b77..655624a 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -115,7 +115,7 @@ 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). -This is equivalent to the qemu parameter C<-drive file=filename>. +This is equivalent to the qemu parameter C<-drive file=filename,cache=off>. Note that this call checks for the existence of C. This stops you from specifying other types of drive which are supported @@ -432,7 +432,9 @@ 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). +non-empty (ie. must contain a program name). Note that +the command runs directly, and is I invoked via +the shell (see C<$h-Esh>). The return value is anything printed to I by the command. @@ -461,6 +463,8 @@ FTP. This is the same as C<$h-Ecommand>, but splits the result into a list of lines. +See also: C<$h-Esh_lines> + Because of the message protocol, there is a transfer limit of somewhere between 2MB and 4MB. To transfer large files you should use FTP. @@ -496,6 +500,23 @@ There is no comprehensive help for this command. You have to look at the file C in the libguestfs source to find out what you can do. +=item $output = $h->df (); + +This command runs the C command to report disk space used. + +This command is mostly useful for interactive sessions. It +is I intended that you try to parse the output string. +Use C from programs. + +=item $output = $h->df_h (); + +This command runs the C command to report disk space used +in human-readable format. + +This command is mostly useful for interactive sessions. It +is I intended that you try to parse the output string. +Use C from programs. + =item $kmsgs = $h->dmesg (); This returns the kernel messages (C output) from @@ -528,6 +549,18 @@ Setting C to 3 should drop everything. This automatically calls L before the operation, so that the maximum guest memory is freed. +=item $sizekb = $h->du ($path); + +This command runs the C command to estimate file space +usage for C. + +C can be a file or a directory. If C is a directory +then the estimate includes the contents of the directory and all +subdirectories (recursively). + +The result is the estimated size in I +(ie. units of 1024 bytes). + =item $h->e2fsck_f ($device); This runs C, ie. runs the ext2/ext3 @@ -672,11 +705,47 @@ For more information on states, see L. This returns the verbose messages flag. +=item @paths = $h->glob_expand ($pattern); + +This command searches for all the pathnames matching +C according to the wildcard expansion rules +used by the shell. + +If no paths match, then this returns an empty list +(note: not an error). + +It is just a wrapper around the C L function +with flags C. +See that manual page for more details. + =item $h->grub_install ($root, $device); This command installs GRUB (the Grand Unified Bootloader) on C, with the root directory being C. +=item @lines = $h->head ($path); + +This command returns up to the first 10 lines of a file as +a list of strings. + +Because of the message protocol, there is a transfer limit +of somewhere between 2MB and 4MB. To transfer large files you should use +FTP. + +=item @lines = $h->head_n ($nrlines, $path); + +If the parameter C is a positive number, this returns the first +C lines of the file C. + +If the parameter C is a negative number, this returns lines +from the file C, excluding the last C lines. + +If the parameter C is zero, this returns an empty list. + +Because of the message protocol, there is a transfer limit +of somewhere between 2MB and 4MB. To transfer large files you should use +FTP. + =item $dump = $h->hexdump ($path); This runs C on the given C. The result is @@ -835,6 +904,27 @@ Create a directory named C. Create a directory named C, creating any parent directories as necessary. This is like the C shell command. +=item $dir = $h->mkdtemp ($template); + +This command creates a temporary directory. The +C