summaryrefslogtreecommitdiffstats
path: root/cmd/zhack
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/zhack')
-rw-r--r--cmd/zhack/Makefile.am1
-rw-r--r--cmd/zhack/zhack.c13
2 files changed, 4 insertions, 10 deletions
diff --git a/cmd/zhack/Makefile.am b/cmd/zhack/Makefile.am
index f720e8286..6e3e706ec 100644
--- a/cmd/zhack/Makefile.am
+++ b/cmd/zhack/Makefile.am
@@ -11,5 +11,4 @@ zhack_SOURCES = \
zhack_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
- $(top_builddir)/lib/libzfs/libzfs.la \
$(top_builddir)/lib/libzpool/libzpool.la
diff --git a/cmd/zhack/zhack.c b/cmd/zhack/zhack.c
index 296a7fe75..57e497f62 100644
--- a/cmd/zhack/zhack.c
+++ b/cmd/zhack/zhack.c
@@ -48,12 +48,11 @@
#include <sys/zio_compress.h>
#include <sys/zfeature.h>
#include <sys/dmu_tx.h>
-#include <libzfs.h>
+#include <libzutil.h>
extern boolean_t zfeature_checks_disable;
const char cmdname[] = "zhack";
-libzfs_handle_t *g_zfs;
static importargs_t g_importargs;
static char *g_pool;
static boolean_t g_readonly;
@@ -128,20 +127,17 @@ zhack_import(char *target, boolean_t readonly)
int error;
kernel_init(readonly ? FREAD : (FREAD | FWRITE));
- g_zfs = libzfs_init();
- ASSERT(g_zfs != NULL);
dmu_objset_register_type(DMU_OST_ZFS, space_delta_cb);
g_readonly = readonly;
- g_importargs.unique = B_TRUE;
g_importargs.can_be_active = readonly;
g_pool = strdup(target);
- error = zpool_tryimport(g_zfs, target, &config, &g_importargs);
+ error = zpool_find_config(NULL, target, &config, &g_importargs,
+ &libzpool_config_ops);
if (error)
- fatal(NULL, FTAG, "cannot import '%s': %s", target,
- libzfs_error_description(g_zfs));
+ fatal(NULL, FTAG, "cannot import '%s'", target);
props = NULL;
if (readonly) {
@@ -529,7 +525,6 @@ main(int argc, char **argv)
"changes may not be committed to disk\n");
}
- libzfs_fini(g_zfs);
kernel_fini();
return (rv);