X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=perl%2Flib%2FSys%2FGuestfs.pm;h=144e127e90dbbcc58376594e518b6c71ae73dda8;hb=107a76ad3680fda05cfd58136d62eeab4e77a8dc;hp=436f218c4d17680377afd7249f8e805f555c4772;hpb=ad8a256f54a6cb99f89bb444c8597a152a793dce;p=libguestfs.git diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 436f218..144e127 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 @@ -500,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 @@ -532,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 @@ -694,6 +723,29 @@ See that manual page for more details. 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 @@ -703,6 +755,18 @@ 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 @filenames = $h->initrd_list ($path); + +This command lists out files contained in an initrd. + +The files are listed without any initial C character. The +files are listed in the order they appear (not necessarily +alphabetical). Directory names are listed as separate items. + +Old Linux kernels (2.4 and earlier) used a compressed ext2 +filesystem as initrd. We I support the newer initramfs +format (compressed cpio files). + =item $busy = $h->is_busy (); This returns true iff this handle is busy processing a command @@ -852,6 +916,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