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 E60E76A10B for ; Tue, 15 Mar 2022 14:00:04 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DA6B51E7A7 for ; Tue, 15 Mar 2022 14:00:04 +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)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id D31791E79D for ; Tue, 15 Mar 2022 14:00:03 +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 8105546C94 for ; Tue, 15 Mar 2022 14:00:03 +0100 (CET) Message-ID: <760d3e5f-078f-ec7f-b4ef-6459e140a244@proxmox.com> Date: Tue, 15 Mar 2022 14:00:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Content-Language: en-US To: pve-devel@lists.proxmox.com, =?UTF-8?Q?Fabian_Gr=c3=bcnbichler?= References: <20220309100919.31512-1-f.ebner@proxmox.com> <20220309100919.31512-12-f.ebner@proxmox.com> <1647262751.wqasoxacxe.astroid@nora.none> From: Fabian Ebner In-Reply-To: <1647262751.wqasoxacxe.astroid@nora.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.123 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 NICE_REPLY_A -0.001 Looks like a legit reply (A) 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. [qemuserver.pm] Subject: Re: [pve-devel] [PATCH v12 qemu-server 11/16] api: add endpoint for parsing .ovf files 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, 15 Mar 2022 13:00:04 -0000 Am 14.03.22 um 16:55 schrieb Fabian Grünbichler: > On March 9, 2022 11:09 am, Fabian Ebner wrote: >> +__PACKAGE__->register_method ({ >> + name => 'index', >> + path => '', >> + method => 'GET', >> + proxyto => 'node', >> + description => "Read an .ovf manifest.", > > protected => 1, > > else this is limited to files readable by www-data? Ack. > > also probably should think about how to integrate this into the > permission system, since being limited to root@pam is rather limiting ;) > > e.g., something like a new content type/subdir for importing that 'only' > requires Datastore.Allocate (not AllocateSpace) or a new priv? > > starting off like it is now is of course okay, but we probably want some > form of nicer import flow for the common cases (like, download OVA from > URL into import dir on storage foo, then import from there for example). > Will revisit when we add that. >> + parameters => { >> + additionalProperties => 0, >> + properties => { >> + node => get_standard_option('pve-node'), >> + manifest => { >> + description => "Path to .ovf manifest.", >> + type => 'string', >> + }, >> + }, >> + }, >> + returns => { >> + description => "VM config according to .ovf manifest.", >> + type => "object", >> + }, >> + returns => { >> + type => 'object', >> + additionalProperties => 1, >> + properties => PVE::QemuServer::json_ovf_properties({}), >> + }, > > duplicate returns key, I guess we want the combination of both here ;) > Will fix it. >> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm >> index 33f226e..ecf51f3 100644 >> --- a/PVE/QemuServer.pm >> +++ b/PVE/QemuServer.pm >> @@ -2203,6 +2203,38 @@ sub json_config_properties { >> return $prop; >> } >> >> +# Properties that we can read from an OVF file >> +sub json_ovf_properties { >> + my $prop = shift; > > not sure whether we need the $prop here instead of always starting with > a clean slate? is there some future extension that uses this that you > have in mind? > It was actually used in such a way in Dominic's version, because the non-drive properties were passed along as $prop. But yes, it can be dropped now.