From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pve-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7DF111FF164 for <inbox@lore.proxmox.com>; Fri, 14 Feb 2025 10:50:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9C8B71658F; Fri, 14 Feb 2025 10:50:50 +0100 (CET) Message-ID: <376c4f7e-d266-4706-81f9-738c80583fcb@proxmox.com> Date: Fri, 14 Feb 2025 10:50:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Fiona Ebner <f.ebner@proxmox.com> To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>, Filip Schauer <f.schauer@proxmox.com> References: <20250120112842.36450-1-f.schauer@proxmox.com> <20250120112842.36450-2-f.schauer@proxmox.com> <6daf1a2a-e9ec-4c8d-834a-12d352d7db9a@proxmox.com> Content-Language: en-US In-Reply-To: <6daf1a2a-e9ec-4c8d-834a-12d352d7db9a@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.047 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. [plugin.pm] Subject: Re: [pve-devel] [PATCH storage v6 1/7] plugin: allow volume import of iso, snippets, vztmpl and import X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/> List-Post: <mailto:pve-devel@lists.proxmox.com> List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" <pve-devel-bounces@lists.proxmox.com> Am 13.02.25 um 18:21 schrieb Fiona Ebner: > Am 20.01.25 um 12:28 schrieb Filip Schauer: >> Extend volume import functionality to support 'iso', 'snippets', >> 'vztmpl', and 'import' types, in addition to the existing support for >> 'images' and 'rootdir'. This is a prerequisite for the ability to move >> ISOs, snippets and container templates between nodes. >> >> Existing behavior for importing VM disks and container volumes remains >> unchanged. >> >> Signed-off-by: Filip Schauer <f.schauer@proxmox.com> >> --- >> src/PVE/Storage/Plugin.pm | 72 ++++++++++++++++++++++++++------------- >> 1 file changed, 48 insertions(+), 24 deletions(-) >> >> diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm >> index 65cf43f..b682362 100644 >> --- a/src/PVE/Storage/Plugin.pm >> +++ b/src/PVE/Storage/Plugin.pm >> @@ -1738,6 +1738,8 @@ sub volume_export_formats { >> my $format = ($class->parse_volname($volname))[6]; >> my $size = file_size_info($file, undef, $format); >> >> + return ('raw+size') if !defined($format); > > Can we rather make this explicitly check for vtype being one of the ones > we care about? That reflects more precisely what we want to test for. > I'm also thinking whether we want to explicitly include the vtype in the > new export format name to avoid potential type confusion down the line. > I.e. if a storage wants to export an iso, it should not be importable as > a snippet on the other side. We can keep the current formats for > backwards-compat, but the formats for the newly supported vtypes could > then be $vtype+meta, similar to the backup+size type you add. This would > be more explicit and less likely to be(come) exploitable. And we could > write the vtype into the header of the stream itself for extra safety. > Maybe in a way that allows for some forwards-compatibility, e.g. what if > ISO files get notes too at some point. > > Just a crude outline what the stream could be from the top of my head: > number of meta-properties > for each meta-property: length of property name, property name, length > of property data, property data > length of volume, volume data Or more easily length of JSON with metadata, JSON with metadata length of volume, volume data > > For compatibility/extensibility, the stream consumer can then handle all > meta properties it knows and skip the rest (with some informational > logging about what was skipped). Or we can add a marker to each property > whether it is required or optional and mark all important properties > that should rather lead to failure than skipping. Then outdated nodes > might not be able to receive certain streams, but we have the > flexibility to decide for each property. > > I'm sorry, it would expand the scope of the series a bit more, but I do > think this will save us some headaches and give us more flexibility in > the future. And it seems to be a natural generalization of what you > already do for backup+size. > > @other devs: opinions? > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel