X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=guestfs-actions.pod;h=520425cc95b10d687169af5ff7cc3c5bc5360ff5;hp=03378e0a3f07cbcfb72dfbd57c8ce23a1066b890;hb=1765330e07a48dc6f7bdef7007f69ebe606fa731;hpb=6bcbe54b5785cb8c911ccf4b724ae6abfdf53ce4 diff --git a/guestfs-actions.pod b/guestfs-actions.pod index 03378e0..520425c 100644 --- a/guestfs-actions.pod +++ b/guestfs-actions.pod @@ -239,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, @@ -248,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. @@ -854,6 +984,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,