Fix lockdir not taking the value of backupdir

Thanks Claudio Kuenzler
master
Daniel Berteaud 4 years ago
parent 51acbb30a0
commit 22447576c9
  1. 4
      virt-backup

@ -48,7 +48,7 @@ $opts{backupdir} = '/var/lib/libvirt/backup';
$opts{dumpcmd} = undef; $opts{dumpcmd} = undef;
# Lockdir is where locks will be held when backing up a VM. The default is to put the lock # Lockdir is where locks will be held when backing up a VM. The default is to put the lock
# in the backup dir of the VM, but in some situations, you want to put it elsewhere # in the backup dir of the VM, but in some situations, you want to put it elsewhere
$opts{lockdir} = $opts{backupdir}; $opts{lockdir} = undef;
# Size of LVM snapshots (which will be used to backup VM with minimum downtime # Size of LVM snapshots (which will be used to backup VM with minimum downtime
# if the VM is backed by LVM). If the LVM volume is thinly provisionned (thinp) # if the VM is backed by LVM). If the LVM volume is thinly provisionned (thinp)
# this parameter will be ignored # this parameter will be ignored
@ -213,6 +213,8 @@ if (! -d $opts{backupdir} ){
exit 1; exit 1;
} }
# If lockdir is not defined, take the same value as backupdir
$opts{lockdir} ||= $opts{backupdir};
# Lockdir, if defined, must also exist # Lockdir, if defined, must also exist
if (!-d $opts{lockdir}){ if (!-d $opts{lockdir}){
print "$opts{lockdir} doesn't exist\n"; print "$opts{lockdir} doesn't exist\n";

Loading…
Cancel
Save