From 951202b308fad58cba28aa016e995bbd9d8e3bac Mon Sep 17 00:00:00 2001 From: Faruk Kasumovic Date: Tue, 25 Sep 2018 14:27:13 +0200 Subject: [PATCH] Force pool imports and call improved pool search handler --- zpool.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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