]> git.proxmox.com Git - qemu-server.git/commitdiff
disk: serial no must now be passed to device not drive
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 5 Apr 2018 08:54:41 +0000 (10:54 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 9 Apr 2018 09:03:02 +0000 (11:03 +0200)
With QEMU 2.10 the serial parameter of the -drive command line option
was deprecated [1], so move the logic which adds this parameter now
to the -drive analogue -device CLI option.

Features marked deprecated will continue to work for two releases[2],
so we need to switch over before 2.12, AFAICT.

[1]: https://wiki.qemu.org/ChangeLog/2.10#Deprecated_options
[2]: https://qemu.weilnetz.de/doc/qemu-doc.html#Deprecated-features

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer.pm

index fe85f395b7e68e96e900eeca4e523143cf795e6d..315073fce15e865883b5b47d0c48f82fa6167179 100644 (file)
@@ -1689,6 +1689,12 @@ sub print_drivedevice_full {
 
     $device .= ",bootindex=$drive->{bootindex}" if $drive->{bootindex};
 
+    if (my $serial = $drive->{serial}) {
+       $serial = URI::Escape::uri_unescape($serial);
+       $device .= ",serial=$serial";
+    }
+
+
     return $device;
 }
 
@@ -1761,11 +1767,6 @@ sub print_drive_full {
        }
     }
 
-    if (my $serial = $drive->{serial}) {
-       $serial = URI::Escape::uri_unescape($serial);
-       $opts .= ",serial=$serial";
-    }
-
     $opts .= ",format=$format" if $format && !$drive->{format};
 
     my $cache_direct = 0;