From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id EB2781FF0AE for ; Tue, 15 Sep 2026 16:32:48 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2B265215DB; Tue, 15 Sep 2026 16:32:44 +0200 (CEST) From: Nicolas Frey To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server 1/3] drive: add helper to detect VirtIO driver ISOs with known issues Date: Tue, 15 Sep 2026 16:32:35 +0200 Message-ID: <20260915143237.1033142-2-n.frey@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260915143237.1033142-1-n.frey@proxmox.com> References: <20260915143237.1033142-1-n.frey@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -0.957 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Message-ID-Hash: 2SDWIBTU4MOS2HNB335QX5C3VE5ERQR7 X-Message-ID-Hash: 2SDWIBTU4MOS2HNB335QX5C3VE5ERQR7 X-MailFrom: nfrey@miso.proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: the wiki lists version ranges of the VirtIO driver ISO for Windows that are known to cause issues. these helpers should be the single source of truth in code for checking these known issues. Signed-off-by: Nicolas Frey --- src/PVE/QemuServer/Drive.pm | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/src/PVE/QemuServer/Drive.pm b/src/PVE/QemuServer/Drive.pm index 17c46f36..9839bb48 100644 --- a/src/PVE/QemuServer/Drive.pm +++ b/src/PVE/QemuServer/Drive.pm @@ -13,6 +13,7 @@ use PVE::Storage; use PVE::Storage::Common; use PVE::JSONSchema qw(get_standard_option); +use PVE::QemuServer::Helpers; use PVE::QemuServer::Monitor qw(qsd_qmp_peer vm_qmp_peer); use base qw(Exporter); @@ -766,6 +767,66 @@ sub drive_is_cdrom { return $drive && $drive->{media} && ($drive->{media} eq 'cdrom'); } +# version ranges of the VirtIO driver ISO for Windows that are known to cause issues, see +# https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers#Known_Issues +my $virtio_win_issues = [ + { from => [0, 1, 215], to => [0, 1, 262] }, { from => [0, 1, 285], to => [0, 1, 285] }, +]; + +# returns the version of the VirtIO driver ISO referenced by $volid if it is known to cause +# issues, undef otherwise +sub virtio_win_iso_issue { + my ($volid) = @_; + + my @version = ($volid // '') =~ m/virtio-win[_-](\d+)\.(\d+)\.(\d+)/i; + return if !@version; + + my $cmp_with = sub { + my ($other) = @_; + + return PVE::QemuServer::Helpers::version_cmp(map { ($version[$_], $other->[$_]) } + 0 .. 2); + }; + + for my $issue ($virtio_win_issues->@*) { + return join('.', @version) + if $cmp_with->($issue->{from}) >= 0 && $cmp_with->($issue->{to}) <= 0; + } + + return; +} + +# warn if the CD-ROM drive $opt contains a VirtIO driver ISO that is known to cause issues +sub warn_about_virtio_win_issues { + my ($opt, $volid) = @_; + + my $version = virtio_win_iso_issue($volid); + return if !defined($version); + + log_warn("$opt: version $version of the VirtIO drivers for Windows is known to cause issues," + . " see https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers#Known_Issues"); + + return; +} + +# warn about every CD-ROM drive in $conf that contains a problematic VirtIO driver ISO +sub warn_about_virtio_win_issues_in_config { + my ($conf) = @_; + + return if !PVE::QemuServer::Helpers::windows_version($conf->{ostype}); + + for my $opt (valid_drive_names()) { + next if !defined($conf->{$opt}); + + my $drive = eval { parse_drive($opt, $conf->{$opt}) }; + next if !$drive || !drive_is_cdrom($drive, 1); + + warn_about_virtio_win_issues($opt, $drive->{file}); + } + + return; +} + sub parse_drive_interface { my ($key) = @_; -- 2.47.3