Better error messages for FUSE and other things not supported.

The bare message "FUSE not supported" wasn't actionable.
This commit is contained in:
Richard W.M. Jones
2013-04-03 12:33:24 +01:00
parent d0a8cca9a1
commit 3dcb572bda
3 changed files with 10 additions and 5 deletions

View File

@@ -109,7 +109,7 @@ do_compressX_out (const char *file, const char *filter, int is_device)
#define CHECK_SUPPORTED(prog) \
if (!prog_exists (prog)) \
/* note: substring "not supported" must appear in this error */ \
NOT_SUPPORTED (-1, "compression type %s is not supported", prog);
NOT_SUPPORTED (-1, "compression type %s is not supported, because external program '%s' is not available in the appliance", prog, prog);
static int
get_filter (const char *ctype, int level, char *ret, size_t n)

View File

@@ -1476,24 +1476,29 @@ dir_cache_invalidate (guestfs_h *g, const char *path)
#else /* !HAVE_FUSE */
#define FUSE_NOT_SUPPORTED() \
NOT_SUPPORTED (g, -1, _("FUSE is not supported in this build of " \
"libguestfs because libfuse was not found " \
"when libguestfs was compiled"))
int
guestfs__mount_local (guestfs_h *g, const char *localmountpoint,
const struct guestfs_mount_local_argv *optargs)
{
NOT_SUPPORTED (g, -1, _("FUSE not supported"));
FUSE_NOT_SUPPORTED ();
}
int
guestfs__mount_local_run (guestfs_h *g)
{
NOT_SUPPORTED (g, -1, _("FUSE not supported"));
FUSE_NOT_SUPPORTED ();
}
int
guestfs__umount_local (guestfs_h *g,
const struct guestfs_umount_local_argv *optargs)
{
NOT_SUPPORTED (g, -1, _("FUSE not supported"));
FUSE_NOT_SUPPORTED ();
}
#endif /* !HAVE_FUSE */

View File

@@ -572,7 +572,7 @@ int
guestfs___osinfo_map (guestfs_h *g, const struct guestfs_isoinfo *isoinfo,
const struct osinfo **osinfo_ret)
{
debug (g, "osinfo: libxml2 not available");
debug (g, "osinfo: libxml2 not available at compile time");
return 0;
}