]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: zfs: Use 'zfs list' to check pool status
authorMatt Low <matt@mlow.ca>
Mon, 3 Jul 2023 22:53:28 +0000 (16:53 -0600)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 20 Jul 2023 08:44:14 +0000 (10:44 +0200)
commit3cde509f1ad1387b02c93aff17b76e4d569487a5
treee73cb0131e73f5c1d93bf165bb9186952e9ff5d1
parentfa0d5f4ebc0aa178d9dea278914f9149a4c4af54
storage: zfs: Use 'zfs list' to check pool status

The current virtStorageBackendZFSCheckPool checks for the existence of a
path under /dev/zvol/ to determine if the pool is active. ZFS does not
create a path under /dev/zvol/ if no ZFS volumes have been created under
a particular dataset, thus, empty ZFS storage pools are deactivated
whenever checkPool is called on them (as noted in referenced issue).

This commit changes virStorageBackendZFSCheckPool so that the 'zfs list'
command is used to explicitly check for the existence a dataset
specified by the pool's def->source.name.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/221

Signed-off-by: Matt Low <matt@mlow.ca>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/storage/storage_backend_zfs.c