Force pool imports and call improved pool search handler
This commit is contained in:
parent
ca2b45d22f
commit
951202b308
6
zpool.go
6
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
|
||||
|
|
Loading…
Reference in New Issue