public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin
@ 2024-04-15 12:48 Fiona Ebner
  2024-04-15 12:48 ` [pve-devel] [PATCH docs] storage: pbs: document port option Fiona Ebner
  2024-04-17 14:55 ` [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin Thomas Lamprecht
  0 siblings, 2 replies; 6+ messages in thread
From: Fiona Ebner @ 2024-04-15 12:48 UTC (permalink / raw)
  To: pve-devel

Commit 7020491 ("esxi: add 'port' config parameter") started using
the 'port' option in a second plugin, but the definition stayed in the
PBS plugin. Avoid the hidden dependency and move the definition to the
base plugin instead.

It is necessary to mark it as optional or it would be required always.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/Storage/PBSPlugin.pm | 6 ------
 src/PVE/Storage/Plugin.pm    | 8 ++++++++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/PVE/Storage/PBSPlugin.pm b/src/PVE/Storage/PBSPlugin.pm
index 08ceb88..0808bcc 100644
--- a/src/PVE/Storage/PBSPlugin.pm
+++ b/src/PVE/Storage/PBSPlugin.pm
@@ -49,12 +49,6 @@ sub properties {
 	    description => "Base64-encoded, PEM-formatted public RSA key. Used to encrypt a copy of the encryption-key which will be added to each encrypted backup.",
 	    type => 'string',
 	},
-	port => {
-	    description => "For non default port.",
-	    type => 'integer',
-	    minimum => 1,
-	    maximum => 65535,
-	},
     };
 }
 
diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
index 22a9729..5f49830 100644
--- a/src/PVE/Storage/Plugin.pm
+++ b/src/PVE/Storage/Plugin.pm
@@ -205,6 +205,14 @@ my $defaultData = {
 	    format => 'pve-storage-options',
 	    optional => 1,
 	},
+	port => {
+	    description => "For PBS/ESXi, use this port to connect to the storage instead of the"
+		." default one.",
+	    type => 'integer',
+	    minimum => 1,
+	    maximum => 65535,
+	    optional => 1,
+	},
     },
 };
 
-- 
2.39.2





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH docs] storage: pbs: document port option
  2024-04-15 12:48 [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin Fiona Ebner
@ 2024-04-15 12:48 ` Fiona Ebner
  2024-04-17 14:55   ` [pve-devel] applied: " Thomas Lamprecht
  2024-04-17 14:55 ` [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin Thomas Lamprecht
  1 sibling, 1 reply; 6+ messages in thread
From: Fiona Ebner @ 2024-04-15 12:48 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 pve-storage-pbs.adoc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pve-storage-pbs.adoc b/pve-storage-pbs.adoc
index c33ee40..84d598f 100644
--- a/pve-storage-pbs.adoc
+++ b/pve-storage-pbs.adoc
@@ -24,6 +24,10 @@ server::
 
 Server IP or DNS name. Required.
 
+port::
+
+Use this port instead of the default one, i.e. `8007`. Optional.
+
 username::
 
 The username for the Proxmox Backup Server storage. Required.
-- 
2.39.2





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin
  2024-04-15 12:48 [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin Fiona Ebner
  2024-04-15 12:48 ` [pve-devel] [PATCH docs] storage: pbs: document port option Fiona Ebner
@ 2024-04-17 14:55 ` Thomas Lamprecht
  2024-04-18  7:38   ` Fiona Ebner
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Lamprecht @ 2024-04-17 14:55 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fiona Ebner

Am 15/04/2024 um 14:48 schrieb Fiona Ebner:
> Commit 7020491 ("esxi: add 'port' config parameter") started using
> the 'port' option in a second plugin, but the definition stayed in the
> PBS plugin. Avoid the hidden dependency and move the definition to the
> base plugin instead.
> 
> It is necessary to mark it as optional or it would be required always.
> 
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>  src/PVE/Storage/PBSPlugin.pm | 6 ------
>  src/PVE/Storage/Plugin.pm    | 8 ++++++++
>  2 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/src/PVE/Storage/PBSPlugin.pm b/src/PVE/Storage/PBSPlugin.pm
> index 08ceb88..0808bcc 100644
> --- a/src/PVE/Storage/PBSPlugin.pm
> +++ b/src/PVE/Storage/PBSPlugin.pm
> @@ -49,12 +49,6 @@ sub properties {
>  	    description => "Base64-encoded, PEM-formatted public RSA key. Used to encrypt a copy of the encryption-key which will be added to each encrypted backup.",
>  	    type => 'string',
>  	},
> -	port => {
> -	    description => "For non default port.",
> -	    type => 'integer',
> -	    minimum => 1,
> -	    maximum => 65535,
> -	},
>      };
>  }
>  
> diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
> index 22a9729..5f49830 100644
> --- a/src/PVE/Storage/Plugin.pm
> +++ b/src/PVE/Storage/Plugin.pm
> @@ -205,6 +205,14 @@ my $defaultData = {
>  	    format => 'pve-storage-options',
>  	    optional => 1,
>  	},
> +	port => {
> +	    description => "For PBS/ESXi, use this port to connect to the storage instead of the"

I'd probably avoid hard-coding "PBS/ESXi" here, it would work as good if that
part would be omitted:

"Use this port to connect to the storage instead of the default one."

In the long run we should switch to a per-plugin schema, like the (IIRC)
mappings have, as then we could correctly define defaults and descriptions
without having to be overly general to fit a common denominator.



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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] applied: [PATCH docs] storage: pbs: document port option
  2024-04-15 12:48 ` [pve-devel] [PATCH docs] storage: pbs: document port option Fiona Ebner
@ 2024-04-17 14:55   ` Thomas Lamprecht
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2024-04-17 14:55 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fiona Ebner

Am 15/04/2024 um 14:48 schrieb Fiona Ebner:
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>  pve-storage-pbs.adoc | 4 ++++
>  1 file changed, 4 insertions(+)
> 
>

applied, thanks!


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin
  2024-04-17 14:55 ` [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin Thomas Lamprecht
@ 2024-04-18  7:38   ` Fiona Ebner
  2024-04-18  8:15     ` Thomas Lamprecht
  0 siblings, 1 reply; 6+ messages in thread
From: Fiona Ebner @ 2024-04-18  7:38 UTC (permalink / raw)
  To: Thomas Lamprecht, Proxmox VE development discussion

Am 17.04.24 um 16:55 schrieb Thomas Lamprecht:
> Am 15/04/2024 um 14:48 schrieb Fiona Ebner:
>> diff --git a/src/PVE/Storage/Plugin.pm b/src/PVE/Storage/Plugin.pm
>> index 22a9729..5f49830 100644
>> --- a/src/PVE/Storage/Plugin.pm
>> +++ b/src/PVE/Storage/Plugin.pm
>> @@ -205,6 +205,14 @@ my $defaultData = {
>>  	    format => 'pve-storage-options',
>>  	    optional => 1,
>>  	},
>> +	port => {
>> +	    description => "For PBS/ESXi, use this port to connect to the storage instead of the"
> 
> I'd probably avoid hard-coding "PBS/ESXi" here, it would work as good if that
> part would be omitted:
> 
> "Use this port to connect to the storage instead of the default one."
> 
> In the long run we should switch to a per-plugin schema, like the (IIRC)
> mappings have, as then we could correctly define defaults and descriptions
> without having to be overly general to fit a common denominator.
> 

I was thinking, users might stumble upon this e.g. with "man pvesm", and
then try it for storages like NFS and wonder why it doesn't work. With
the "options" option we also explicitly mention NFS/CIFS. I'll send a v2
without mentioning PBS/ESXi if you still want me to after reading my
rationale (should remember to also mention such seemingly little things
in the commit message).


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin
  2024-04-18  7:38   ` Fiona Ebner
@ 2024-04-18  8:15     ` Thomas Lamprecht
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2024-04-18  8:15 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fiona Ebner

Am 18/04/2024 um 09:38 schrieb Fiona Ebner:
> I was thinking, users might stumble upon this e.g. with "man pvesm", and
> then try it for storages like NFS and wonder why it doesn't work. With
> the "options" option we also explicitly mention NFS/CIFS. I'll send a v2
> without mentioning PBS/ESXi if you still want me to after reading my
> rationale (should remember to also mention such seemingly little things
> in the commit message).

Yeah, some users might indeed be confused about NFS or the like..
how about adding this info at the end and as example, to avoid conveying
that this is a definitive list, e.g.: "... (for example, PBS or ESXi)"?


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-18  8:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-15 12:48 [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin Fiona Ebner
2024-04-15 12:48 ` [pve-devel] [PATCH docs] storage: pbs: document port option Fiona Ebner
2024-04-17 14:55   ` [pve-devel] applied: " Thomas Lamprecht
2024-04-17 14:55 ` [pve-devel] [PATCH storage] plugin: move definition for 'port' option to base plugin Thomas Lamprecht
2024-04-18  7:38   ` Fiona Ebner
2024-04-18  8:15     ` Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal