diff --git a/zpool.go b/zpool.go index d08dcde..c530c50 100644 --- a/zpool.go +++ b/zpool.go @@ -364,7 +364,7 @@ func poolSearchImport(q string, searchpaths []string, guid bool) (name string, C.strings_setat(cpaths, C.int(i), csPath) } - pools := C.zpool_find_import(C.libzfsHandle, C.int(numofp), cpaths) + pools := C.go_zpool_search_import(C.libzfsHandle, C.int(numofp), cpaths, C.B_FALSE) defer C.nvlist_free(pools) elem = C.nvlist_next_nvpair(pools, elem) @@ -411,8 +411,8 @@ func poolSearchImport(q string, searchpaths []string, guid bool) (name string, name = C.GoString(cname) } if retcode := C.zpool_import_props(C.libzfsHandle, config, cname, - nil, C.ZFS_IMPORT_NORMAL); retcode != 0 { - err = LastError() + nil, C.ZFS_IMPORT_NORMAL|C.ZFS_IMPORT_ANY_HOST); retcode != 0 { + err = fmt.Errorf("Import pool properties failed: %s", LastError().Error()) return } return