X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=guestfish-actions.pod;h=5013a280a2e9e6b4daea255c18e7c1d84d0ce2e1;hp=606c5b93581ec87fc9a6376c3062841721322cae;hb=170f262f0413de843af62b968f6d12c1c476ae7f;hpb=adefe14e308a0f8cf73f9c60693a3dbbded157b9 diff --git a/guestfish-actions.pod b/guestfish-actions.pod index 606c5b9..5013a28 100644 --- a/guestfish-actions.pod +++ b/guestfish-actions.pod @@ -182,6 +182,105 @@ how files are saved. Set the value associated with C to C. +=head2 blockdev-flushbufs + + blockdev-flushbufs device + +This tells the kernel to flush internal buffers associated +with C. + +This uses the L command. + +=head2 blockdev-getbsz + + blockdev-getbsz device + +This returns the block size of a device. + +(Note this is different from both I and +I). + +This uses the L command. + +=head2 blockdev-getro + + blockdev-getro device + +Returns a boolean indicating if the block device is read-only +(true if read-only, false if not). + +This uses the L command. + +=head2 blockdev-getsize64 + + blockdev-getsize64 device + +This returns the size of the device in bytes. + +See also C. + +This uses the L command. + +=head2 blockdev-getss + + blockdev-getss device + +This returns the size of sectors on a block device. +Usually 512, but can be larger for modern devices. + +(Note, this is not the size in sectors, use C +for that). + +This uses the L command. + +=head2 blockdev-getsz + + blockdev-getsz device + +This returns the size of the device in units of 512-byte sectors +(even if the sectorsize isn't 512 bytes ... weird). + +See also C for the real sector size of +the device, and C for the more +useful I. + +This uses the L command. + +=head2 blockdev-rereadpt + + blockdev-rereadpt device + +Reread the partition table on C. + +This uses the L command. + +=head2 blockdev-setbsz + + blockdev-setbsz device blocksize + +This sets the block size of a device. + +(Note this is different from both I and +I). + +This uses the L command. + +=head2 blockdev-setro + + blockdev-setro device + +Sets the block device named C to read-only. + +This uses the L command. + +=head2 blockdev-setrw + + blockdev-setrw device + +Sets the block device named C to read-write. + +This uses the L command. + =head2 cat cat path @@ -190,7 +289,7 @@ Return the contents of the file named C. Note that this function cannot correctly handle binary files (specifically, files containing C<\0> character which is treated -as end of string). For those you need to use the C +as end of string). For those you need to use the C function which has a more complex interface. Because of the message protocol, there is a transfer limit @@ -214,6 +313,38 @@ 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). +=head2 command + + command arguments,... + +This call 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. + +=head2 command-lines + + command-lines arguments,... + +This is the same as C, but splits the +result into a list of lines. + =head2 config config qemuparam qemuvalue @@ -227,6 +358,19 @@ The first character of C string must be a C<-> (dash). C can be NULL. +=head2 download + + download remotefilename (filename|-) + +Download file C and save it as C +on the local machine. + +C can also be a named pipe. + +See also C, C. + +Use C<-> instead of a filename to read/write from stdin/stdout. + =head2 exists exists path @@ -263,12 +407,39 @@ Return the current search path. This is always non-NULL. If it wasn't set already, then this will return the default path. +=head2 get-state + + get-state + +This returns the current state as an opaque integer. This is +only useful for printing debug and internal error messages. + +For more information on states, see L. + =head2 get-verbose get-verbose This returns the verbose messages flag. +=head2 is-busy + + is-busy + +This returns true iff this handle is busy processing a command +(in the C state). + +For more information on states, see L. + +=head2 is-config + + is-config + +This returns true iff this handle is being configured +(in the C state). + +For more information on states, see L. + =head2 is-dir is-dir path @@ -289,6 +460,24 @@ other objects like directories. See also C. +=head2 is-launching + + is-launching + +This returns true iff this handle is launching the subprocess +(in the C state). + +For more information on states, see L. + +=head2 is-ready + + is-ready + +This returns true iff this handle is ready to accept commands +(in the C state). + +For more information on states, see L. + =head2 kill-subprocess kill-subprocess @@ -345,6 +534,18 @@ hidden files are shown. This command is mostly useful for interactive sessions. Programs should probably use C instead. +=head2 lstat + + lstat path + +Returns file information for the given C. + +This is the same as C except that if C +is a symbolic link, then the link is stat-ed, not the file it +refers to. + +This is the same as the C system call. + =head2 lvcreate lvcreate logvol volgroup mbytes @@ -551,6 +752,24 @@ the string C<,> (comma). B. +=head2 stat + + stat path + +Returns file information for the given C. + +This is the same as the C system call. + +=head2 statvfs + + statvfs path + +Returns file system statistics for any mounted file system. +C should be a file or directory in the mounted file system +(typically it is the mount point itself, but it doesn't need to be). + +This is the same as the C system call. + =head2 sync sync @@ -569,6 +788,18 @@ Touch acts like the L command. It can be used to update the timestamps on a file, or, if the file does not exist, to create a new zero-length file. +=head2 tune2fs-l + + tune2fs-l device + +This returns the contents of the ext2 or ext3 filesystem superblock +on C. + +It is the same as running C. See L +manpage for more details. The list of fields returned isn't +clearly defined, and depends on both the version of C +that libguestfs was built against, and the filesystem itself. + =head2 umount | unmount umount pathordevice @@ -585,6 +816,19 @@ This unmounts all mounted filesystems. Some internal mounts are not unmounted by this call. +=head2 upload + + upload (filename|-) remotefilename + +Upload local file C to C on the +filesystem. + +C can also be a named pipe. + +See also C. + +Use C<-> instead of a filename to read/write from stdin/stdout. + =head2 vgcreate vgcreate volgroup physvols,...