It's often the case that you want to write a file or files to the disk
image.
-For small, single files, use L</guestfs_write_file>. This call
-currently contains a bug which limits the call to plain text files
-(not containing ASCII NUL characters).
+To write a small file with fixed content, use L</guestfs_write>. To
+create a file of all zeroes, use L</guestfs_truncate_size> (sparse) or
+L</guestfs_fallocate64> (with all disk blocks allocated). There are a
+variety of other functions for creating test files, for example
+L</guestfs_fill> and L</guestfs_fill_pattern>.
To upload a single file, use L</guestfs_upload>. This call has no
limits on file content or size (even files larger than 4 GB).
since. Like the Bourne shell, we should have used C<guestfish -c
command> to run commands.
+=item Protocol limit of 256 characters for error messages
+
+This limit is both rather small and quite unnecessary. We should be
+able to return error messages up to the length of the protocol message
+(2-4 MB).
+
+Note that we cannot change the protocol without some breakage, because
+there are distributions that repackage the Fedora appliance.
+
+=item Protocol should return errno with error messages.
+
+It would be a nice-to-have to be able to get the original value of
+'errno' from inside the appliance along error paths (where set).
+Currently L<guestmount(1)> goes through hoops to try to reverse the
+error message string into an errno, see the function error() in
+fuse/guestmount.c.
+
=back
=head2 PROTOCOL LIMITS
@AVAILABILITY@
+=head2 GUESTFISH supported COMMAND
+
+In L<guestfish(3)> there is a handy interactive command
+C<supported> which prints out the available groups and
+whether they are supported by this build of libguestfs.
+Note however that you have to do C<run> first.
+
=head2 SINGLE CALLS AT COMPILE TIME
If you need to test whether a single libguestfs function is
typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);
void guestfs_set_launch_done_callback (guestfs_h *g,
- guestfs_ready_cb cb,
+ guestfs_launch_done_cb cb,
void *opaque);
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