X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=guestfs-actions.pod;h=8667340a40c437a1a0817452a13b13d57efd086d;hp=5bd9628b6bec313f561dfe01c18604363349981b;hb=7bf3e1a43512293b1a3f78f880b57e7bbd372eae;hpb=5a563bbd9b2779640e3358f4bf1eaac622b58cae diff --git a/guestfs-actions.pod b/guestfs-actions.pod index 5bd9628..8667340 100644 --- a/guestfs-actions.pod +++ b/guestfs-actions.pod @@ -58,7 +58,8 @@ On success this returns a pair containing the number of nodes in the nodeset, and a boolean flag if a node was created. -This function returns a C. +This function returns a C, +or NULL if there was an error. I after use>. =head2 guestfs_aug_defvar @@ -238,6 +239,136 @@ Set the value associated with C to C. This function returns 0 on success or -1 on error. +=head2 guestfs_blockdev_flushbufs + + int guestfs_blockdev_flushbufs (guestfs_h *handle, + const char *device); + +This tells the kernel to flush internal buffers associated +with C. + +This uses the L command. + +This function returns 0 on success or -1 on error. + +=head2 guestfs_blockdev_getbsz + + int guestfs_blockdev_getbsz (guestfs_h *handle, + const char *device); + +This returns the block size of a device. + +(Note this is different from both I and +I). + +This uses the L command. + +On error this function returns -1. + +=head2 guestfs_blockdev_getro + + int guestfs_blockdev_getro (guestfs_h *handle, + const char *device); + +Returns a boolean indicating if the block device is read-only +(true if read-only, false if not). + +This uses the L command. + +This function returns a C truth value on success or -1 on error. + +=head2 guestfs_blockdev_getsize64 + + int64_t guestfs_blockdev_getsize64 (guestfs_h *handle, + const char *device); + +This returns the size of the device in bytes. + +See also C. + +This uses the L command. + +On error this function returns -1. + +=head2 guestfs_blockdev_getss + + int guestfs_blockdev_getss (guestfs_h *handle, + const char *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. + +On error this function returns -1. + +=head2 guestfs_blockdev_getsz + + int64_t guestfs_blockdev_getsz (guestfs_h *handle, + const char *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. + +On error this function returns -1. + +=head2 guestfs_blockdev_rereadpt + + int guestfs_blockdev_rereadpt (guestfs_h *handle, + const char *device); + +Reread the partition table on C. + +This uses the L command. + +This function returns 0 on success or -1 on error. + +=head2 guestfs_blockdev_setbsz + + int guestfs_blockdev_setbsz (guestfs_h *handle, + const char *device, + int blocksize); + +This sets the block size of a device. + +(Note this is different from both I and +I). + +This uses the L command. + +This function returns 0 on success or -1 on error. + +=head2 guestfs_blockdev_setro + + int guestfs_blockdev_setro (guestfs_h *handle, + const char *device); + +Sets the block device named C to read-only. + +This uses the L command. + +This function returns 0 on success or -1 on error. + +=head2 guestfs_blockdev_setrw + + int guestfs_blockdev_setrw (guestfs_h *handle, + const char *device); + +Sets the block device named C to read-write. + +This uses the L command. + +This function returns 0 on success or -1 on error. + =head2 guestfs_cat char *guestfs_cat (guestfs_h *handle, @@ -247,7 +378,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. This function returns a string, or NULL on error. @@ -389,6 +520,17 @@ return the default path. This function returns a string, or NULL on error. The string is owned by the guest handle and must I be freed. +=head2 guestfs_get_state + + int guestfs_get_state (guestfs_h *handle); + +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. + +On error this function returns -1. + =head2 guestfs_get_verbose int guestfs_get_verbose (guestfs_h *handle); @@ -397,6 +539,28 @@ This returns the verbose messages flag. This function returns a C truth value on success or -1 on error. +=head2 guestfs_is_busy + + int guestfs_is_busy (guestfs_h *handle); + +This returns true iff this handle is busy processing a command +(in the C state). + +For more information on states, see L. + +This function returns a C truth value on success or -1 on error. + +=head2 guestfs_is_config + + int guestfs_is_config (guestfs_h *handle); + +This returns true iff this handle is being configured +(in the C state). + +For more information on states, see L. + +This function returns a C truth value on success or -1 on error. + =head2 guestfs_is_dir int guestfs_is_dir (guestfs_h *handle, @@ -423,6 +587,28 @@ See also C. This function returns a C truth value on success or -1 on error. +=head2 guestfs_is_launching + + int guestfs_is_launching (guestfs_h *handle); + +This returns true iff this handle is launching the subprocess +(in the C state). + +For more information on states, see L. + +This function returns a C truth value on success or -1 on error. + +=head2 guestfs_is_ready + + int guestfs_is_ready (guestfs_h *handle); + +This returns true iff this handle is ready to accept commands +(in the C state). + +For more information on states, see L. + +This function returns a C truth value on success or -1 on error. + =head2 guestfs_kill_subprocess int guestfs_kill_subprocess (guestfs_h *handle); @@ -500,6 +686,24 @@ This function returns a NULL-terminated array of strings (like L), or NULL if there was an error. I. +=head2 guestfs_lstat + + struct guestfs_stat *guestfs_lstat (guestfs_h *handle, + const char *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. + +This function returns a C +(see L and Eguestfs-structs.hE), +or NULL if there was an error. +I after use>. + =head2 guestfs_lvcreate int guestfs_lvcreate (guestfs_h *handle, @@ -547,7 +751,9 @@ I. List all the logical volumes detected. This is the equivalent of the L command. The "full" version includes all fields. -This function returns a C. +This function returns a C +(see Eguestfs-structs.hE), +or NULL if there was an error. I after use>. =head2 guestfs_mkdir @@ -653,7 +859,9 @@ I. List all the physical volumes detected. This is the equivalent of the L command. The "full" version includes all fields. -This function returns a C. +This function returns a C +(see Eguestfs-structs.hE), +or NULL if there was an error. I after use>. =head2 guestfs_read_lines @@ -778,6 +986,36 @@ This function returns 0 on success or -1 on error. B. +=head2 guestfs_stat + + struct guestfs_stat *guestfs_stat (guestfs_h *handle, + const char *path); + +Returns file information for the given C. + +This is the same as the C system call. + +This function returns a C +(see L and Eguestfs-structs.hE), +or NULL if there was an error. +I after use>. + +=head2 guestfs_statvfs + + struct guestfs_statvfs *guestfs_statvfs (guestfs_h *handle, + const char *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. + +This function returns a C +(see L and Eguestfs-structs.hE), +or NULL if there was an error. +I after use>. + =head2 guestfs_sync int guestfs_sync (guestfs_h *handle); @@ -801,6 +1039,25 @@ to create a new zero-length file. This function returns 0 on success or -1 on error. +=head2 guestfs_tune2fs_l + + char **guestfs_tune2fs_l (guestfs_h *handle, + const char *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. + +This function returns a NULL-terminated array of +strings, or NULL if there was an error. +The array of strings will always have length C<2n+1>, where +C keys and values alternate, followed by the trailing NULL entry. +I. + =head2 guestfs_umount int guestfs_umount (guestfs_h *handle, @@ -856,7 +1113,9 @@ I. List all the volumes groups detected. This is the equivalent of the L command. The "full" version includes all fields. -This function returns a C. +This function returns a C +(see Eguestfs-structs.hE), +or NULL if there was an error. I after use>. =head2 guestfs_wait_ready