X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=guestfs.pod;h=bf75e423c53aa604cfbf9842ca3495e7a1f03208;hb=cd2fd58da3f5648a62f3fb7586cdc910c09a31af;hp=a3ef84bb6becfa9651f3485b585cb90a7750c014;hpb=27146d368a4956a44c59d1a7fea4ab92685e080c;p=libguestfs.git diff --git a/guestfs.pod b/guestfs.pod index a3ef84b..bf75e42 100644 --- a/guestfs.pod +++ b/guestfs.pod @@ -257,40 +257,7 @@ 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. - -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 @@ -417,9 +384,9 @@ For example: /* returns immediately */ } - my_cb (guestfs_h *handle, void *data) + my_cb (guestfs_h *handle, void *data, XDR *xdr) { - retval = guestfs_nb_[action]_r (handle); + retval = guestfs_nb_[action]_r (handle, xdr); /* ... */ } @@ -429,6 +396,7 @@ high-level API. =head2 guestfs_set_reply_callback + typedef void (*guestfs_reply_cb) (guestfs_h *g, void *opaque, XDR *xdr); void guestfs_set_reply_callback (guestfs_h *handle, guestfs_reply_cb cb, void *opaque); @@ -437,8 +405,14 @@ The callback function C will be called whenever a reply is received from the child process. (This corresponds to a transition from the BUSY state to the READY state). +Note that the C that you get in the callback is in C +mode, and you need to consume it before you return from the callback +function (since it gets destroyed after). + =head2 guestfs_set_log_message_callback + typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque, + char *buf, int len); void guestfs_set_log_message_callback (guestfs_h *handle, guestfs_log_message_cb cb, void *opaque); @@ -453,6 +427,7 @@ discarded. =head2 guestfs_set_subprocess_quit_callback + typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque); void guestfs_set_subprocess_quit_callback (guestfs_h *handle, guestfs_subprocess_quit_cb cb, void *opaque); @@ -464,6 +439,7 @@ any state to the CONFIG state). =head2 guestfs_set_launch_done_callback + typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque); void guestfs_set_launch_done_callback (guestfs_h *handle, guestfs_ready_cb cb, void *opaque); @@ -483,9 +459,9 @@ two are provided for you: =over 4 -=item libguestfs-poll +=item libguestfs-select -A simple main loop that is implemented using L. +A simple main loop that is implemented using L. This is the default main loop unless you call C or C. @@ -562,8 +538,8 @@ function, eg. C. In those cases, ignore this call. =head2 WRITING A CUSTOM MAIN LOOP -This isn't documented. Please see the libguestfs-poll and libguestfs-glib -implementations. +This isn't documented. Please see the libguestfs-select and +libguestfs-glib implementations. =head1 SEE ALSO