[pbs-devel] [PATCH v2 proxmox-backup 06/15] api2: add 'removable' to DataStoreListItem

Dominik Csapak d.csapak at proxmox.com
Wed Sep 1 16:48:54 CEST 2021


On 8/30/21 13:14, Hannes Laimer wrote:
> ---
>   pbs-api-types/src/lib.rs    | 7 +++++++
>   src/api2/admin/datastore.rs | 1 +
>   2 files changed, 8 insertions(+)
> 
> diff --git a/pbs-api-types/src/lib.rs b/pbs-api-types/src/lib.rs
> index 576099eb..2965a11a 100644
> --- a/pbs-api-types/src/lib.rs
> +++ b/pbs-api-types/src/lib.rs
> @@ -437,6 +437,12 @@ pub struct GroupListItem {
>               optional: true,
>               schema: SINGLE_LINE_COMMENT_SCHEMA,
>           },
> +        removable: {
> +            description: "The datastore is marked as removable.",
> +            type: bool,
> +            optional: true,
> +            default: false,
> +        },
>       },
>   )]
>   #[derive(Serialize, Deserialize)]
> @@ -445,6 +451,7 @@ pub struct GroupListItem {
>   pub struct DataStoreListItem {
>       pub store: String,
>       pub comment: Option<String>,
> +    pub removable: bool,
>   }
>   
>   #[api(
> diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs
> index 16559678..b236dfab 100644
> --- a/src/api2/admin/datastore.rs
> +++ b/src/api2/admin/datastore.rs
> @@ -1089,6 +1089,7 @@ pub fn get_datastore_list(
>                   DataStoreListItem {
>                       store: store.clone(),
>                       comment: data["comment"].as_str().map(String::from),
> +                    removable: data["backing-device"] != Value::Null,

isn't that check wrong? it is only removable if we have a
backing-device *and* as backing-device-mount-point?

>                   }
>               );
>           }
> 






More information about the pbs-devel mailing list