[pve-devel] [PATCH storage 1/2] avoid output of zfs get command on volume import

Fabian Ebner f.ebner at proxmox.com
Thu Oct 1 10:11:35 CEST 2020


quiet takes care of both the error and success case.
Without this, there are lines like:
myzpool/vm-4352-disk-0 at __replicate_4352-7_1601538554__	name	myzpool/vm-4352-disk-0 at __replicate_4352-7_1601538554__	-
in the log if the dataset exists, and this information is
already present in more readable form.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/Storage/ZFSPoolPlugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 6ac05b4..07540b3 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -731,7 +731,7 @@ sub volume_import {
     my $zfspath = "$scfg->{pool}/$dataset";
     my $suffix = defined($base_snapshot) ? "\@$base_snapshot" : '';
     my $exists = 0 == run_command(['zfs', 'get', '-H', 'name', $zfspath.$suffix],
-			     noerr => 1, errfunc => sub {});
+				  noerr => 1, quiet => 1);
     if (defined($base_snapshot)) {
 	die "base snapshot '$zfspath\@$base_snapshot' doesn't exist\n" if !$exists;
     } elsif ($exists) {
-- 
2.20.1






More information about the pve-devel mailing list