From a70e7e6caff5d274d285475b302cb1bff6d0226d Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 5 Apr 2018 10:54:41 +0200 Subject: [PATCH] disk: serial no must now be passed to device not drive 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 --- PVE/QemuServer.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index fe85f39..315073f 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -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; -- 2.39.2