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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 8B020918FC for ; Tue, 30 Jan 2024 15:35:05 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7529930425 for ; Tue, 30 Jan 2024 15:35:05 +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 ; Tue, 30 Jan 2024 15:35:04 +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 3074A44C41 for ; Tue, 30 Jan 2024 15:35:04 +0100 (CET) Message-ID: Date: Tue, 30 Jan 2024 15:34:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Proxmox VE development discussion , =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= References: <20240125123312.363853-1-f.gruenbichler@proxmox.com> From: Fiona Ebner In-Reply-To: <20240125123312.363853-1-f.gruenbichler@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.073 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 - Subject: Re: [pve-devel] [PATCH qemu-server] fix #4085: properly activate cicustom storage(s) 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: Tue, 30 Jan 2024 14:35:05 -0000 Am 25.01.24 um 13:33 schrieb Fabian Grünbichler: > PVE::Storage::path() neither activates the storage of the passed-in volume, nor > does it ensure that the returned value is actually a file or block device, so > this actually fixes two issues. PVE::Storage::abs_filesystem_path() actually > takes care of both, while still calling path() under the hood (since $volid > here is always a proper volid, unless we change the cicustom schema at some > point in the future). > > Signed-off-by: Fabian Grünbichler Reviewed-by: Fiona Ebner > --- > Tested by forcefully de-activating a storage only used for cicustom volumes > right before starting the VM in question > > PVE/QemuServer/Cloudinit.pm | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm > index 7449993a..9a500f8a 100644 > --- a/PVE/QemuServer/Cloudinit.pm > +++ b/PVE/QemuServer/Cloudinit.pm > @@ -550,8 +550,11 @@ sub get_custom_cloudinit_files { > sub read_cloudinit_snippets_file { > my ($storage_conf, $volid) = @_; > > - my ($full_path, undef, $type) = PVE::Storage::path($storage_conf, $volid); > - die "$volid is not in the snippets directory\n" if $type ne 'snippets'; > + my ($vtype, undef, undef, undef, undef, undef, undef) = PVE::Storage::parse_volname($storage_conf, $volid); Style nit: line too long. Could be just my ($vtype) = ... > + > + die "$volid is not in the snippets directory\n" if $vtype ne 'snippets'; > + > + my $full_path = PVE::Storage::abs_filesystem_path($storage_conf, $volid, 1); > return PVE::Tools::file_get_contents($full_path, 1 * 1024 * 1024); > } >