_LIBZUTIL_H pool_config_ops_t libzfs_config_ops;
_LIBZUTIL_H pool_config_ops_t libzpool_config_ops;
+typedef enum lpc_error {
+ LPC_SUCCESS = 0, /* no error -- success */
+ LPC_BADCACHE = 2000, /* out of memory */
+ LPC_BADPATH, /* must be an absolute path */
+ LPC_NOMEM, /* out of memory */
+ LPC_EACCESS, /* some devices require root privileges */
+ LPC_UNKNOWN
+} lpc_error_t;
+
typedef struct importargs {
char **path; /* a list of paths to search */
int paths; /* number of paths to search */
nvlist_t *policy; /* load policy (max txg, rewind, etc.) */
} importargs_t;
-_LIBZUTIL_H nvlist_t *zpool_search_import(void *, importargs_t *,
- pool_config_ops_t *);
-_LIBZUTIL_H int zpool_find_config(void *, const char *, nvlist_t **,
- importargs_t *, pool_config_ops_t *);
+typedef struct libpc_handle {
+ int lpc_error;
+ boolean_t lpc_printerr;
+ boolean_t lpc_open_access_error;
+ boolean_t lpc_desc_active;
+ char lpc_desc[1024];
+ pool_config_ops_t *lpc_ops;
+ void *lpc_lib_handle;
+} libpc_handle_t;
+
+_LIBZUTIL_H const char *libpc_error_description(libpc_handle_t *);
+_LIBZUTIL_H nvlist_t *zpool_search_import(libpc_handle_t *, importargs_t *);
+_LIBZUTIL_H int zpool_find_config(libpc_handle_t *, const char *, nvlist_t **,
+ importargs_t *);
_LIBZUTIL_H const char * const * zpool_default_search_paths(size_t *count);
_LIBZUTIL_H int zpool_read_label(int, nvlist_t **, int *);