summaryrefslogtreecommitdiffstats
path: root/src/guestfs.pod
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-06-10 12:38:57 +0100
committerRichard Jones <rjones@redhat.com>2010-06-10 14:30:36 +0100
commitdbfd93b72f99ebdded394541a48177c415db8cbf (patch)
tree5bfe6e3aa6a8f33ab80d268064799985a5f1249b /src/guestfs.pod
parent91b00dc092be17a309f14fc35f41dbf1e41c4c58 (diff)
downloadlibguestfs-dbfd93b72f99ebdded394541a48177c415db8cbf.tar.gz
libguestfs-dbfd93b72f99ebdded394541a48177c415db8cbf.tar.xz
libguestfs-dbfd93b72f99ebdded394541a48177c415db8cbf.zip
Add error callback (RHBZ#602599).
Read the note in the man page before using this feature.
Diffstat (limited to 'src/guestfs.pod')
-rw-r--r--src/guestfs.pod18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/guestfs.pod b/src/guestfs.pod
index 0f60c8e5..2fa3aceb 100644
--- a/src/guestfs.pod
+++ b/src/guestfs.pod
@@ -1042,6 +1042,24 @@ The callback function C<cb> will be called when the child process
becomes ready first time after it has been launched. (This
corresponds to a transition from LAUNCHING to the READY state).
+=head2 guestfs_set_close_callback
+
+ typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);
+ void guestfs_set_close_callback (guestfs_h *g,
+ guestfs_close_cb cb,
+ void *opaque);
+
+The callback function C<cb> will be called while the handle
+is being closed (synchronously from L</guestfs_close>).
+
+Note that libguestfs installs an L<atexit(3)> handler to try to
+clean up handles that are open when the program exits. This
+means that this callback might be called indirectly from
+L<exit(3)>, which can cause unexpected problems in higher-level
+languages (eg. if your HLL interpreter has already been cleaned
+up by the time this is called, and if your callback then jumps
+into some HLL function).
+
=head1 BLOCK DEVICE NAMING
In the kernel there is now quite a profusion of schemata for naming