[pve-devel] [PATCH qemu-server 1/2] restore: deal with new backup=0 property string

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Feb 10 14:28:18 CET 2016


---
 PVE/QemuServer.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 047c5a4..eab1381 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5234,10 +5234,10 @@ sub restore_update_config_line {
     } elsif ($line =~ m/^((ide|scsi|virtio|sata)\d+):\s*(\S+)\s*$/) {
 	my $virtdev = $1;
 	my $value = $3;
-	if ($line =~ m/backup=no/) {
+	my $di = parse_drive($virtdev, $value);
+	if (defined($di->{backup}) && !$di->{backup}) {
 	    print $outfd "#$line";
 	} elsif ($virtdev && $map->{$virtdev}) {
-	    my $di = parse_drive($virtdev, $value);
 	    delete $di->{format}; # format can change on restore
 	    $di->{file} = $map->{$virtdev};
 	    $value = print_drive($vmid, $di);
-- 
2.1.4





More information about the pve-devel mailing list