X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=perl%2Flib%2FSys%2FGuestfs.pm;h=083a0172cc341b1ef0484340208e4b50008a8d44;hp=8871b68ee9483596692d43a9ebd63a8c4831a470;hb=0884d8bbae6d76a603ec1385ada2938f88981c5c;hpb=f450ce75b754fb869b34433c0126f7bb592b141b diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 8871b68..083a017 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -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 @@ -651,6 +680,18 @@ C. This returns the ext2/3/4 filesystem UUID of the filesystem on C. +=item $memsize = $h->get_memsize (); + +This gets the memory size in megabytes allocated to the +qemu subprocess. + +If C<$h-Eset_memsize> was not called +on this handle, and if C was not set, +then this returns the compiled-in default value for memsize. + +For more information on the architecture of libguestfs, +see L. + =item $path = $h->get_path (); Return the current search path. @@ -694,6 +735,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 +767,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 @@ -873,12 +949,52 @@ directory and its contents after use. See also: L +=item $h->mkfifo ($mode, $path); + +This call creates a FIFO (named pipe) called C with +mode C. It is just a convenient wrapper around +C<$h-Emknod>. + =item $h->mkfs ($fstype, $device); This creates a filesystem on C (usually a partition or LVM logical volume). The filesystem type is C, for example C. +=item $h->mknod ($mode, $devmajor, $devminor, $path); + +This call creates block or character special devices, or +named pipes (FIFOs). + +The C parameter should be the mode, using the standard +constants. C and C are the +device major and minor numbers, only used when creating block +and character special devices. + +=item $h->mknod_b ($mode, $devmajor, $devminor, $path); + +This call creates a block device node called C with +mode C and device major/minor C and C. +It is just a convenient wrapper around C<$h-Emknod>. + +=item $h->mknod_c ($mode, $devmajor, $devminor, $path); + +This call creates a char device node called C with +mode C and device major/minor C and C. +It is just a convenient wrapper around C<$h-Emknod>. + +=item $h->mkswap ($device); + +Create a swap partition on C. + +=item $h->mkswap_L ($label, $device); + +Create a swap partition on C with label C