From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 291B21FF17E for ; Thu, 2 Oct 2025 14:30:06 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 505AAEAF5; Thu, 2 Oct 2025 14:30:13 +0200 (CEST) Message-ID: <170b34a0-88c5-48b0-b912-e31a5c6f13c2@proxmox.com> Date: Thu, 2 Oct 2025 14:30:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion References: <20250822141803.1658181-1-alexandre.derumier@groupe-cyllene.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1759408186919 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.021 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH v3 qemu-server 02/10] add print_drivedevice_controller && print_drivedevice_iothread X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 22.08.25 um 4:19 PM schrieb Alexandre Derumier via pve-devel: > - if ($drive->{interface} eq 'scsi') { > - > - my ($maxdev, $controller, $controller_prefix) = scsihw_infos($conf, $drive); > - > - die > - "scsi$drive->{index}: machine version 4.1~pve2 or higher is required to use more than 14 SCSI disks\n" > - if $drive->{index} > 13 && !&$version_guard(4, 1, 2); This check is dropped without mentioning anything in the commit message. Note that machine versions < 4.1 can still be used right now in Proxmox VE 9, even if the are expected to be dropped during the current major release cycle. Looking at the history, i.e. commit b8fb1c03 ("version_guard scsi drive count"), this was only done as a protection for live-migration to get a clean error up front, when the target node was not updated with the increased limit. So this can be dropped nowadays as all nodes are sure to support the increased limit, but should be done in a separate commit up-front. ---snip 8<--- > +sub print_drivedevice_controller { > + my ($conf, $drive, $scsihw, $arch, $bridges, $used_controller) = @_; > + > + if ($drive->{interface} eq 'scsi') { > + > + my ($maxdev, $controller, $controller_prefix) = scsihw_infos($conf, $drive); > + return if $used_controller->{scsi}->{$controller}; > + > + my $pciaddr = print_pci_addr("$controller_prefix$controller", $bridges, $arch); > + my $scsihw_type = $scsihw =~ m/^virtio-scsi-single/ ? "virtio-scsi-pci" : $scsihw; > + > + my $iothread = ''; > + if ( > + $conf->{scsihw} > + && $conf->{scsihw} eq "virtio-scsi-single" > + && $drive->{iothread} Instead of re-doing the check with the very same condition as below in print_drivedevice_iothread(), can we pass along the name of the iothread (or undef) from the callers and use that? Or do we not have the name of the iothread readily available for all callers? In that case, it could still be a short helper, which returns the iothread name or undef if no iothread is used, to avoid the duplication. > + ) { > + $iothread .= ",iothread=iothread-$controller_prefix$controller"; > + } > + > + my $queues = ''; > + if ( > + $conf->{scsihw} > + && $conf->{scsihw} eq "virtio-scsi-single" > + && $drive->{queues} > + ) { > + $queues = ",num_queues=$drive->{queues}"; > + } > + > + $used_controller->{scsi}->{$controller} = 1; > + return "$scsihw_type,id=$controller_prefix$controller$pciaddr$iothread$queues"; > + } > + > + if ($drive->{interface} eq 'sata') { > + my $controller = int($drive->{index} / $PVE::QemuServer::Drive::MAX_SATA_DISKS); > + return if $used_controller->{ahci}->{$controller}; > + > + my $pciaddr = print_pci_addr("ahci$controller", $bridges, $arch); > + > + $used_controller->{ahci}->{$controller} = 1; > + return "ahci,id=ahci$controller,multifunction=on$pciaddr"; > + > + } > +} > + > +sub print_drivedevice_iothread { > + my ($conf, $drive) = @_; This can now also take just $scsihw instead of the full config (see my reply to 01/10). > + > + my $drive_id = PVE::QemuServer::Drive::get_drive_id($drive); > + > + if ($drive->{interface} eq 'virtio') { > + return "iothread,id=iothread-$drive_id" if $drive->{iothread}; > + } > + > + if ($drive->{interface} eq 'scsi') { > + > + my ($maxdev, $controller, $controller_prefix) = scsihw_infos($conf, $drive); > + > + if ( > + $conf->{scsihw} > + && $conf->{scsihw} eq "virtio-scsi-single" > + && $drive->{iothread} > + ) { > + return "iothread,id=iothread-$controller_prefix$controller"; > + } elsif ($drive->{iothread}) { > + log_warn( > + "iothread is only valid with virtio disk or virtio-scsi-single controller, ignoring\n" > + ); > + } > + } > +} > + > 1; > -- > 2.47.2 > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel