X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=guestfs.pod;h=d717595148ac94a68f82b1052be13a999ab782de;hp=dcfa51c9989abad13f9011f42f914443bb2f4646;hb=747eb7138ada2c999abc686fc5de18bcad96a1b7;hpb=259f78cfa70af5505b8172bb81a3d1e2d7581bb5 diff --git a/guestfs.pod b/guestfs.pod index dcfa51c..d717595 100644 --- a/guestfs.pod +++ b/guestfs.pod @@ -7,7 +7,7 @@ guestfs - Library for accessing and modifying virtual machine images =head1 SYNOPSIS #include - + guestfs_h *handle = guestfs_create (); guestfs_add_drive (handle, "guest.img"); guestfs_launch (handle); @@ -60,35 +60,35 @@ and finally closing the handle. So the general structure of all libguestfs-using programs looks like this: guestfs_h *handle = guestfs_create (); - + /* Call guestfs_add_drive additional times if there are * multiple disk images. */ guestfs_add_drive (handle, "guest.img"); - + /* Most manipulation calls won't work until you've launched * the handle. You have to do this _after_ adding drives * and _before_ other commands. */ guestfs_launch (handle); - + /* Now you can examine what partitions, LVs etc are available. */ char **partitions = guestfs_list_partitions (handle); char **logvols = guestfs_lvs (handle); - + /* To access a filesystem in the image, you must mount it. */ guestfs_mount (handle, "/dev/sda1", "/"); - + /* Now you can perform filesystem actions on the guest disk image. */ guestfs_touch (handle, "/hello"); - + /* You only need to call guestfs_sync if you have made * changes to the guest image. */ guestfs_sync (handle); - + /* Close the handle. */ guestfs_close (handle);