Simplify create_snapshot function

tags/virt-backup-0.2.12-1
Daniel Berteaud 11 years ago
parent 89a82b0b9a
commit 5e05ebeb72
  1. 8
      virt-backup

@ -750,10 +750,10 @@ sub save_xml{
sub create_snapshot{
my ($blk,$suffix) = @_;
my $ret = 0;
print "Running: $opts{lvcreate} -s -n " . $blk . $suffix .
" -L $opts{snapsize} $blk > /dev/null 2>&1 < /dev/null\n" if $opts{debug};
if ( system("$opts{lvcreate} -s -n " . $blk . $suffix .
" -L $opts{snapsize} $blk > /dev/null 2>&1 < /dev/null") == 0 ) {
my $cmd = "$opts{lvcreate} -s -n " . $blk . $suffix .
" -L $opts{snapsize} $blk > /dev/null 2>&1 < /dev/null\n";
print "Running: $cmd" if $opts{debug};
if ( system("$cmd") == 0 ) {
$ret = 1;
open SNAPLIST, ">>$backupdir.meta/snapshots" or die "Error, couldn't open snapshot list file\n";
print SNAPLIST $blk.$suffix ."\n";

Loading…
Cancel
Save