From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH v3 qemu-server 02/10] add print_drivedevice_controller && print_drivedevice_iothread
Date: Thu, 2 Oct 2025 14:30:10 +0200 [thread overview]
Message-ID: <170b34a0-88c5-48b0-b912-e31a5c6f13c2@proxmox.com> (raw)
In-Reply-To: <mailman.307.1755872324.385.pve-devel@lists.proxmox.com>
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
next prev parent reply other threads:[~2025-10-02 12:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250822141803.1658181-1-alexandre.derumier@groupe-cyllene.com>
2025-08-22 14:17 ` [pve-devel] [PATCH v3 qemu-server 01/10] introduce DriveDevice module Alexandre Derumier via pve-devel
2025-10-02 12:19 ` [pve-devel] applied: " Fiona Ebner
2025-08-22 14:17 ` [pve-devel] [PATCH v3 qemu-server 02/10] add print_drivedevice_controller && print_drivedevice_iothread Alexandre Derumier via pve-devel
2025-10-02 12:30 ` Fiona Ebner [this message]
2025-08-22 14:17 ` [pve-devel] [PATCH v3 qemu-server 03/10] hotplug: drive controller : use print_drivedevice_iothread && print_drivedevice_controller Alexandre Derumier via pve-devel
2025-08-22 14:17 ` [pve-devel] [PATCH v3 qemu-server 04/10] pci: add get_pci_addr Alexandre Derumier via pve-devel
2025-08-22 14:17 ` [pve-devel] [PATCH v3 qemu-server 05/10] qmphelpers: add qmp_deviceadd && qmp_devicedel Alexandre Derumier via pve-devel
2025-08-22 14:17 ` [pve-devel] [PATCH v3 qemu-server 06/10] convert drive device to json format Alexandre Derumier via pve-devel
2025-10-02 13:20 ` Fiona Ebner
2025-08-22 14:17 ` [pve-devel] [PATCH v3 qemu-server 07/10] convert iothread to json Alexandre Derumier via pve-devel
2025-08-22 14:18 ` [pve-devel] [PATCH v3 qemu-server 08/10] convert disk controller device to json format Alexandre Derumier via pve-devel
2025-08-22 14:18 ` [pve-devel] [PATCH v3 qemu-server 09/10] tests: cfg2cmd: convert drive devices " Alexandre Derumier via pve-devel
2025-08-22 14:18 ` [pve-devel] [PATCH v3 qemu-server 10/10] RFC: add multiple iothreads support Alexandre Derumier via pve-devel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=170b34a0-88c5-48b0-b912-e31a5c6f13c2@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox