]> git.proxmox.com Git - qemu-server.git/commitdiff
append option to drive if the option is defined
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 8 Feb 2018 11:09:24 +0000 (12:09 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 8 Feb 2018 12:29:06 +0000 (13:29 +0100)
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@proxmox.com>
PVE/QemuServer.pm

index acd4047a62830099377e0bea0af1475bef27eb97..686c864ca9c1762e414ea57b481de5cdd0735c1d 100644 (file)
@@ -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