[pve-devel] [PATCH qemu-server 2/2] remove a superfluous condition

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


This is only reached if the $line from which $virtdev
originates matches, and the part in $virtdev can never be
false then.
---
 PVE/QemuServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index eab1381..708ec27 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -5237,7 +5237,7 @@ sub restore_update_config_line {
 	my $di = parse_drive($virtdev, $value);
 	if (defined($di->{backup}) && !$di->{backup}) {
 	    print $outfd "#$line";
-	} elsif ($virtdev && $map->{$virtdev}) {
+	} elsif ($map->{$virtdev}) {
 	    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