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 024AC6460C for ; Thu, 3 Mar 2022 13:31:57 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F06B331E3A for ; Thu, 3 Mar 2022 13:31:26 +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 id 0BBB031E15 for ; Thu, 3 Mar 2022 13:31:26 +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 D962746E94 for ; Thu, 3 Mar 2022 13:31:25 +0100 (CET) From: Fabian Ebner To: pve-devel@lists.proxmox.com Date: Thu, 3 Mar 2022 13:31:20 +0100 Message-Id: <20220303123121.109758-3-f.ebner@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220303123121.109758-1-f.ebner@proxmox.com> References: <20220303123121.109758-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.128 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 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. [config.pm] Subject: [pve-devel] [PATCH container 2/2] config: print volume: support printing unused volume 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, 03 Mar 2022 12:31:57 -0000 In particular, fixes migration with an unused disk, where calling update_volume_ids() failed previously. Signed-off-by: Fabian Ebner --- src/PVE/LXC/Config.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index 0ed7bd2..d5b49d3 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -1207,6 +1207,13 @@ sub print_ct_mountpoint { return PVE::JSONSchema::print_property_string($info, $mp_desc, $skip); } +sub print_ct_unused { + my ($class, $info) = @_; + + my $skip = [ 'type' ]; + return PVE::JSONSchema::print_property_string($info, $unused_desc, $skip); +} + sub parse_volume { my ($class, $key, $volume_string, $noerr) = @_; @@ -1228,6 +1235,8 @@ sub parse_volume { sub print_volume { my ($class, $key, $volume) = @_; + return $class->print_ct_unused($volume) if $key =~ m/^unused(\d+)$/; + return $class->print_ct_mountpoint($volume, $key eq 'rootfs'); } -- 2.30.2