From 5bbea954d7770307bd5105cb49974cdd0a25e60d Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 29 Nov 2011 06:52:32 +0100 Subject: [PATCH] supress error messages when removing snapshot --- PVE/VZDump/OpenVZ.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PVE/VZDump/OpenVZ.pm b/PVE/VZDump/OpenVZ.pm index 549e3382..40c4325e 100644 --- a/PVE/VZDump/OpenVZ.pm +++ b/PVE/VZDump/OpenVZ.pm @@ -281,15 +281,19 @@ sub cleanup { if ($task->{cleanup}->{lvm_snapshot}) { # loop, because we often get 'LV in use: not deactivating' + # we use run_command() because we do not want to log errors here my $wait = 1; while(-b $di->{snapdev}) { - eval { $self->cmd("lvremove -f $di->{snapdev}"); }; + eval { + my $cmd = ['lvremove', '-f', $di->{snapdev}]; + PVE::Tools::run_command($cmd, outfunc => sub {}, errfunc => {}); + }; last if !$@; if ($wait >= 64) { $self->logerr($@); last; } - $self->loginfo("lvremove failed - trying again in $wait seconds"); + $self->loginfo("lvremove failed - trying again in $wait seconds") if $wait >= 8; sleep($wait); $wait = $wait*2; }