public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] api types: add missing conf to blob archive name mapping
@ 2024-11-26 12:24 Christian Ebner
  2024-11-26 12:32 ` [pbs-devel] applied: " Fabian Grünbichler
  2024-11-26 12:35 ` [pbs-devel] " Thomas Lamprecht
  0 siblings, 2 replies; 6+ messages in thread
From: Christian Ebner @ 2024-11-26 12:24 UTC (permalink / raw)
  To: pbs-devel

Commit addfae26 ("api types: introduce `BackupArchiveName` type")
introduced a dedicated archive name api type to add rust type
checking and bundle helpers to the api type. Since this, the backup
archive name to server archive name mapping is handled by its parser.

This however did not cover the `.conf` extension used for VM config
files. Add the missing `.conf` to `.conf.blob` to the match statement
and the test cases.

Fixes: addfae26 ("api types: introduce `BackupArchiveName` type")
Reported-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 pbs-api-types/src/datastore.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 4927f3724..688b7dd03 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -1833,6 +1833,7 @@ impl BackupArchiveName {
             Some("ppxar") => ArchiveType::DynamicIndex,
             Some("pcat1") => ArchiveType::DynamicIndex,
             Some("img") => ArchiveType::FixedIndex,
+            Some("conf") => ArchiveType::Blob,
             Some("json") => ArchiveType::Blob,
             Some("key") => ArchiveType::Blob,
             Some("log") => ArchiveType::Blob,
@@ -1910,6 +1911,8 @@ mod tests {
             "/valid/rsa-encrypted.key.blob",
             "/valid/archive-name.log",
             "/valid/archive-name.log.blob",
+            "/valid/qemu-server.conf",
+            "/valid/qemu-server.conf.blob",
         ];
 
         for archive_name in valid_archive_names {
-- 
2.39.5



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


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

* [pbs-devel] applied: [PATCH proxmox-backup] api types: add missing conf to blob archive name mapping
  2024-11-26 12:24 [pbs-devel] [PATCH proxmox-backup] api types: add missing conf to blob archive name mapping Christian Ebner
@ 2024-11-26 12:32 ` Fabian Grünbichler
  2024-11-26 12:35 ` [pbs-devel] " Thomas Lamprecht
  1 sibling, 0 replies; 6+ messages in thread
From: Fabian Grünbichler @ 2024-11-26 12:32 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion

On November 26, 2024 1:24 pm, Christian Ebner wrote:
> Commit addfae26 ("api types: introduce `BackupArchiveName` type")
> introduced a dedicated archive name api type to add rust type
> checking and bundle helpers to the api type. Since this, the backup
> archive name to server archive name mapping is handled by its parser.
> 
> This however did not cover the `.conf` extension used for VM config
> files. Add the missing `.conf` to `.conf.blob` to the match statement
> and the test cases.
> 
> Fixes: addfae26 ("api types: introduce `BackupArchiveName` type")
> Reported-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
> ---
>  pbs-api-types/src/datastore.rs | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
> index 4927f3724..688b7dd03 100644
> --- a/pbs-api-types/src/datastore.rs
> +++ b/pbs-api-types/src/datastore.rs
> @@ -1833,6 +1833,7 @@ impl BackupArchiveName {
>              Some("ppxar") => ArchiveType::DynamicIndex,
>              Some("pcat1") => ArchiveType::DynamicIndex,
>              Some("img") => ArchiveType::FixedIndex,
> +            Some("conf") => ArchiveType::Blob,
>              Some("json") => ArchiveType::Blob,
>              Some("key") => ArchiveType::Blob,
>              Some("log") => ArchiveType::Blob,
> @@ -1910,6 +1911,8 @@ mod tests {
>              "/valid/rsa-encrypted.key.blob",
>              "/valid/archive-name.log",
>              "/valid/archive-name.log.blob",
> +            "/valid/qemu-server.conf",
> +            "/valid/qemu-server.conf.blob",
>          ];
>  
>          for archive_name in valid_archive_names {
> -- 
> 2.39.5
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 


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


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

* Re: [pbs-devel] [PATCH proxmox-backup] api types: add missing conf to blob archive name mapping
  2024-11-26 12:24 [pbs-devel] [PATCH proxmox-backup] api types: add missing conf to blob archive name mapping Christian Ebner
  2024-11-26 12:32 ` [pbs-devel] applied: " Fabian Grünbichler
@ 2024-11-26 12:35 ` Thomas Lamprecht
  2024-11-26 12:41   ` Fabian Grünbichler
  2024-11-26 12:48   ` Christian Ebner
  1 sibling, 2 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2024-11-26 12:35 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Christian Ebner

Am 26.11.24 um 13:24 schrieb Christian Ebner:
> Commit addfae26 ("api types: introduce `BackupArchiveName` type")
> introduced a dedicated archive name api type to add rust type
> checking and bundle helpers to the api type. Since this, the backup
> archive name to server archive name mapping is handled by its parser.

This is mostly relevant for the client or? I.e., this has no impact on
community implementations/experiments adding completely different archive
types?


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


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

* Re: [pbs-devel] [PATCH proxmox-backup] api types: add missing conf to blob archive name mapping
  2024-11-26 12:35 ` [pbs-devel] " Thomas Lamprecht
@ 2024-11-26 12:41   ` Fabian Grünbichler
  2024-11-26 12:48   ` Christian Ebner
  1 sibling, 0 replies; 6+ messages in thread
From: Fabian Grünbichler @ 2024-11-26 12:41 UTC (permalink / raw)
  To: Christian Ebner, Proxmox Backup Server development discussion

On November 26, 2024 1:35 pm, Thomas Lamprecht wrote:
> Am 26.11.24 um 13:24 schrieb Christian Ebner:
>> Commit addfae26 ("api types: introduce `BackupArchiveName` type")
>> introduced a dedicated archive name api type to add rust type
>> checking and bundle helpers to the api type. Since this, the backup
>> archive name to server archive name mapping is handled by its parser.
> 
> This is mostly relevant for the client or? I.e., this has no impact on
> community implementations/experiments adding completely different archive
> types?

yes, this is just a UX shortcut that allows leaving out the .blob
extension for blob types used by our stack. if you use a custom blob
type, you need to specify the full name including .blob when passing the
name to the client.

the reason is that with a generic catch-all matching to blob, we'd take
away our ability to add new index types without breaking clients relying
on that magic.

i.e., if a client could do `restore ... my_custom_blob.foobar`, we can't
add a `foobar` index/archive type ourselves later on without breaking
that client.


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


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

* Re: [pbs-devel] [PATCH proxmox-backup] api types: add missing conf to blob archive name mapping
  2024-11-26 12:35 ` [pbs-devel] " Thomas Lamprecht
  2024-11-26 12:41   ` Fabian Grünbichler
@ 2024-11-26 12:48   ` Christian Ebner
  2024-11-26 12:52     ` Thomas Lamprecht
  1 sibling, 1 reply; 6+ messages in thread
From: Christian Ebner @ 2024-11-26 12:48 UTC (permalink / raw)
  To: Thomas Lamprecht, Proxmox Backup Server development discussion

On 11/26/24 13:35, Thomas Lamprecht wrote:
> Am 26.11.24 um 13:24 schrieb Christian Ebner:
>> Commit addfae26 ("api types: introduce `BackupArchiveName` type")
>> introduced a dedicated archive name api type to add rust type
>> checking and bundle helpers to the api type. Since this, the backup
>> archive name to server archive name mapping is handled by its parser.
> 
> This is mostly relevant for the client or? I.e., this has no impact on
> community implementations/experiments adding completely different archive
> types?

No, this is not limited to the client. This is mostly used server side 
to map the archive name extension to the server archive name extension 
(.blob, .fidx, .didx).

The current mappings were already enforced/assumed by the server to some 
extend, and other archive types must use the full server archive name 
extension anyways, for the server to recognize it.

For community implementations: they will be affected by this as well, 
but they would already have need to pass the full server archive name 
extensions anyways. So this should not break anything for them.



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


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

* Re: [pbs-devel] [PATCH proxmox-backup] api types: add missing conf to blob archive name mapping
  2024-11-26 12:48   ` Christian Ebner
@ 2024-11-26 12:52     ` Thomas Lamprecht
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2024-11-26 12:52 UTC (permalink / raw)
  To: Christian Ebner, Proxmox Backup Server development discussion

Am 26.11.24 um 13:48 schrieb Christian Ebner:
> On 11/26/24 13:35, Thomas Lamprecht wrote:
>> Am 26.11.24 um 13:24 schrieb Christian Ebner:
>>> Commit addfae26 ("api types: introduce `BackupArchiveName` type")
>>> introduced a dedicated archive name api type to add rust type
>>> checking and bundle helpers to the api type. Since this, the backup
>>> archive name to server archive name mapping is handled by its parser.
>>
>> This is mostly relevant for the client or? I.e., this has no impact on
>> community implementations/experiments adding completely different archive
>> types?
> 
> No, this is not limited to the client. This is mostly used server side 
> to map the archive name extension to the server archive name extension 
> (.blob, .fidx, .didx).
> 
> The current mappings were already enforced/assumed by the server to some 
> extend, and other archive types must use the full server archive name 
> extension anyways, for the server to recognize it.
> 
> For community implementations: they will be affected by this as well, 
> but they would already have need to pass the full server archive name 
> extensions anyways. So this should not break anything for them.
> 

Ok, thank you for your explanation!


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


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

end of thread, other threads:[~2024-11-26 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-26 12:24 [pbs-devel] [PATCH proxmox-backup] api types: add missing conf to blob archive name mapping Christian Ebner
2024-11-26 12:32 ` [pbs-devel] applied: " Fabian Grünbichler
2024-11-26 12:35 ` [pbs-devel] " Thomas Lamprecht
2024-11-26 12:41   ` Fabian Grünbichler
2024-11-26 12:48   ` Christian Ebner
2024-11-26 12:52     ` 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