+"C<errno> is not passed to the callback. To get that the callback must call "
+"L</guestfs_last_errno>."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1321
+msgid ""
+"Note that the message string C<msg> is freed as soon as the callback "
+"function returns, so if you want to stash it somewhere you must make your "
+"own copy."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1325
+msgid "The default handler prints messages on C<stderr>."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1327
+msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1329
+msgid "guestfs_get_error_handler"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1331
+#, no-wrap
+msgid ""
+" guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
+" void **opaque_rtn);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1334
+msgid "Returns the current error handler callback."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1336
+msgid "guestfs_set_out_of_memory_handler"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1338
+#, no-wrap
+msgid ""
+" typedef void (*guestfs_abort_cb) (void);\n"
+" int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
+" guestfs_abort_cb);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1342
+msgid ""
+"The callback C<cb> will be called if there is an out of memory situation. "
+"I<Note this callback must not return>."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1345
+msgid "The default is to call L<abort(3)>."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1347
+msgid ""
+"You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1350
+msgid "guestfs_get_out_of_memory_handler"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1352
+#, no-wrap
+msgid ""
+" guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1354
+msgid "This returns the current out of memory handler."
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:1356
+msgid "API CALLS"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1358 ../fish/guestfish.pod:908
+msgid "@ACTIONS@"
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:1360
+msgid "STRUCTURES"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1362
+msgid "@STRUCTS@"
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:1364
+msgid "AVAILABILITY"
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1366
+msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1368
+msgid ""
+"Using L</guestfs_available> you can test availability of the following "
+"groups of functions. This test queries the appliance to see if the "
+"appliance you are currently using supports the functionality."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1373
+msgid "@AVAILABILITY@"
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1375
+msgid "GUESTFISH supported COMMAND"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1377
+msgid ""
+"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."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1382
+msgid "SINGLE CALLS AT COMPILE TIME"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1384
+msgid ""
+"Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
+"function, such as:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1387
+#, no-wrap
+msgid ""
+" #define LIBGUESTFS_HAVE_DD 1\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1389
+msgid "if L</guestfs_dd> is available."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1391
+msgid ""
+"Before version 1.5.8, if you needed to test whether a single libguestfs "
+"function is available at compile time, we recommended using build tools such "
+"as autoconf or cmake. For example in autotools you could use:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1396
+#, no-wrap
+msgid ""
+" AC_CHECK_LIB([guestfs],[guestfs_create])\n"
+" AC_CHECK_FUNCS([guestfs_dd])\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1399
+msgid ""
+"which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
+"in your program."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1402
+msgid "SINGLE CALLS AT RUN TIME"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1404
+msgid ""
+"Testing at compile time doesn't guarantee that a function really exists in "
+"the library. The reason is that you might be dynamically linked against a "
+"previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
+"This situation unfortunately results in a segmentation fault, which is a "
+"shortcoming of the C dynamic linking system itself."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1411
+msgid ""
+"You can use L<dlopen(3)> to test if a function is available at run time, as "
+"in this example program (note that you still need the compile time check as "
+"well):"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1415
+#, no-wrap
+msgid ""
+" #include <stdio.h>\n"
+" #include <stdlib.h>\n"
+" #include <unistd.h>\n"
+" #include <dlfcn.h>\n"
+" #include <guestfs.h>\n"
+" \n"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1421
+#, no-wrap
+msgid ""
+" main ()\n"
+" {\n"
+" #ifdef LIBGUESTFS_HAVE_DD\n"
+" void *dl;\n"
+" int has_function;\n"
+" \n"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1427
+#, no-wrap
+msgid ""
+" /* Test if the function guestfs_dd is really available. */\n"
+" dl = dlopen (NULL, RTLD_LAZY);\n"
+" if (!dl) {\n"
+" fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
+" exit (EXIT_FAILURE);\n"
+" }\n"
+" has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
+" dlclose (dl);\n"
+" \n"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1436
+#, no-wrap
+msgid ""
+" if (!has_function)\n"
+" printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
+" else {\n"
+" printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
+" /* Now it's safe to call\n"
+" guestfs_dd (g, \"foo\", \"bar\");\n"
+" */\n"
+" }\n"
+" #else\n"
+" printf (\"guestfs_dd function was not found at compile time\\n\");\n"
+" #endif\n"
+" }\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1449
+msgid ""
+"You may think the above is an awful lot of hassle, and it is. There are "
+"other ways outside of the C linking system to ensure that this kind of "
+"incompatibility never arises, such as using package versioning:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1454
+#, no-wrap
+msgid ""
+" Requires: libguestfs >= 1.0.80\n"
+"\n"
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:1456
+msgid "CALLS WITH OPTIONAL ARGUMENTS"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1458
+msgid ""
+"A recent feature of the API is the introduction of calls which take optional "
+"arguments. In C these are declared 3 ways. The main way is as a call which "
+"takes variable arguments (ie. C<...>), as in this example:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1463
+#, no-wrap
+msgid ""
+" int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1465
+msgid ""
+"Call this with a list of optional arguments, terminated by C<-1>. So to "
+"call with no optional arguments specified:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1468
+#, no-wrap
+msgid ""
+" guestfs_add_drive_opts (g, filename, -1);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1470
+msgid "With a single optional argument:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1472
+#, no-wrap
+msgid ""
+" guestfs_add_drive_opts (g, filename,\n"
+" GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
+" -1);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1476
+msgid "With two:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1478
+#, no-wrap
+msgid ""
+" guestfs_add_drive_opts (g, filename,\n"
+" GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
+" GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
+" -1);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1483
+msgid ""
+"and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
+"happen!"
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1486
+msgid "USING va_list FOR OPTIONAL ARGUMENTS"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1488
+msgid ""
+"The second variant has the same name with the suffix C<_va>, which works the "
+"same way but takes a C<va_list>. See the C manual for details. For the "
+"example function, this is declared:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1492
+#, no-wrap
+msgid ""
+" int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
+" va_list args);\n"
+"\n"
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1495
+msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1497
+msgid ""
+"The third variant is useful where you need to construct these calls. You "
+"pass in a structure where you fill in the optional fields. The structure "
+"has a bitmask as the first element which you must set to indicate which "
+"fields you have filled in. For our example function the structure and call "
+"are declared:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1503
+#, no-wrap
+msgid ""
+" struct guestfs_add_drive_opts_argv {\n"
+" uint64_t bitmask;\n"
+" int readonly;\n"
+" const char *format;\n"
+" /* ... */\n"
+" };\n"
+" int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
+" const struct guestfs_add_drive_opts_argv *optargs);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1512
+msgid "You could call it like this:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1514
+#, no-wrap
+msgid ""
+" struct guestfs_add_drive_opts_argv optargs = {\n"
+" .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
+" GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
+" .readonly = 1,\n"
+" .format = \"qcow2\"\n"
+" };\n"
+" \n"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1521
+#, no-wrap
+msgid ""
+" guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1523 ../src/guestfs-actions.pod:11
+#: ../src/guestfs-actions.pod:1842 ../fish/guestfish-actions.pod:9
+#: ../fish/guestfish-actions.pod:1255
+msgid "Notes:"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1529
+msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1534
+msgid "You do not need to fill in all fields of the structure."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1538
+msgid ""
+"There must be a one-to-one correspondence between fields of the structure "
+"that are filled in, and bits set in the bitmask."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1543
+msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1545
+msgid ""
+"In other languages, optional arguments are expressed in the way that is "
+"natural for that language. We refer you to the language-specific "
+"documentation for more details on that."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1549
+msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1551
+msgid "SETTING CALLBACKS TO HANDLE EVENTS"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1553
+msgid ""
+"The child process generates events in some situations. Current events "
+"include: receiving a log message, the child process exits."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1556
+msgid ""
+"Use the C<guestfs_set_*_callback> functions to set a callback for different "
+"types of events."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1559
+msgid ""
+"Only I<one callback of each type> can be registered for each handle. "
+"Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
+"that type. Cancel all callbacks of this type by calling this function with "
+"C<cb> set to C<NULL>."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1564
+msgid "guestfs_set_log_message_callback"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1566
+#, no-wrap
+msgid ""
+" typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
+" char *buf, int len);\n"
+" void guestfs_set_log_message_callback (guestfs_h *g,\n"
+" guestfs_log_message_cb cb,\n"
+" void *opaque);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1572
+msgid ""
+"The callback function C<cb> will be called whenever qemu or the guest writes "
+"anything to the console."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1575
+msgid "Use this function to capture kernel messages and similar."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1577
+msgid ""
+"Normally there is no log message handler, and log messages are just "
+"discarded."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1580
+msgid "guestfs_set_subprocess_quit_callback"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1582
+#, no-wrap
+msgid ""
+" typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
+" void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
+" guestfs_subprocess_quit_cb cb,\n"
+" void *opaque);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1587
+msgid ""
+"The callback function C<cb> will be called when the child process quits, "
+"either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
+"corresponds to a transition from any state to the CONFIG state)."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1592
+msgid "guestfs_set_launch_done_callback"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1594
+#, no-wrap
+msgid ""
+" typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
+" void guestfs_set_launch_done_callback (guestfs_h *g,\n"
+" guestfs_launch_done_cb cb,\n"
+" void *opaque);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1599
+msgid ""
+"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)."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1603
+msgid "guestfs_set_close_callback"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1605
+#, no-wrap
+msgid ""
+" typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
+" void guestfs_set_close_callback (guestfs_h *g,\n"
+" guestfs_close_cb cb,\n"
+" void *opaque);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1610
+msgid ""
+"The callback function C<cb> will be called while the handle is being closed "
+"(synchronously from L</guestfs_close>)."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1613
+msgid ""
+"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)."
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1621
+msgid "guestfs_set_progress_callback"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1623
+#, no-wrap
+msgid ""
+" typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
+" int proc_nr, int serial,\n"
+" uint64_t position, uint64_t total);\n"
+" void guestfs_set_progress_callback (guestfs_h *g,\n"
+" guestfs_progress_cb cb,\n"
+" void *opaque);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1630
+msgid ""
+"Some long-running operations can generate progress messages. If this "
+"callback is registered, then it will be called each time a progress message "
+"is generated (usually two seconds after the operation started, and three "
+"times per second thereafter until it completes, although the frequency may "
+"change in future versions)."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1636
+msgid ""
+"The callback receives two numbers: C<position> and C<total>. The units of "
+"C<total> are not defined, although for some operations C<total> may relate "
+"in some way to the amount of data to be transferred (eg. in bytes or "
+"megabytes), and C<position> may be the portion which has been transferred."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1642
+msgid "The only defined and stable parts of the API are:"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1648
+msgid ""
+"The callback can display to the user some type of progress bar or indicator "
+"which shows the ratio of C<position>:C<total>."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1653
+msgid "0 E<lt>= C<position> E<lt>= C<total>"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1657
+msgid ""
+"If any progress notification is sent during a call, then a final progress "
+"notification is always sent when C<position> = C<total>."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1660
+msgid ""
+"This is to simplify caller code, so callers can easily set the progress "
+"indicator to \"100%\" at the end of the operation, without requiring special "
+"code to detect this case."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1666
+msgid ""
+"The callback also receives the procedure number and serial number of the "
+"call. These are only useful for debugging protocol issues, and the callback "
+"can normally ignore them. The callback may want to print these numbers in "
+"error messages or debugging messages."
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:1671
+msgid "PRIVATE DATA AREA"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1673
+msgid ""
+"You can attach named pieces of private data to the libguestfs handle, and "
+"fetch them by name for the lifetime of the handle. This is called the "
+"private data area and is only available from the C API."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1677
+msgid "To attach a named piece of data, use the following call:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1679
+#, no-wrap
+msgid ""
+" void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1681
+msgid ""
+"C<key> is the name to associate with this data, and C<data> is an arbitrary "
+"pointer (which can be C<NULL>). Any previous item with the same name is "
+"overwritten."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1685
+msgid ""
+"You can use any C<key> you want, but names beginning with an underscore "
+"character are reserved for internal libguestfs purposes (for implementing "
+"language bindings). It is recommended to prefix the name with some unique "
+"string to avoid collisions with other users."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1690
+msgid "To retrieve the pointer, use:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1692
+#, no-wrap
+msgid ""
+" void *guestfs_get_private (guestfs_h *g, const char *key);\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1694
+msgid ""
+"This function returns C<NULL> if either no data is found associated with "
+"C<key>, or if the user previously set the C<key>'s C<data> pointer to "
+"C<NULL>."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1698
+msgid ""
+"Libguestfs does not try to look at or interpret the C<data> pointer in any "
+"way. As far as libguestfs is concerned, it need not be a valid pointer at "
+"all. In particular, libguestfs does I<not> try to free the data when the "
+"handle is closed. If the data must be freed, then the caller must either "
+"free it before calling L</guestfs_close> or must set up a close callback to "
+"do it (see L</guestfs_set_close_callback>, and note that only one callback "
+"can be registered for a handle)."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1706
+msgid ""
+"The private data area is implemented using a hash table, and should be "
+"reasonably efficient for moderate numbers of keys."
+msgstr ""
+
+# type: =end
+#: ../src/guestfs.pod:1709 ../src/guestfs.pod:1714
+msgid "html"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1711
+msgid ""
+"<!-- old anchor for the next section --> <a name="
+"\"state_machine_and_low_level_event_api\"/>"
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:1716
+msgid "ARCHITECTURE"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1718
+msgid ""
+"Internally, libguestfs is implemented by running an appliance (a special "
+"type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
+"process of the main program."
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1722
+#, no-wrap
+msgid ""
+" ___________________\n"
+" / \\\n"
+" | main program |\n"
+" | |\n"
+" | | child process / appliance\n"
+" | | __________________________\n"
+" | | / qemu \\\n"
+" +-------------------+ RPC | +-----------------+ |\n"
+" | libguestfs <--------------------> guestfsd | |\n"
+" | | | +-----------------+ |\n"
+" \\___________________/ | | Linux kernel | |\n"
+" | +--^--------------+ |\n"
+" \\_________|________________/\n"
+" |\n"
+" _______v______\n"
+" / \\\n"
+" | Device or |\n"
+" | disk image |\n"
+" \\______________/\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1742
+msgid ""
+"The library, linked to the main program, creates the child process and hence "
+"the appliance in the L</guestfs_launch> function."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1745
+msgid ""
+"Inside the appliance is a Linux kernel and a complete stack of userspace "
+"tools (such as LVM and ext2 programs) and a small controlling daemon called "
+"L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
+"calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
+"API calls and RPC calls to the daemon. Lastly the disk image(s) are "
+"attached to the qemu process which translates device access by the "
+"appliance's Linux kernel into accesses to the image."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1754
+msgid ""
+"A common misunderstanding is that the appliance \"is\" the virtual machine. "
+"Although the disk image you are attached to might also be used by some "
+"virtual machine, libguestfs doesn't know or care about this. (But you will "
+"care if both libguestfs's qemu process and your virtual machine are trying "
+"to update the disk image at the same time, since these usually results in "
+"massive disk corruption)."
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:1761
+msgid "STATE MACHINE"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1763
+msgid "libguestfs uses a state machine to model the child process:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1765
+#, no-wrap
+msgid ""
+" |\n"
+" guestfs_create\n"
+" |\n"
+" |\n"
+" ____V_____\n"
+" / \\\n"
+" | CONFIG |\n"
+" \\__________/\n"
+" ^ ^ ^ \\\n"
+" / | \\ \\ guestfs_launch\n"
+" / | _\\__V______\n"
+" / | / \\\n"
+" / | | LAUNCHING |\n"
+" / | \\___________/\n"
+" / | /\n"
+" / | guestfs_launch\n"
+" / | /\n"
+" ______ / __|____V\n"
+" / \\ ------> / \\\n"
+" | BUSY | | READY |\n"
+" \\______/ <------ \\________/\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1787
+msgid ""
+"The normal transitions are (1) CONFIG (when the handle is created, but there "
+"is no child process), (2) LAUNCHING (when the child process is booting up), "
+"(3) alternating between READY and BUSY as commands are issued to, and "
+"carried out by, the child process."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1792
+msgid ""
+"The guest may be killed by L</guestfs_kill_subprocess>, or may die "
+"asynchronously at any time (eg. due to some internal error), and that causes "
+"the state to transition back to CONFIG."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1796
+msgid ""
+"Configuration commands for qemu such as L</guestfs_add_drive> can only be "
+"issued when in the CONFIG state."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1799
+msgid ""
+"The API offers one call that goes from CONFIG through LAUNCHING to READY. "
+"L</guestfs_launch> blocks until the child process is READY to accept "
+"commands (or until some failure or timeout). L</guestfs_launch> internally "
+"moves the state from CONFIG to LAUNCHING while it is running."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1805
+msgid ""
+"API actions such as L</guestfs_mount> can only be issued when in the READY "
+"state. These API calls block waiting for the command to be carried out (ie. "
+"the state to transition to BUSY and then back to READY). There are no non-"
+"blocking versions, and no way to issue more than one command per handle at "
+"the same time."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1811
+msgid ""
+"Finally, the child process sends asynchronous messages back to the main "
+"program, such as kernel log messages. You can register a callback to "
+"receive these messages."
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:1815
+msgid "INTERNALS"
+msgstr ""
+
+# type: =head2
+#: ../src/guestfs.pod:1817
+msgid "COMMUNICATION PROTOCOL"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1819
+msgid ""
+"Don't rely on using this protocol directly. This section documents how it "
+"currently works, but it may change at any time."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1822
+msgid ""
+"The protocol used to talk between the library and the daemon running inside "
+"the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
+"1014, RFC 1832, RFC 4506)."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1826
+msgid ""
+"The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
+"this file is automatically generated)."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1829
+msgid ""
+"There are two broad cases, ordinary functions that don't have any C<FileIn> "
+"and C<FileOut> parameters, which are handled with very simple request/reply "
+"messages. Then there are functions that have any C<FileIn> or C<FileOut> "
+"parameters, which use the same request and reply messages, but they may also "
+"be followed by files sent using a chunked encoding."
+msgstr ""
+
+# type: =head3
+#: ../src/guestfs.pod:1836
+msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1838
+msgid "For ordinary functions, the request message is:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1840
+#, no-wrap
+msgid ""
+" total length (header + arguments,\n"
+" but not including the length word itself)\n"
+" struct guestfs_message_header (encoded as XDR)\n"
+" struct guestfs_<foo>_args (encoded as XDR)\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1845
+msgid ""
+"The total length field allows the daemon to allocate a fixed size buffer "
+"into which it slurps the rest of the message. As a result, the total length "
+"is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
+"effective size of any request is limited to somewhere under this size."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1851
+msgid ""
+"Note also that many functions don't take any arguments, in which case the "
+"C<guestfs_I<foo>_args> is completely omitted."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1854
+msgid ""
+"The header contains the procedure number (C<guestfs_proc>) which is how the "
+"receiver knows what type of args structure to expect, or none at all."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1858
+msgid "The reply message for ordinary functions is:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1860
+#, no-wrap
+msgid ""
+" total length (header + ret,\n"
+" but not including the length word itself)\n"
+" struct guestfs_message_header (encoded as XDR)\n"
+" struct guestfs_<foo>_ret (encoded as XDR)\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1865
+msgid ""
+"As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
+"functions that return no formal return values."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1868
+msgid ""
+"As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1871
+msgid ""
+"In the case of an error, a flag is set in the header, and the reply message "
+"is slightly changed:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1874
+#, no-wrap
+msgid ""
+" total length (header + error,\n"
+" but not including the length word itself)\n"
+" struct guestfs_message_header (encoded as XDR)\n"
+" struct guestfs_message_error (encoded as XDR)\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1879
+msgid ""
+"The C<guestfs_message_error> structure contains the error message as a "
+"string."
+msgstr ""
+
+# type: =head3
+#: ../src/guestfs.pod:1882
+msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1884
+msgid ""
+"A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
+"The normal request message is sent (see above). However this is followed by "
+"a sequence of file chunks."
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1888
+#, no-wrap
+msgid ""
+" total length (header + arguments,\n"
+" but not including the length word itself,\n"
+" and not including the chunks)\n"
+" struct guestfs_message_header (encoded as XDR)\n"
+" struct guestfs_<foo>_args (encoded as XDR)\n"
+" sequence of chunks for FileIn param #0\n"
+" sequence of chunks for FileIn param #1 etc.\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1896
+msgid "The \"sequence of chunks\" is:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1898
+#, no-wrap
+msgid ""
+" length of chunk (not including length word itself)\n"
+" struct guestfs_chunk (encoded as XDR)\n"
+" length of chunk\n"
+" struct guestfs_chunk (encoded as XDR)\n"
+" ...\n"
+" length of chunk\n"
+" struct guestfs_chunk (with data.data_len == 0)\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1906
+msgid ""
+"The final chunk has the C<data_len> field set to zero. Additionally a flag "
+"is set in the final chunk to indicate either successful completion or early "
+"cancellation."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1910
+msgid ""
+"At time of writing there are no functions that have more than one FileIn "
+"parameter. However this is (theoretically) supported, by sending the "
+"sequence of chunks for each FileIn parameter one after another (from left to "
+"right)."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1915
+msgid ""
+"Both the library (sender) I<and> the daemon (receiver) may cancel the "
+"transfer. The library does this by sending a chunk with a special flag set "
+"to indicate cancellation. When the daemon sees this, it cancels the whole "
+"RPC, does I<not> send any reply, and goes back to reading the next request."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1921
+msgid ""
+"The daemon may also cancel. It does this by writing a special word "
+"C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
+"the transfer, and if it gets it, it will cancel the transfer (it sends a "
+"cancel chunk). The special word is chosen so that even if cancellation "
+"happens right at the end of the transfer (after the library has finished "
+"writing and has started listening for the reply), the \"spurious\" cancel "
+"flag will not be confused with the reply message."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1930
+msgid ""
+"This protocol allows the transfer of arbitrary sized files (no 32 bit "
+"limit), and also files where the size is not known in advance (eg. from "
+"pipes or sockets). However the chunks are rather small "
+"(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
+"to keep much in memory."
+msgstr ""
+
+# type: =head3
+#: ../src/guestfs.pod:1936
+msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1938
+msgid ""
+"The protocol for FileOut parameters is exactly the same as for FileIn "
+"parameters, but with the roles of daemon and library reversed."
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1941
+#, no-wrap
+msgid ""
+" total length (header + ret,\n"
+" but not including the length word itself,\n"
+" and not including the chunks)\n"
+" struct guestfs_message_header (encoded as XDR)\n"
+" struct guestfs_<foo>_ret (encoded as XDR)\n"
+" sequence of chunks for FileOut param #0\n"
+" sequence of chunks for FileOut param #1 etc.\n"
+"\n"
+msgstr ""
+
+# type: =head3
+#: ../src/guestfs.pod:1949
+msgid "INITIAL MESSAGE"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1951
+msgid ""
+"When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
+"which indicates that the guest and daemon is alive. This is what L</"
+"guestfs_launch> waits for."
+msgstr ""
+
+# type: =head3
+#: ../src/guestfs.pod:1955
+msgid "PROGRESS NOTIFICATION MESSAGES"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1957
+msgid ""
+"The daemon may send progress notification messages at any time. These are "
+"distinguished by the normal length word being replaced by "
+"C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1961
+msgid ""
+"The library turns them into progress callbacks (see "
+"C<guestfs_set_progress_callback>) if there is a callback registered, or "
+"discards them if not."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1965
+msgid ""
+"The daemon self-limits the frequency of progress messages it sends (see "
+"C<daemon/proto.c:notify_progress>). Not all calls generate progress "
+"messages."
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:1969
+msgid "LIBGUESTFS VERSION NUMBERS"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1971
+msgid ""
+"Since April 2010, libguestfs has started to make separate development and "
+"stable releases, along with corresponding branches in our git repository. "
+"These separate releases can be identified by version number:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:1976
+#, no-wrap
+msgid ""
+" even numbers for stable: 1.2.x, 1.4.x, ...\n"
+" .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
+" |\n"
+" v\n"
+" 1 . 3 . 5\n"
+" ^ ^\n"
+" | |\n"
+" | `-------- sub-version\n"
+" |\n"
+" `------ always '1' because we don't change the ABI\n"
+"\n"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1987
+msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1989
+msgid ""
+"As time passes we cherry pick fixes from the development branch and backport "
+"those into the stable branch, the effect being that the stable branch should "
+"get more stable and less buggy over time. So the stable releases are ideal "
+"for people who don't need new features but would just like the software to "
+"work."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:1995
+msgid "Our criteria for backporting changes are:"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2001
+msgid ""
+"Documentation changes which don't affect any code are backported unless the "
+"documentation refers to a future feature which is not in stable."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2007
+msgid ""
+"Bug fixes which are not controversial, fix obvious problems, and have been "
+"well tested are backported."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2012
+msgid ""
+"Simple rearrangements of code which shouldn't affect how it works get "
+"backported. This is so that the code in the two branches doesn't get too "
+"far out of step, allowing us to backport future fixes more easily."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2018
+msgid ""
+"We I<don't> backport new features, new APIs, new tools etc, except in one "
+"exceptional case: the new feature is required in order to implement an "
+"important bug fix."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2024
+msgid ""
+"A new stable branch starts when we think the new features in development are "
+"substantial and compelling enough over the current stable branch to warrant "
+"it. When that happens we create new stable and development versions 1.N.0 "
+"and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
+"stable at this point, but by backporting fixes from development, that branch "
+"will stabilize over time."
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:2032 ../fish/guestfish.pod:915
+#: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
+#: ../tools/virt-rescue.pl:255
+msgid "ENVIRONMENT VARIABLES"
+msgstr ""
+
+# type: =item
+#: ../src/guestfs.pod:2036 ../fish/guestfish.pod:941
+msgid "LIBGUESTFS_APPEND"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2038 ../fish/guestfish.pod:943
+msgid "Pass additional options to the guest kernel."
+msgstr ""
+
+# type: =item
+#: ../src/guestfs.pod:2040 ../fish/guestfish.pod:945
+msgid "LIBGUESTFS_DEBUG"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2042
+msgid ""
+"Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
+"effect as calling C<guestfs_set_verbose (g, 1)>."
+msgstr ""
+
+# type: =item
+#: ../src/guestfs.pod:2045 ../fish/guestfish.pod:950
+msgid "LIBGUESTFS_MEMSIZE"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2047 ../fish/guestfish.pod:952
+msgid ""
+"Set the memory allocated to the qemu process, in megabytes. For example:"
+msgstr ""
+
+# type: verbatim
+#: ../src/guestfs.pod:2050 ../fish/guestfish.pod:955
+#, no-wrap
+msgid ""
+" LIBGUESTFS_MEMSIZE=700\n"
+"\n"
+msgstr ""
+
+# type: =item
+#: ../src/guestfs.pod:2052 ../fish/guestfish.pod:957
+msgid "LIBGUESTFS_PATH"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2054
+msgid ""
+"Set the path that libguestfs uses to search for kernel and initrd.img. See "
+"the discussion of paths in section PATH above."
+msgstr ""
+
+# type: =item
+#: ../src/guestfs.pod:2057 ../fish/guestfish.pod:962
+msgid "LIBGUESTFS_QEMU"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2059 ../fish/guestfish.pod:964
+msgid ""
+"Set the default qemu binary that libguestfs uses. If not set, then the qemu "
+"which was found at compile time by the configure script is used."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2063
+msgid "See also L</QEMU WRAPPERS> above."
+msgstr ""
+
+# type: =item
+#: ../src/guestfs.pod:2065 ../fish/guestfish.pod:968
+msgid "LIBGUESTFS_TRACE"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2067
+msgid ""
+"Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
+"effect as calling C<guestfs_set_trace (g, 1)>."
+msgstr ""
+
+# type: =item
+#: ../src/guestfs.pod:2070 ../fish/guestfish.pod:977
+msgid "TMPDIR"
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2072 ../fish/guestfish.pod:979
+msgid "Location of temporary directory, defaults to C</tmp>."
+msgstr ""
+
+# type: textblock
+#: ../src/guestfs.pod:2074 ../fish/guestfish.pod:981
+msgid ""
+"If libguestfs was compiled to use the supermin appliance then the real "
+"appliance is cached in this directory, shared between all handles belonging "
+"to the same EUID. You can use C<$TMPDIR> to configure another directory to "
+"use in case C</tmp> is not large enough."
+msgstr ""
+
+# type: =head1
+#: ../src/guestfs.pod:2082 ../fish/guestfish.pod:1039
+#: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233
+#: ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:484
+#: ../tools/virt-df.pl:640 ../tools/virt-resize.pl:1485
+#: ../tools/virt-list-filesystems.pl:189 ../tools/virt-tar.pl:281
+#: ../tools/virt-rescue.pl:267 ../tools/virt-make-fs.pl:534
+#: ../tools/virt-list-partitions.pl:257
+msgid "SEE ALSO"