X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fguestfs.pod;h=3b43b6549441f839c455f99252af5287616db838;hb=2e4669d6e7053b0347b265d4f330e8873525bd3e;hp=93f31e610fd541ede979591390072e6c8b877a62;hpb=54ffbc2f3fcd9cb951ea2f6e1e6ffb8b8b98a58a;p=libguestfs.git diff --git a/src/guestfs.pod b/src/guestfs.pod index 93f31e6..3b43b65 100644 --- a/src/guestfs.pod +++ b/src/guestfs.pod @@ -99,7 +99,7 @@ this: * disk image. */ guestfs_touch (g, "/hello"); - + /* This is only needed for libguestfs < 1.5.24. Since then * it is done automatically when you close the handle. See * discussion of autosync in this page. @@ -162,27 +162,33 @@ NAMING> below. Before you can read or write files, create directories and so on in a disk image that contains filesystems, you have to mount those -filesystems using L. If you already know that a disk -image contains (for example) one partition with a filesystem on that -partition, then you can mount it directly: +filesystems using L or L. +If you already know that a disk image contains (for example) one +partition with a filesystem on that partition, then you can mount it +directly: - guestfs_mount (g, "/dev/sda1", "/"); + guestfs_mount_options (g, "", "/dev/sda1", "/"); where C means literally the first partition (C<1>) of the first disk image that we added (C). If the disk contains -Linux LVM2 logical volumes you could refer to those instead (eg. C). +Linux LVM2 logical volumes you could refer to those instead +(eg. C). Note that these are libguestfs virtual devices, +and are nothing to do with host devices. If you are given a disk image and you don't know what it contains then you have to find out. Libguestfs can do that too: use L and L to list possible partitions and LVs, and either try mounting each to see what is mountable, or else examine them with L or -L. Libguestfs also has a set of APIs for inspection of -disk images (see L below). But you might find it easier -to look at higher level programs built on top of libguestfs, in +L. To list just filesystems, use +L. + +Libguestfs also has a set of APIs for inspection of unknown disk +images (see L below). But you might find it easier to +look at higher level programs built on top of libguestfs, in particular L. -To mount a disk image read-only, use L. There are +To mount a filesystem read-only, use L. There are several other variations of the C call. =head2 FILESYSTEM ACCESS AND MODIFICATION @@ -256,10 +262,9 @@ L. =head2 DOWNLOADING -Use L to download small, text only files. This call -is limited to files which are less than 2 MB and which cannot contain -any ASCII NUL (C<\0>) characters. However it has a very simple -to use API. +Use L to download small, text only files. This call is +limited to files which are less than 2 MB and which cannot contain any +ASCII NUL (C<\0>) characters. However the API is very simple to use. L can be used to read files which contain arbitrary 8 bit data, since it returns a (pointer, size) pair. @@ -347,13 +352,13 @@ descriptor N. For example, L writes its output to stdout by doing: - guestfs_download (filename, "/dev/stdout"); + guestfs_download (g, filename, "/dev/stdout"); and you can write tar output to a pipe C by doing: char devfd[64]; snprintf (devfd, sizeof devfd, "/dev/fd/%d", fd); - guestfs_tar_out ("/", devfd); + guestfs_tar_out (g, "/", devfd); =head2 LISTING FILES @@ -670,9 +675,9 @@ Although we don't want to discourage you from using the C API, we will mention here that the same API is also available in other languages. The API is broadly identical in all supported languages. This means -that the C call C is -C<$g-Emount($path)> in Perl, C in Python, -and C in OCaml. In other words, a +that the C call C is +C<$g-Eadd_drive_ro($file)> in Perl, C in Python, +and C in OCaml. In other words, a straightforward, predictable isomorphism between each language. Error messages are automatically transformed @@ -708,11 +713,11 @@ with libguestfs. =item B -For documentation see L. +See L. =item B -For documentation see L. +See L. =item B @@ -723,15 +728,15 @@ The PHP binding only works correctly on 64 bit machines. =item B -For documentation see L. +See L. =item B -For documentation see L. +See L. =item B -For documentation see L. +See L. =back @@ -907,8 +912,8 @@ architecture for multithreaded programs using libvirt and libguestfs. =head2 PATH -Libguestfs needs a kernel and initrd.img, which it finds by looking -along an internal path. +Libguestfs needs a supermin appliance, which it finds by looking along +an internal path. By default it looks for these in the directory C<$libdir/guestfs> (eg. C or C). @@ -1706,7 +1711,8 @@ indicator which shows the ratio of C:C. =item * If any progress notification is sent during a call, then a final -progress notification is always sent when C = C. +progress notification is always sent when C = C +(I the call fails with an error). This is to simplify caller code, so callers can easily set the progress indicator to "100%" at the end of the operation, without @@ -2452,8 +2458,8 @@ example: =item LIBGUESTFS_PATH -Set the path that libguestfs uses to search for kernel and initrd.img. -See the discussion of paths in section PATH above. +Set the path that libguestfs uses to search for a supermin appliance. +See the discussion of paths in section L above. =item LIBGUESTFS_QEMU