+The convention in all functions that return C<int> is that they return
+C<-1> to indicate an error. You can get additional information on
+errors by calling C<guestfs_set_error_handler>. The default error
+handler prints the information string to C<stderr>.
+
+Out of memory errors are handled differently. The default action is
+to call L<abort(3)>. If this is undesirable, then you can set a
+handler using C<guestfs_set_out_of_memory_handler>.
+
+=head2 guestfs_set_error_handler
+
+ typedef void (*guestfs_error_handler_cb) (void *data, const char *msg);
+ void guestfs_set_error_handler (guestfs_h *handle,
+ guestfs_error_handler_cb cb,
+ void *data);
+
+The callback C<cb> will be called if there is an error. The
+parameters passed to the callback are an opaque data pointer and the
+error message string.
+
+The default handler prints messages on C<stderr>.
+
+If you set C<cb> to C<NULL> then I<no> handler is called and the error
+message is completely discarded.
+
+=head2 guestfs_get_error_handler
+
+ guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *handle);
+
+Returns the current error handler callback.
+
+=head2 guestfs_set_out_of_memory_handler
+
+ typedef void (*guestfs_abort_cb) (void);
+ int guestfs_set_out_of_memory_handler (guestfs_h *handle,
+ guestfs_abort_cb);
+
+The callback C<cb> will be called if there is an out of memory
+situation. I<Note this callback must not return>.
+
+The default is to call L<abort(3)>.
+
+You cannot set C<cb> to C<NULL>. You can't ignore out of memory
+situations.
+
+=head2 guestfs_get_out_of_memory_handler
+
+ guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *handle);
+
+This returns the current out of memory handler.
+
+=head1 VERBOSE MESSAGES
+
+=head2 guestfs_set_verbose
+
+ void guestfs_set_verbose (guestfs_h *handle, int verbose);
+
+If C<verbose> is true, this turns on verbose messages (to C<stderr>).
+
+Verbose messages are disabled unless the environment variable
+C<LIBGUESTFS_DEBUG> is defined and set to C<1>.
+
+=head2 guestfs_get_verbose
+
+ int guestfs_get_verbose (guestfs_h *handle);
+
+This returns the verbose messages flag.
+
+=head1 HIGH-LEVEL API ACTIONS
+
+=head2 guestfs_sync
+
+ int guestfs_sync (guestfs_h *handle);
+
+This syncs the disk, so that any writes are flushed through to the
+underlying disk image.
+
+You should always call this if you have modified a disk image, before
+calling C<guestfs_close>.
+
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
+Documentation will be auto-generated from here, including for
+guestfs_sync.
+
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
+ do_[action] ([parameters])
+ {
+ guestfs_set_reply_callback (handle, [action]_cb, data);
+ guestfs_nb_[action] (handle, [parameters ...]);
+
+ guestfs_main_loop_run (); /* --> blocks, then calls my_cb */
+ }
+
+ [action]_cb (guestfs_h *handle, void *data)
+ {
+ retval = guestfs_nb_[action]_r (handle);
+ /* ... */
+ guestfs_main_loop_quit ();
+ return retval;
+ }
+
+XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
+
+