all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 storage 5/7] api: alloc: allow 'vmdk' for the 'format' option
Date: Wed,  5 Mar 2025 11:49:21 +0100	[thread overview]
Message-ID: <20250305104923.23618-6-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250305104923.23618-1-f.ebner@proxmox.com>

The API endpoint will automatically detect the format from the
extension for raw, qcow2 and vmdk, but it was not yet possible to
specify the format explicitly via the parameter. This could be
annoying/surprising to users. There also might be third-party plugins
that want to use vmdk, but not require a suffix in the name. Add
'vmdk' as an allowed format to avoid these issues and for consistency
by using the 'pve-storage-format' format.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---

Changes in v2:
* use existing format

 src/PVE/API2/Storage/Content.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/PVE/API2/Storage/Content.pm b/src/PVE/API2/Storage/Content.pm
index 3b73e90..03cc4a1 100644
--- a/src/PVE/API2/Storage/Content.pm
+++ b/src/PVE/API2/Storage/Content.pm
@@ -6,6 +6,7 @@ use warnings;
 use PVE::SafeSyslog;
 use PVE::Cluster;
 use PVE::Storage;
+use PVE::Storage::Plugin; # for 'pve-storage-format' format
 use PVE::INotify;
 use PVE::Exception qw(raise_param_exc);
 use PVE::RPCEnvironment;
@@ -179,7 +180,7 @@ __PACKAGE__->register_method ({
 	    },
 	    'format' => {
 		type => 'string',
-		enum => ['raw', 'qcow2', 'subvol'],
+		format => 'pve-storage-format',
 		requires => 'size',
 		optional => 1,
 	    },
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-03-05 10:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 10:49 [pve-devel] [PATCH-SERIES v2 qemu-server/storage/guest-common 0/7] slightly improve image format handling Fiona Ebner
2025-03-05 10:49 ` [pve-devel] [PATCH v2 qemu-server 1/7] drive: remove ancient 'cow' from formats Fiona Ebner
2025-03-05 10:49 ` [pve-devel] [PATCH v2 storage 2/7] plugin: file size info: " Fiona Ebner
2025-03-05 10:49 ` [pve-devel] [PATCH v2 storage 3/7] api: code cleanup: remove unused Data::Dumper include Fiona Ebner
2025-03-05 10:49 ` [pve-devel] [PATCH v2 storage 4/7] schema: anchor regex for 'pve-storage-format' Fiona Ebner
2025-03-05 10:49 ` Fiona Ebner [this message]
2025-03-05 10:49 ` [pve-devel] [PATCH v2 storage 6/7] introduce 'pve-storage-image-format' standard option for image format Fiona Ebner
2025-03-05 10:49 ` [pve-devel] [PATCH v2 guest-common 7/7] storage tunnel: use pve-storage-image-format standard option Fiona Ebner
2025-04-03 13:10 ` [pve-devel] [PATCH-SERIES v2 qemu-server/storage/guest-common 0/7] slightly improve image format handling Fabian Grünbichler
2025-04-04  8:00 ` [pve-devel] applied-series: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250305104923.23618-6-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal