From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 05E5C1FF15C for ; Fri, 13 Jun 2025 13:14:48 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6867FEC26; Fri, 13 Jun 2025 13:15:12 +0200 (CEST) Date: Fri, 13 Jun 2025 13:14:34 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20250612140253.106555-1-f.ebner@proxmox.com> <20250612140253.106555-19-f.ebner@proxmox.com> In-Reply-To: <20250612140253.106555-19-f.ebner@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1749810513.o2rzpo700q.astroid@yuna.none> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.045 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemuserver.pm, proxmox.com] Subject: Re: [pve-devel] [PATCH qemu-server 18/22] print drive device: don't reference any drive for 'none' starting with machine version 10.0 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" On June 12, 2025 4:02 pm, Fiona Ebner wrote: > There will be no block node for 'none' after switching to '-blockdev'. > > Co-developed-by: Alexandre Derumier > [FE: split out from larger patch > do it also for non-SCSI cases] > Signed-off-by: Fiona Ebner > --- > PVE/QemuServer.pm | 22 +++++++++++++++++++--- > 1 file changed, 19 insertions(+), 3 deletions(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index 90d07cee..e5f8a607 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -1322,7 +1322,13 @@ sub print_drivedevice_full { > my $drive_id = PVE::QemuServer::Drive::get_drive_id($drive); > if ($drive->{interface} eq 'virtio') { > my $pciaddr = print_pci_addr("$drive_id", $bridges, $arch, $machine_type); > - $device = "virtio-blk-pci,drive=drive-$drive_id,id=${drive_id}${pciaddr}"; > + $device = 'virtio-blk-pci'; > + if (min_version($machine_version, 10, 0)) { # there is no blockdev for 'none' > + $device .= ",drive=drive-$drive_id" if $drive->{file} ne 'none'; > + $device .= ",id=${drive_id}${pciaddr}"; > + } else { > + $device .= ",drive=drive-$drive_id,id=${drive_id}${pciaddr}"; the ID is the same in both branches, so this could be (some variant of) # blockdev has no drive for 'none' if (!(min_version($machine_version, 10, 0) && $drive->{file} eq 'none')) { $device .= "$drive=drive-$drive_id"; } $device .= ",id=${drive_id}${pciaddr}"; > + } > $device .= ",iothread=iothread-$drive_id" if $drive->{iothread}; > } elsif ($drive->{interface} eq 'scsi') { > > @@ -1338,7 +1344,12 @@ sub print_drivedevice_full { > $device = "scsi-$device_type,bus=$controller_prefix$controller.0,channel=0,scsi-id=0" > .",lun=$drive->{index}"; > } > - $device .= ",drive=drive-$drive_id,id=$drive_id"; > + if (min_version($machine_version, 10, 0)) { # there is no blockdev for 'none' > + $device .= ",drive=drive-$drive_id" if $drive->{file} ne 'none'; > + $device .= ",id=$drive_id"; > + } else { > + $device .= ",drive=drive-$drive_id,id=$drive_id"; > + } same here > > if ($drive->{ssd} && ($device_type eq 'block' || $device_type eq 'hd')) { > $device .= ",rotation_rate=1"; > @@ -1378,7 +1389,12 @@ sub print_drivedevice_full { > } else { > $device .= ",bus=ahci$controller.$unit"; > } > - $device .= ",drive=drive-$drive_id,id=$drive_id"; > + if (min_version($machine_version, 10, 0)) { # there is no blockdev for 'none' > + $device .= ",drive=drive-$drive_id" if $drive->{file} ne 'none'; > + $device .= ",id=$drive_id"; > + } else { > + $device .= ",drive=drive-$drive_id,id=$drive_id"; > + } same here or it could even be a small helper that adds drive+id as applicable? > > if ($device_type eq 'hd') { > if (my $model = $drive->{model}) { > -- > 2.39.5 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel