[pve-devel] [PATCH qemu-server 3/3] append option to drive if the option is defined

Dominik Csapak d.csapak at proxmox.com
Thu Feb 8 12:09:24 CET 2018


if the value was '0', we did not append the option to the drive,
resulting in wrong command line if the qemu default of an option is not
'0'

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/QemuServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 0011018..39a8916 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -1624,7 +1624,7 @@ sub print_drive_full {
     my $opts = '';
     my @qemu_drive_options = qw(heads secs cyls trans media format cache rerror werror aio discard);
     foreach my $o (@qemu_drive_options) {
-	$opts .= ",$o=$drive->{$o}" if $drive->{$o};
+	$opts .= ",$o=$drive->{$o}" if defined($drive->{$o});
     }
 
     # snapshot only accepts on|off
-- 
2.11.0





More information about the pve-devel mailing list