5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-10 01:18:01 +03:00

restore: deal with new backup=0 property string

This commit is contained in:
Wolfgang Bumiller 2016-02-10 14:28:18 +01:00 committed by Dietmar Maurer
parent da8b4189d8
commit d9faf79016

View File

@ -5261,10 +5261,10 @@ sub restore_update_config_line {
} elsif ($line =~ m/^((ide|scsi|virtio|sata)\d+):\s*(\S+)\s*$/) { } elsif ($line =~ m/^((ide|scsi|virtio|sata)\d+):\s*(\S+)\s*$/) {
my $virtdev = $1; my $virtdev = $1;
my $value = $3; my $value = $3;
if ($line =~ m/backup=no/) { my $di = parse_drive($virtdev, $value);
if (defined($di->{backup}) && !$di->{backup}) {
print $outfd "#$line"; print $outfd "#$line";
} elsif ($virtdev && $map->{$virtdev}) { } elsif ($virtdev && $map->{$virtdev}) {
my $di = parse_drive($virtdev, $value);
delete $di->{format}; # format can change on restore delete $di->{format}; # format can change on restore
$di->{file} = $map->{$virtdev}; $di->{file} = $map->{$virtdev};
$value = print_drive($vmid, $di); $value = print_drive($vmid, $di);