Skip destroyed pools in pool import search

This commit is contained in:
Faruk Kasumovic 2018-08-06 10:34:42 +02:00
parent 1830efcb43
commit 4cd8ea7346
1 changed files with 3 additions and 0 deletions

View File

@ -319,6 +319,9 @@ func PoolImportSearch(searchpaths []string) (epools []ExportedPool, err error) {
}
ep.State = PoolState(C.get_zpool_state(config))
if ep.State == PoolStateDestroyed {
continue // skip destroyed pools
}
if cname = C.get_zpool_name(config); cname == nil {
err = fmt.Errorf("Failed to fetch %s", C.ZPOOL_CONFIG_POOL_NAME)