=head1 SYNOPSIS
#include <guestfs.h>
-
+
guestfs_h *handle = guestfs_create ();
guestfs_add_drive (handle, "guest.img");
guestfs_launch (handle);
functions in the following order:
guestfs_h *handle = guestfs_create ();
-
+
guestfs_add_drive (handle, "guest.img");
/* call guestfs_add_drive additional times if the guest has
* multiple disks
*/
-
+
guestfs_launch (handle);
guestfs_wait_ready (handle);
/* now you can examine what partitions, LVs etc are available
* you have to mount / at least
- */
+ */
guestfs_mount (handle, "/dev/sda1", "/");
/* now you can perform 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);
-
+
guestfs_close (handle);
C<guestfs_wait_ready> and all of the actions including C<guestfs_sync>
Returns the current error handler callback.
-=head2 guestfs_set_out_of_memory_handler
+=head2 guestfs_set_out_of_memory_handler
typedef void (*guestfs_abort_cb) (void);
int guestfs_set_out_of_memory_handler (guestfs_h *handle,
=over 4
+=item LIBGUESTFS_APPEND
+
+Pass additional options to the guest kernel.
+
=item LIBGUESTFS_DEBUG
Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This
has the same effect as calling C<guestfs_set_verbose (handle, 1)>.
+=item LIBGUESTFS_MEMSIZE
+
+Set the memory allocated to the qemu process, in megabytes. For
+example:
+
+ LIBGUESTFS_MEMSIZE=700
+
=item LIBGUESTFS_PATH
Set the path that libguestfs uses to search for kernel and initrd.img.
See also L<QEMU WRAPPERS> above.
-=item LIBGUESTFS_APPEND
-
-Pass additional options to the guest kernel.
-
-=item LIBGUESTFS_MEMSIZE
-
-Set the memory allocated to the qemu process, in megabytes. For
-example:
-
- LIBGUESTFS_MEMSIZE=700
-
=back
=head1 SEE ALSO