X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=guestfs-actions.pod;h=8f602b8956ffa571e25d32b732f2c041eff68c47;hp=07b35af935b8696f25d263c6b8ca93b54eb2b9b2;hb=d43dac69483e8ec62e8356d93f761684ce2f5cc8;hpb=0703248d233744047515418893dac05ce013a642 diff --git a/guestfs-actions.pod b/guestfs-actions.pod index 07b35af..8f602b8 100644 --- a/guestfs-actions.pod +++ b/guestfs-actions.pod @@ -522,6 +522,28 @@ C can be NULL. This function returns 0 on success or -1 on error. +=head2 guestfs_cp + + int guestfs_cp (guestfs_h *handle, + const char *src, + const char *dest); + +This copies a file from C to C where C is +either a destination filename or destination directory. + +This function returns 0 on success or -1 on error. + +=head2 guestfs_cp_a + + int guestfs_cp_a (guestfs_h *handle, + const char *src, + const char *dest); + +This copies a file or directory from C to C +recursively using the C command. + +This function returns 0 on success or -1 on error. + =head2 guestfs_debug char *guestfs_debug (guestfs_h *handle, @@ -539,6 +561,22 @@ to find out what you can do. This function returns a string, or NULL on error. I. +=head2 guestfs_dmesg + + char *guestfs_dmesg (guestfs_h *handle); + +This returns the kernel messages (C output) from +the guest kernel. This is sometimes useful for extended +debugging of problems. + +Another way to get the same information is to enable +verbose messages with C or by setting +the environment variable C before +running the program. + +This function returns a string, or NULL on error. +I. + =head2 guestfs_download int guestfs_download (guestfs_h *handle, @@ -554,6 +592,48 @@ See also C, C. This function returns 0 on success or -1 on error. +=head2 guestfs_drop_caches + + int guestfs_drop_caches (guestfs_h *handle, + int whattodrop); + +This instructs the guest kernel to drop its page cache, +and/or dentries and inode caches. The parameter C +tells the kernel what precisely to drop, see +L + +Setting C to 3 should drop everything. + +This automatically calls L before the operation, +so that the maximum guest memory is freed. + +This function returns 0 on success or -1 on error. + +=head2 guestfs_end_busy + + int guestfs_end_busy (guestfs_h *handle); + +This sets the state to C, or if in C then it leaves the +state as is. This is only used when implementing +actions using the low-level API. + +For more information on states, see L. + +This function returns 0 on success or -1 on error. + +=head2 guestfs_equal + + int guestfs_equal (guestfs_h *handle, + const char *file1, + const char *file2); + +This compares the two files C and C and returns +true if their content is exactly equal, or false otherwise. + +The external L program is used for the comparison. + +This function returns a C truth value on success or -1 on error. + =head2 guestfs_exists int guestfs_exists (guestfs_h *handle, @@ -592,13 +672,30 @@ This runs the filesystem checker (fsck) on C which should have filesystem type C. The returned integer is the status. See L for the -list of status codes from C, and note that multiple -status codes can be summed together. +list of status codes from C. + +Notes: + +=over 4 -It is entirely equivalent to running C. -Note that checking or repairing NTFS volumes is not supported +=item * + +Multiple status codes can be summed together. + +=item * + +A non-zero return code can mean "success", for example if +errors have been corrected on the filesystem. + +=item * + +Checking or repairing NTFS volumes is not supported (by linux-ntfs). +=back + +This command is entirely equivalent to running C. + On error this function returns -1. =head2 guestfs_get_autosync @@ -674,6 +771,32 @@ This returns the verbose messages flag. This function returns a C truth value on success or -1 on error. +=head2 guestfs_grub_install + + int guestfs_grub_install (guestfs_h *handle, + const char *root, + const char *device); + +This command installs GRUB (the Grand Unified Bootloader) on +C, with the root directory being C. + +This function returns 0 on success or -1 on error. + +=head2 guestfs_hexdump + + char *guestfs_hexdump (guestfs_h *handle, + const char *path); + +This runs C on the given C. The result is +the human-readable, canonical hex dump of the file. + +This function returns a string, or NULL on error. +I. + +Because of the message protocol, there is a transfer limit +of somewhere between 2MB and 4MB. To transfer large files you should use +FTP. + =head2 guestfs_is_busy int guestfs_is_busy (guestfs_h *handle); @@ -930,7 +1053,7 @@ This function returns 0 on success or -1 on error. const char *device); This creates a filesystem on C (usually a partition -of LVM logical volume). The filesystem type is C, for +or LVM logical volume). The filesystem type is C, for example C. This function returns 0 on success or -1 on error. @@ -1011,6 +1134,28 @@ This function returns a NULL-terminated array of strings (like L), or NULL if there was an error. I. +=head2 guestfs_mv + + int guestfs_mv (guestfs_h *handle, + const char *src, + const char *dest); + +This moves a file from C to C where C is +either a destination filename or destination directory. + +This function returns 0 on success or -1 on error. + +=head2 guestfs_ping_daemon + + int guestfs_ping_daemon (guestfs_h *handle); + +This is a test probe into the guestfs daemon running inside +the qemu subprocess. Calling this function checks that the +daemon responds to the ping message, without affecting the daemon +or attached block device(s) in any other way. + +This function returns 0 on success or -1 on error. + =head2 guestfs_pvcreate int guestfs_pvcreate (guestfs_h *handle, @@ -1293,6 +1438,46 @@ This function returns a C or NULL if there was an error. I after use>. +=head2 guestfs_strings + + char **guestfs_strings (guestfs_h *handle, + const char *path); + +This runs the L command on a file and returns +the list of printable strings found. + +This function returns a NULL-terminated array of strings +(like L), or NULL if there was an error. +I. + +Because of the message protocol, there is a transfer limit +of somewhere between 2MB and 4MB. To transfer large files you should use +FTP. + +=head2 guestfs_strings_e + + char **guestfs_strings_e (guestfs_h *handle, + const char *encoding, + const char *path); + +This is like the C command, but allows you to +specify the encoding. + +See the L manpage for the full list of encodings. + +Commonly useful encodings are C (lower case L) which will +show strings inside Windows/x86 files. + +The returned strings are transcoded to UTF-8. + +This function returns a NULL-terminated array of strings +(like L), or NULL if there was an error. +I. + +Because of the message protocol, there is a transfer limit +of somewhere between 2MB and 4MB. To transfer large files you should use +FTP. + =head2 guestfs_sync int guestfs_sync (guestfs_h *handle); @@ -1501,9 +1686,27 @@ As a special case, if C is C<0> then the length is calculated using C (so in this case the content cannot contain embedded ASCII NULs). +I Owing to a bug, writing content containing ASCII NUL +characters does I work, even if the length is specified. +We hope to resolve this bug in a future version. In the meantime +use C. + This function returns 0 on success or -1 on error. Because of the message protocol, there is a transfer limit of somewhere between 2MB and 4MB. To transfer large files you should use FTP. +=head2 guestfs_zero + + int guestfs_zero (guestfs_h *handle, + const char *device); + +This command writes zeroes over the first few blocks of C. + +How many blocks are zeroed isn't specified (but it's I enough +to securely wipe the device). It should be sufficient to remove +any partition tables, filesystem superblocks and so on. + +This function returns 0 on success or -1 on error. +