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 E870E1FF398 for ; Wed, 19 Jun 2024 10:14:24 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3C3A8373FB; Wed, 19 Jun 2024 10:14:27 +0200 (CEST) Message-ID: Date: Wed, 19 Jun 2024 10:14:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion , Dominik Csapak References: <20240619063724.200453-1-d.csapak@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20240619063724.200453-1-d.csapak@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.058 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 T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, pci.pm, qemuserver.pm] Subject: Re: [pve-devel] [PATCH qemu-server] fix #5543: pci: don't use pci devices when starting templates 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" I'd be in favor of fixing this together with https://bugzilla.proxmox.com/show_bug.cgi?id=3352 and use a minimal QEMU commandline that only attaches the block devices and nothing else. I guess the addition for the PCI cleanup is still needed, but getting the minimal commandline is probably best done as a new helper. What do you think? Am 19.06.24 um 08:37 schrieb Dominik Csapak: > templates can only be started in context of a pbs backup, and there > we don't need or want to use the configured pci devices, since > they cannot be started normally anyway. > > Without this, users can get into a situation where the template > cannot be backed up when the pci device is not available, even > if it's actually not needed. > > Signed-off-by: Dominik Csapak > --- > PVE/QemuServer.pm | 3 +++ > PVE/QemuServer/PCI.pm | 6 +++++- > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm > index 7815b608..c1cc27f3 100644 > --- a/PVE/QemuServer.pm > +++ b/PVE/QemuServer.pm > @@ -6137,6 +6137,9 @@ sub get_vm_volumes { > sub cleanup_pci_devices { > my ($vmid, $conf) = @_; > > + # templates don't use pci devices > + return if $conf->{template}; > + > foreach my $key (keys %$conf) { > next if $key !~ m/^hostpci(\d+)$/; > my $hostpciindex = $1; > diff --git a/PVE/QemuServer/PCI.pm b/PVE/QemuServer/PCI.pm > index 1673041b..4aa4a52c 100644 > --- a/PVE/QemuServer/PCI.pm > +++ b/PVE/QemuServer/PCI.pm > @@ -576,9 +576,13 @@ sub print_hostpci_devices { > my $kvm_off = 0; > my $gpu_passthrough = 0; > my $legacy_igd = 0; > + my $pci_devices = {}; > + > + # templates can only start for backup where we don't want pci devices, so return early > + return ($kvm_off, $gpu_passthrough, $legacy_igd, $pci_devices) if $conf->{template}; > > my $pciaddr; > - my $pci_devices = choose_hostpci_devices(parse_hostpci_devices($conf), $vmid); > + $pci_devices = choose_hostpci_devices(parse_hostpci_devices($conf), $vmid); > > for (my $i = 0; $i < $MAX_HOSTPCI_DEVICES; $i++) { > my $id = "hostpci$i"; _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel