[pbs-devel] [PATCH vma-to-pbs 2/4] add support for bulk import of a dump directory

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Oct 14 09:27:25 CEST 2024


On October 8, 2024 4:36 pm, Filip Schauer wrote:
> Superseded by:
> https://lists.proxmox.com/pipermail/pbs-devel/2024-October/010934.html
> 
> On 04/09/2024 11:14, Fabian Grünbichler wrote:
>>> +                let compression = match ext.as_str() {
>>> +                    "" => None,
>>> +                    ".zst" => Some(Compression::Zstd),
>>> +                    ".lzo" => Some(Compression::Lzo),
>>> +                    ".gz" => Some(Compression::GZip),
>>> +                    _ => continue,
>>> +                };
>> this could move to a FromStr on Compression?
> 
> 
> In this case, this would make it less readable, since this is an
> `Option<Compression>`. I could add a `Compression::Uncompressed`, but
> that would complicate the `match &backup_args.compression` in
> vma2pbs.rs:upload_vma_file.
> 
> 
> 
> On 04/09/2024 11:14, Fabian Grünbichler wrote:
>>> +                let mut notes_path_os_string: OsString = path.into();
>>> +                notes_path_os_string.push(".notes");
>>> +                let notes_path: PathBuf = notes_path_os_string.into();
>> these three lines could become
>>
>>                  let notes_path = path.join(".notes");
> 
> 
> This does not do the same thing. `.join(".notes")` would add "/.notes"
> to the path.

right. filename/with_filename would do the trick then? :)




More information about the pbs-devel mailing list