From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id D49D890680 for ; Thu, 16 Mar 2023 09:18:12 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B2A65E70 for ; Thu, 16 Mar 2023 09:18:12 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 16 Mar 2023 09:18:11 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5593942AFB for ; Thu, 16 Mar 2023 09:18:11 +0100 (CET) Date: Thu, 16 Mar 2023 09:18:10 +0100 From: Wolfgang Bumiller To: Dominik Csapak Cc: pve-devel@lists.proxmox.com Message-ID: <20230316081810.mc7lozw2jcssydc6@casey.proxmox.com> References: <20230227153427.1115209-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230227153427.1115209-1-d.csapak@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.182 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% 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: [pve-devel] applied: [PATCH qemu-server] fix #4553: nvidia vgpu: reuse smbios uuid for '-uuid' parameter 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: , X-List-Received-Date: Thu, 16 Mar 2023 08:18:12 -0000 applied, thanks On Mon, Feb 27, 2023 at 04:34:27PM +0100, Dominik Csapak wrote: > instead of using the mdev uuid. The nvidia driver does not actually care > that it's the same as the mdev, and in qemu the uuid parameter > overwrites the smbios1 uuid internally, so we should have been reusing > that in the first place. > > Signed-off-by: Dominik Csapak > --- > when i was writing the uuid appending in the first place, i was sure > that the nvidia driver needed the mdev uuid, but i was wrong > > also i wrongly assumed the '-uuid' parameter does not do anything to the > guest, but it overwrites the smbios uuid. seems i misread the qemu source > code then.. (the man/help pages are not very helpful in that regard) > > PVE/QemuServer.pm | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index 096e7f0d..b5836f7a 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -5851,9 +5851,14 @@ sub vm_start_nolock { > for my $dev ($d->{pciid}->@*) { > my $info = PVE::QemuServer::PCI::prepare_pci_device($vmid, $dev->{id}, $id, $d->{mdev}); > > - # nvidia grid needs the uuid of the mdev as qemu parameter > + # nvidia grid needs the qemu parameter '-uuid' set > + # use smbios uuid or mdev uuid as fallback for that > if ($d->{mdev} && !defined($uuid) && $info->{vendor} eq '10de') { > - $uuid = PVE::QemuServer::PCI::generate_mdev_uuid($vmid, $id); > + if (defined($conf->{smbios1})) { > + my $smbios_conf = parse_smbios1($conf->{smbios1}); > + $uuid = $smbios_conf->{uuid} if defined($smbios_conf->{uuid}); > + } > + $uuid = PVE::QemuServer::PCI::generate_mdev_uuid($vmid, $id) if !defined($uuid); > } > } > } > -- > 2.30.2