diff options
Diffstat (limited to 'cmd/ztest/ztest.c')
-rw-r--r-- | cmd/ztest/ztest.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 14e8a5e27..03c62fc6f 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -128,7 +128,7 @@ #include <sys/fs/zfs.h> #include <zfs_fletcher.h> #include <libnvpair.h> -#include <libzfs.h> +#include <libzutil.h> #include <sys/crypto/icp.h> #ifdef __GLIBC__ #include <execinfo.h> /* for backtrace() */ @@ -7065,7 +7065,6 @@ make_random_props(void) static void ztest_import(ztest_shared_t *zs) { - libzfs_handle_t *hdl; importargs_t args = { 0 }; spa_t *spa; nvlist_t *cfg = NULL; @@ -7080,14 +7079,14 @@ ztest_import(ztest_shared_t *zs) VERIFY0(pthread_rwlock_init(&ztest_name_lock, NULL)); kernel_init(FREAD | FWRITE); - hdl = libzfs_init(); searchdirs[0] = ztest_opts.zo_dir; args.paths = nsearch; args.path = searchdirs; args.can_be_active = B_FALSE; - error = zpool_tryimport(hdl, name, &cfg, &args); + error = zpool_find_config(NULL, name, &cfg, &args, + &libzpool_config_ops); if (error) (void) fatal(0, "No pools found\n"); @@ -7097,7 +7096,6 @@ ztest_import(ztest_shared_t *zs) 1ULL << spa->spa_root_vdev->vdev_child[0]->vdev_ms_shift; spa_close(spa, FTAG); - libzfs_fini(hdl); kernel_fini(); if (!ztest_opts.zo_mmp_test) { |