[pbs-devel] [PATCH proxmox-backup 1/5] api2/tape: add export_slots to DriveListEntry
Dominik Csapak
d.csapak at proxmox.com
Fri Jan 29 14:57:48 CET 2021
so that we can show it in the changer config grid
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
src/api2/config/changer.rs | 1 +
src/api2/tape/changer.rs | 1 +
src/api2/tape/drive.rs | 1 +
src/api2/types/tape/drive.rs | 3 +++
4 files changed, 6 insertions(+)
diff --git a/src/api2/config/changer.rs b/src/api2/config/changer.rs
index 8404d20b..832939e9 100644
--- a/src/api2/config/changer.rs
+++ b/src/api2/config/changer.rs
@@ -146,6 +146,7 @@ pub fn list_changers(
vendor: None,
model: None,
serial: None,
+ export_slots: changer.export_slots,
});
}
diff --git a/src/api2/tape/changer.rs b/src/api2/tape/changer.rs
index 84030f8e..64d36ae8 100644
--- a/src/api2/tape/changer.rs
+++ b/src/api2/tape/changer.rs
@@ -167,6 +167,7 @@ pub fn list_changers(
path: changer.path.clone(),
changer: None,
changer_drivenum: None,
+ export_slots: changer.export_slots,
vendor: None,
model: None,
serial: None,
diff --git a/src/api2/tape/drive.rs b/src/api2/tape/drive.rs
index 23991367..a49342fa 100644
--- a/src/api2/tape/drive.rs
+++ b/src/api2/tape/drive.rs
@@ -1162,6 +1162,7 @@ pub fn list_drives(
vendor: None,
model: None,
serial: None,
+ export_slots: None,
};
if let Some(info) = lookup_drive(&linux_drives, &drive.path) {
entry.vendor = Some(info.vendor.clone());
diff --git a/src/api2/types/tape/drive.rs b/src/api2/types/tape/drive.rs
index 9d9b0591..a17e5cbb 100644
--- a/src/api2/types/tape/drive.rs
+++ b/src/api2/types/tape/drive.rs
@@ -104,6 +104,9 @@ pub struct DriveListEntry {
/// Serial number (autodetected)
#[serde(skip_serializing_if="Option::is_none")]
pub serial: Option<String>,
+ /// Self defined Import/Export Slots for devices without explicit ones
+ #[serde(skip_serializing_if="Option::is_none")]
+ pub export_slots: Option<String>,
}
#[api()]
--
2.20.1
More information about the pbs-devel
mailing list