[pbs-devel] [PATCH proxmox v3 1/3] pbs-api-types: add schema for {worker, read, verify}-threads

Christian Ebner c.ebner at proxmox.com
Tue Nov 11 11:22:00 CET 2025


comments inline

On 11/10/25 9:44 AM, Nicolas Frey wrote:
> Add seperate schemas for read and verify thread count to use in
> chunk verification. Also add worker-threads for use in
> `TapeBackupJobSetup`.
> 
> Signed-off-by: Nicolas Frey <n.frey at proxmox.com>
> ---
>   pbs-api-types/src/datastore.rs | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
> 
> diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
> index a214ac25..3dd9ce75 100644
> --- a/pbs-api-types/src/datastore.rs
> +++ b/pbs-api-types/src/datastore.rs
> @@ -164,6 +164,20 @@ pub const PRUNE_SCHEMA_KEEP_YEARLY: Schema =
>           .minimum(1)
>           .schema();
> 
> +const fn threads_schema(default: i64) -> Schema {
> +    IntegerSchema::new("The number of threads to use for the job.")
> +        .minimum(1)
> +        .maximum(32)
> +        .default(default)
> +        .schema()

Failed to mention this in v2 of the patches, but these are all schemas 
related to the job config, not the datastore so they should be defined 
in pbs-api-types/src/jobs.rs instead.

Further, in order to have a less generic description for resulting 
schemas, thread_schema() might get a `description: &'static str` as 
second parameter, so this can be set accordingly.

> +pub const WORKER_THREADS_SCHEMA: Schema = threads_schema(1);


This is named a bit generic, might be more telling if prefix by `TAPE_JOB_`.

> +
> +pub const READ_THREADS_SCHEMA: Schema = threads_schema(1);

Same for above, but maybe `VERIFICIATION_` or `VERIFY_JOB_` as prefix ...

> +
> +pub const VERIFY_THREADS_SCHEMA: Schema = threads_schema(4);

... and above as well.

> +
>   /// Base directory where datastores are mounted
>   pub const DATASTORE_MOUNT_DIR: &str = "/mnt/datastore";
>   




More information about the pbs-devel mailing list