]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #1662: use special case for 'snapshot' disk parameter
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 8 Feb 2018 11:09:23 +0000 (12:09 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 8 Feb 2018 12:28:55 +0000 (13:28 +0100)
since qemu expects on|off (not 1|0),
we have to do it different

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/QemuServer.pm

index 669288844bfd16ddb190d4328aa3f2ce3fa23dbc..acd4047a62830099377e0bea0af1475bef27eb97 100644 (file)
@@ -1622,10 +1622,17 @@ sub print_drive_full {
    }
 
     my $opts = '';
-    my @qemu_drive_options = qw(heads secs cyls trans media format cache snapshot rerror werror aio discard);
+    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};
     }
+
+    # snapshot only accepts on|off
+    if (defined($drive->{snapshot})) {
+       my $v = $drive->{snapshot} ? 'on' : 'off';
+       $opts .= ",snapshot=$v";
+    }
+
     foreach my $type (['', '-total'], [_rd => '-read'], [_wr => '-write']) {
        my ($dir, $qmpname) = @$type;
        if (my $v = $drive->{"mbps$dir"}) {