Files
libguestfs/daemon
Richard W.M. Jones 330fbea5b2 Clarify the error message when unavailable functions are called (RHBZ#679737).
Callers are supposed to use the availability API to check for
functions that may not be available in particular builds of
libguestfs.  If they don't do this, currently they tend to get obscure
error messages, eg:

  libguestfs: error: zerofree: /dev/vda1: zerofree: No such file or directory

This commit changes the error message to explain what callers ought to
be doing instead:

  libguestfs: error: zerofree: feature 'zerofree' is not available in this
  build of libguestfs.  Read 'AVAILABILITY' in the guestfs(3) man page for
  how to check for the availability of features.

This patch makes the stubs check for availability.  The stub code
changes to:

  static void
  zerofree_stub (XDR *xdr_in)
  {
  [...]

    /* The caller should have checked before calling this. */
    if (! optgroup_zerofree_available ()) {
      reply_with_error ("feature '%s' is not available in this\n"
                        "build of libguestfs.  Read 'AVAILABILITY' in the guestfs(3) man page for\n"
                        "how to check for the availability of features.",
                        "zerofree");
      goto done;
    }
  [...]
2012-02-01 15:09:09 +00:00
..
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2012-01-18 22:05:02 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2011-11-08 14:43:07 +00:00
2012-01-18 22:05:02 +00:00
2011-11-08 14:43:07 +00:00