tape: change code hierarchy to improve docs

This commit is contained in:
Dietmar Maurer 2021-01-21 17:12:01 +01:00
parent e1fdcb1678
commit 37796ff73f
20 changed files with 76 additions and 63 deletions

View File

@ -21,7 +21,7 @@ use crate::{
ScsiTapeChanger,
LinuxTapeDrive,
},
tape::{
tape::drive::{
linux_tape_changer_list,
check_drive_path,
lookup_drive,

View File

@ -16,7 +16,7 @@ use crate::{
LinuxTapeDrive,
ScsiTapeChanger,
},
tape::{
tape::drive::{
linux_tape_device_list,
check_drive_path,
lookup_drive,

View File

@ -37,8 +37,8 @@ use crate::{
PoolWriter,
MediaPool,
SnapshotReader,
media_changer,
update_changer_online_status,
drive::media_changer,
changer::update_changer_online_status,
},
};

View File

@ -17,13 +17,15 @@ use crate::{
},
tape::{
TAPE_STATUS_DIR,
ElementStatus,
OnlineStatusMap,
Inventory,
linux_tape_changer_list,
mtx_status,
mtx_status_to_online_set,
mtx_transfer,
drive::linux_tape_changer_list,
changer::{
OnlineStatusMap,
ElementStatus,
mtx_status,
mtx_status_to_online_set,
mtx_transfer,
},
},
};

View File

@ -43,24 +43,24 @@ use crate::{
server::WorkerTask,
tape::{
TAPE_STATUS_DIR,
TapeDriver,
MediaPool,
Inventory,
MediaCatalog,
MediaId,
linux_tape_device_list,
open_drive,
media_changer,
required_media_changer,
update_changer_online_status,
linux_tape::{
LinuxTapeHandle,
open_linux_tape_device,
},
file_formats::{
file_formats::{
MediaLabel,
MediaSetLabel,
},
drive::{
TapeDriver,
LinuxTapeHandle,
open_linux_tape_device,
linux_tape_device_list,
media_changer,
required_media_changer,
open_drive,
},
changer::update_changer_online_status,
},
};

View File

@ -33,7 +33,7 @@ use crate::{
Inventory,
MediaPool,
MediaCatalog,
update_online_status,
changer::update_online_status,
},
};

View File

@ -55,10 +55,8 @@ use crate::{
MediaId,
MediaCatalog,
ChunkArchiveDecoder,
TapeDriver,
MediaPool,
Inventory,
request_and_load_media,
file_formats::{
PROXMOX_BACKUP_MEDIA_LABEL_MAGIC_1_0,
PROXMOX_BACKUP_SNAPSHOT_ARCHIVE_MAGIC_1_0,
@ -67,6 +65,10 @@ use crate::{
PROXMOX_BACKUP_CHUNK_ARCHIVE_MAGIC_1_0,
MediaContentHeader,
},
drive::{
TapeDriver,
request_and_load_media,
}
},
};

View File

@ -41,7 +41,7 @@ use proxmox_backup::{
media_pool::complete_pool_name,
},
tape::{
open_drive,
drive::open_drive,
complete_media_label_text,
complete_media_set_uuid,
file_formats::{

View File

@ -19,8 +19,10 @@ use proxmox_backup::{
},
},
tape::{
complete_changer_path,
media_changer,
drive::{
media_changer,
complete_changer_path,
},
},
config::{
self,

View File

@ -17,9 +17,7 @@ use proxmox_backup::{
DRIVE_NAME_SCHEMA,
},
},
tape::{
complete_drive_path,
},
tape::drive::complete_drive_path,
config::drive::{
complete_drive_name,
complete_changer_name,

View File

@ -31,8 +31,8 @@ use proxmox_backup::{
LinuxTapeDrive,
},
tape::{
TapeDriver,
linux_tape::{
drive::{
TapeDriver,
LinuxTapeHandle,
open_linux_tape_device,
check_tape_is_linux_tape_device,

View File

@ -1,3 +1,5 @@
//! Media changer implementation (SCSI media changer)
mod email;
pub use email::*;
@ -10,6 +12,9 @@ pub use mtx_wrapper::*;
mod mtx;
pub use mtx::*;
mod online_status_map;
pub use online_status_map::*;
use anyhow::{bail, Error};
/// Interface to the media changer device for a single drive

View File

@ -12,11 +12,13 @@ use crate::{
ScsiTapeChanger,
},
tape::{
MediaChange,
Inventory,
MtxStatus,
ElementStatus,
mtx_status,
changer::{
MediaChange,
MtxStatus,
ElementStatus,
mtx_status,
},
},
};

View File

@ -26,17 +26,17 @@ use crate::{
tape::{
TapeRead,
TapeWrite,
TapeAlertFlags,
Lp17VolumeStatistics,
read_mam_attributes,
mam_extract_media_usage,
read_tape_alert_flags,
read_volume_statistics,
set_encryption,
drive::{
linux_mtio::*,
LinuxTapeDrive,
TapeDriver,
linux_mtio::*,
TapeAlertFlags,
Lp17VolumeStatistics,
read_mam_attributes,
mam_extract_media_usage,
read_tape_alert_flags,
read_volume_statistics,
set_encryption,
},
file_formats::{
PROXMOX_TAPE_BLOCK_SIZE,

View File

@ -10,7 +10,7 @@ use proxmox::tools::io::ReadExt;
use crate::{
api2::types::MamAttribute,
tape::{
TapeAlertFlags,
drive::TapeAlertFlags,
sgutils2::SgRaw,
},
};

View File

@ -1,3 +1,5 @@
//! Tape drivers
mod virtual_tape;
mod linux_mtio;
@ -10,7 +12,8 @@ pub use volume_statistics::*;
mod encryption;
pub use encryption::*;
pub mod linux_tape;
mod linux_tape;
pub use linux_tape::*;
mod mam;
pub use mam::*;
@ -44,7 +47,6 @@ use crate::{
TapeWrite,
TapeRead,
MediaId,
MtxMediaChanger,
file_formats::{
PROXMOX_BACKUP_MEDIA_LABEL_MAGIC_1_0,
PROXMOX_BACKUP_MEDIA_SET_LABEL_MAGIC_1_0,
@ -54,6 +56,7 @@ use crate::{
},
changer::{
MediaChange,
MtxMediaChanger,
send_load_media_email,
},
},

View File

@ -15,10 +15,12 @@ use crate::{
tape::{
TapeWrite,
TapeRead,
MtxStatus,
DriveStatus,
ElementStatus,
changer::MediaChange,
changer::{
MediaChange,
MtxStatus,
DriveStatus,
ElementStatus,
},
drive::{
VirtualTapeDrive,
TapeDriver,

View File

@ -31,12 +31,12 @@ use crate::{
},
tape::{
TAPE_STATUS_DIR,
OnlineStatusMap,
MediaSet,
file_formats::{
MediaLabel,
MediaSetLabel,
},
changer::OnlineStatusMap,
},
};

View File

@ -26,14 +26,9 @@ pub use media_set::*;
mod inventory;
pub use inventory::*;
mod changer;
pub use changer::*;
pub mod changer;
mod drive;
pub use drive::*;
mod online_status_map;
pub use online_status_map::*;
pub mod drive;
mod media_pool;
pub use media_pool::*;

View File

@ -15,7 +15,6 @@ use crate::{
TAPE_STATUS_DIR,
MAX_CHUNK_ARCHIVE_SIZE,
COMMIT_BLOCK_SIZE,
TapeDriver,
TapeWrite,
ChunkArchiveWriter,
SnapshotReader,
@ -25,10 +24,13 @@ use crate::{
MediaCatalog,
MediaSetCatalog,
tape_write_snapshot_archive,
request_and_load_media,
tape_alert_flags_critical,
media_changer,
file_formats::MediaSetLabel,
drive::{
TapeDriver,
request_and_load_media,
tape_alert_flags_critical,
media_changer,
},
},
config::tape_encryption_keys::load_key_configs,
};