From 897b81a1af7ad812b21168e3b79c6c2799535279 Mon Sep 17 00:00:00 2001 From: Faruk Kasumovic Date: Mon, 6 Aug 2018 14:54:13 +0200 Subject: [PATCH] Skip destroyed pools in zpool import --- zpool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zpool.go b/zpool.go index 153cc97..d08dcde 100644 --- a/zpool.go +++ b/zpool.go @@ -376,6 +376,9 @@ func poolSearchImport(q string, searchpaths []string, guid bool) (name string, err = errPoolList return } + if PoolState(C.get_zpool_state(tconfig)) == PoolStateDestroyed { + continue // skip destroyed pools + } if guid { sguid := fmt.Sprint(C.get_zpool_guid(tconfig)) if q == sguid {