mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
inspection: Set last errno to ENOTSUP when inspection APIs are not available.
Previously there was no programmatic way to tell if inspection APIs were unavailable because they are not compiled in (because hivex isn't around). This contrasts with daemon APIs where the availability is covered by the guestfs_available API. Change the inspection APIs so that when they are not available, the last errno is set to ENOTSUP. (Note that ENOTSUP must be defined on all POSIX platforms). This allows programs to detect if they are using a version of libguestfs that was compiled without support for inspection, without having to parse error messages.
This commit is contained in:
@@ -542,7 +542,7 @@ guestfs__inspect_get_hostname (guestfs_h *g, const char *root)
|
||||
/* XXX These functions should be in an optgroup. */
|
||||
|
||||
#define NOT_IMPL(r) \
|
||||
error (g, _("inspection API not available since this version of libguestfs was compiled without the hivex library")); \
|
||||
guestfs_error_errno (g, ENOTSUP, _("inspection API not available since this version of libguestfs was compiled without the hivex library")); \
|
||||
return r
|
||||
|
||||
char **
|
||||
|
||||
Reference in New Issue
Block a user