10000 Online re-encrypt by jbaublitz · Pull Request #3651 · stratis-storage/stratisd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Online re-encrypt #3651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stratisd"
version = "3.8.1"
version = "3.9.0"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
Expand Down Expand Up @@ -79,7 +79,7 @@ version = "1.2.3"
optional = true

[dependencies.chrono]
version = "0.4.20"
version = "0.4.31"
optional = true
default-features = false
features = ["clock", "std"]
Expand Down
7 changes: 1 addition & 6 deletions src/dbus_api/api/manager_3_8/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::{
blockdev::create_dbus_blockdev,
filesystem::create_dbus_filesystem,
pool::create_dbus_pool,
types::{DbusErrorEnum, TData, OK_STRING},
types::{DbusErrorEnum, EncryptionInfos, TData, OK_STRING},
util::{engine_to_dbus_err_tuple, get_next_arg, tuple_to_option},
},
engine::{
Expand All @@ -29,11 +29,6 @@ use crate::{
stratis::StratisError,
};

type EncryptionInfos<'a> = (
Vec<((bool, u32), &'a str)>,
Vec<((bool, u32), &'a str, &'a str)>,
);

pub fn start_pool(m: &MethodInfo<'_, MTSync<TData>, TData>) -> MethodResult {
let base_path = m.path.get_name();
let message: &Message = m.msg;
Expand Down
18 changes: 18 additions & 0 deletions src/dbus_api/api/mod.rs
9E19
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,20 @@ pub fn get_base_tree<'a>(
.add_p(manager_3_0::version_property(&f))
.add_p(manager_3_8::stopped_pools_property(&f)),
)
.add(
f.interface(consts::MANAGER_INTERFACE_NAME_3_9, ())
.add_m(manager_3_8::create_pool_method(&f))
.add_m(manager_3_0::set_key_method(&f))
.add_m(manager_3_0::unset_key_method(&f))
.add_m(manager_3_0::list_keys_method(&f))
.add_m(manager_3_0::destroy_pool_method(&f))
.add_m(manager_3_0::engine_state_report_method(&f))
.add_m(manager_3_8::start_pool_method(&f))
.add_m(manager_3_6::stop_pool_method(&f))
.add_m(manager_3_2::refresh_state_method(&f))
.add_p(manager_3_0::version_property(&f))
.add_p(manager_3_8::stopped_pools_property(&f)),
)
.add(
f.interface(consts::REPORT_INTERFACE_NAME_3_0, ())
.add_m(report_3_0::get_report_method(&f)),
Expand Down Expand Up @@ -199,6 +213,10 @@ pub fn get_base_tree<'a>(
.add(
f.interface(consts::REPORT_INTERFACE_NAME_3_8, ())
.add_m(report_3_0::get_report_method(&f)),
)
.add(
f.interface(consts::REPORT_INTERFACE_NAME_3_9, ())
.add_m(report_3_0::get_report_method(&f)),
);

let path = obj_path.get_name().to_owned();
Expand Down
25 changes: 25 additions & 0 deletions src/dbus_api/blockdev/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,19 @@ pub fn create_dbus_blockdev<'a>(
.add_p(blockdev_3_0::physical_path_property(&f))
.add_p(blockdev_3_0::size_property(&f))
.add_p(blockdev_3_3::new_size_property(&f)),
)
.add(
f.interface(consts::BLOCKDEV_INTERFACE_NAME_3_9, ())
.add_p(blockdev_3_0::devnode_property(&f))
.add_p(blockdev_3_0::hardware_info_property(&f))
.add_p(blockdev_3_0::initialization_time_property(&f))
.add_p(blockdev_3_0::pool_property(&f))
.add_p(blockdev_3_0::tier_property(&f))
.add_p(blockdev_3_3::user_info_property(&f))
.add_p(blockdev_3_0::uuid_property(&f))
.add_p(blockdev_3_0::physical_path_property(&f))
.add_p(blockdev_3_0::size_property(&f))
.add_p(blockdev_3_3::new_size_property(&f)),
);

let path = object_path.get_name().to_owned();
Expand Down Expand Up @@ -261,6 +274,18 @@ pub fn get_blockdev_properties(
consts::BLOCKDEV_NEW_SIZE_PROP => shared::blockdev_new_size_prop(dev)
},
consts::BLOCKDEV_INTERFACE_NAME_3_8 => {
consts::BLOCKDEV_DEVNODE_PROP => shared::blockdev_devnode_prop(dev),
consts::BLOCKDEV_HARDWARE_INFO_PROP => shared::blockdev_hardware_info_prop(dev),
consts::BLOCKDEV_USER_INFO_PROP => shared::blockdev_user_info_prop(dev),
consts::BLOCKDEV_INIT_TIME_PROP => shared::blockdev_init_time_prop(dev),
consts::BLOCKDEV_POOL_PROP => parent.clone(),
consts::BLOCKDEV_UUID_PROP => uuid_to_string!(dev_uuid),
consts::BLOCKDEV_TIER_PROP => shared::blockdev_tier_prop(tier),
consts::BLOCKDEV_PHYSICAL_PATH_PROP => shared::blockdev_physical_path_prop(dev),
consts::BLOCKDEV_TOTAL_SIZE_PROP => shared::blockdev_size_prop(dev),
consts::BLOCKDEV_NEW_SIZE_PROP => shared::blockdev_new_size_prop(dev)
},
consts::BLOCKDEV_INTERFACE_NAME_3_9 => {
consts::BLOCKDEV_DEVNODE_PROP => shared::blockdev_devnode_prop(dev),
consts::BLOCKDEV_HARDWARE_INFO_PROP => shared::blockdev_hardware_info_prop(dev),
consts::BLOCKDEV_USER_INFO_PROP => shared::blockdev_user_info_prop(dev),
Expand Down
9 changes: 9 additions & 0 deletions src/dbus_api/consts.rs
10000
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub const MANAGER_INTERFACE_NAME_3_5: &str = "org.storage.stratis3.Manager.r5";
pub const MANAGER_INTERFACE_NAME_3_6: &str = "org.storage.stratis3.Manager.r6";
pub const MANAGER_INTERFACE_NAME_3_7: &str = "org.storage.stratis3.Manager.r7";
pub const MANAGER_INTERFACE_NAME_3_8: &str = "org.storage.stratis3.Manager.r8";
pub const MANAGER_INTERFACE_NAME_3_9: &str = "org.storage.stratis3.Manager.r9";
pub const REPORT_INTERFACE_NAME_3_0: &str = "org.storage.stratis3.Report.r0";
pub const REPORT_INTERFACE_NAME_3_1: &str = "org.storage.stratis3.Report.r1";
pub const REPORT_INTERFACE_NAME_3_2: &str = "org.storage.stratis3.Report.r2";
Expand All @@ -25,6 +26,7 @@ pub const REPORT_INTERFACE_NAME_3_5: &str = "org.storage.stratis3.Report.r5";
pub const REPORT_INTERFACE_NAME_3_6: &str = "org.storage.stratis3.Report.r6";
pub const REPORT_INTERFACE_NAME_3_7: &str = "org.storage.stratis3.Report.r7";
pub const REPORT_INTERFACE_NAME_3_8: &str = "org.storage.stratis3.Report.r8";
pub const REPORT_INTERFACE_NAME_3_9: &str = "org.storage.stratis3.Report.r9";

pub const LOCKED_POOLS_PROP: &str = "LockedPools";
pub const STOPPED_POOLS_PROP: &str = "StoppedPools";
Expand All @@ -38,6 +40,7 @@ pub const POOL_INTERFACE_NAME_3_5: &str = "org.storage.stratis3.pool.r5";
pub const POOL_INTERFACE_NAME_3_6: &str = "org.storage.stratis3.pool.r6";
pub const POOL_INTERFACE_NAME_3_7: &str = "org.storage.stratis3.pool.r7";
pub const POOL_INTERFACE_NAME_3_8: &str = "org.storage.stratis3.pool.r8";
pub const POOL_INTERFACE_NAME_3_9: &str = "org.storage.stratis3.pool.r9";
pub const POOL_NAME_PROP: &str = "Name";
pub const POOL_UUID_PROP: &str = "Uuid";
pub const POOL_HAS_CACHE_PROP: &str = "HasCache";
Expand All @@ -55,6 +58,7 @@ pub const POOL_OVERPROV_PROP: &str = "Overprovisioning";
pub const POOL_NO_ALLOCABLE_SPACE_PROP: &str = "NoAllocSpace";
pub const POOL_METADATA_VERSION_PROP: &str = "MetadataVersion";
pub const POOL_FREE_TOKEN_SLOTS_PROP: &str = "FreeTokenSlots";
pub const POOL_LAST_REENCRYPTED_TIMESTAMP_PROP: &str = "LastReencryptedTimestamp";

pub const FILESYSTEM_INTERFACE_NAME_3_0: &str = "org.storage.stratis3.filesystem.r0";
pub const FILESYSTEM_INTERFACE_NAME_3_1: &str = "org.storage.stratis3.filesystem.r1";
Expand All @@ -65,6 +69,7 @@ pub const FILESYSTEM_INTERFACE_NAME_3_5: &str = "org.storage.stratis3.filesystem
pub const FILESYSTEM_INTERFACE_NAME_3_6: &str = "org.storage.stratis3.filesystem.r6";
pub const FILESYSTEM_INTERFACE_NAME_3_7: &str = "org.storage.stratis3.filesystem.r7";
pub const FILESYSTEM_INTERFACE_NAME_3_8: &str = "org.storage.stratis3.filesystem.r8";
pub const FILESYSTEM_INTERFACE_NAME_3_9: &str = "org.storage.stratis3.filesystem.r9";
pub const FILESYSTEM_NAME_PROP: &str = "Name";
pub const FILESYSTEM_UUID_PROP: &str = "Uuid";
pub const FILESYSTEM_USED_PROP: &str = "Used";
Expand All @@ -85,6 +90,7 @@ pub const BLOCKDEV_INTERFACE_NAME_3_5: &str = "org.storage.stratis3.blockdev.r5"
pub const BLOCKDEV_INTERFACE_NAME_3_6: &str = "org.storage.stratis3.blockdev.r6";
pub const BLOCKDEV_INTERFACE_NAME_3_7: &str = "org.storage.stratis3.blockdev.r7";
pub const BLOCKDEV_INTERFACE_NAME_3_8: &str = "org.storage.stratis3.blockdev.r8";
pub const BLOCKDEV_INTERFACE_NAME_3_9: &str = "org.storage.stratis3.blockdev.r9";
pub const BLOCKDEV_DEVNODE_PROP: &str = "Devnode";
pub const BLOCKDEV_HARDWARE_INFO_PROP: &str = "HardwareInfo";
pub const BLOCKDEV_USER_INFO_PROP: &str = "UserInfo";
Expand All @@ -108,6 +114,7 @@ pub fn standard_pool_interfaces() -> Vec<String> {
POOL_INTERFACE_NAME_3_6,
POOL_INTERFACE_NAME_3_7,
POOL_INTERFACE_NAME_3_8,
POOL_INTERFACE_NAME_3_9,
]
.iter()
.map(|s| (*s).to_string())
Expand All @@ -126,6 +133,7 @@ pub fn standard_filesystem_interfaces() -> Vec<String> {
FILESYSTEM_INTERFACE_NAME_3_6,
FILESYSTEM_INTERFACE_NAME_3_7,
FILESYSTEM_INTERFACE_NAME_3_8,
FILESYSTEM_INTERFACE_NAME_3_9,
]
.iter()
.map(|s| (*s).to_string())
Expand All @@ -144,6 +152,7 @@ pub fn standard_blockdev_interfaces() -> Vec<String> {
BLOCKDEV_INTERFACE_NAME_3_6,
BLOCKDEV_INTERFACE_NAME_3_7,
BLOCKDEV_INTERFACE_NAME_3_8,
BLOCKDEV_INTERFACE_NAME_3_9,
]
.iter()
.map(|s| (*s).to_string())
Expand Down
26 changes: 26 additions & 0 deletions src/dbus_api/filesystem/mod.rs
CEB7
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,20 @@ pub fn create_dbus_filesystem<'a>(
.add_p(filesystem_3_6::size_limit_property(&f))
.add_p(filesystem_3_7::origin_property(&f))
.add_p(filesystem_3_7::merge_scheduled_property(&f)),
)
.add(
f.interface(consts::FILESYSTEM_INTERFACE_NAME_3_9, ())
.add_m(filesystem_3_0::rename_method(&f))
.add_p(filesystem_3_0::devnode_property(&f))
.add_p(filesystem_3_0::name_property(&f))
.add_p(filesystem_3_0::pool_property(&f))
.add_p(filesystem_3_0::uuid_property(&f))
.add_p(filesystem_3_0::created_property(&f))
.add_p(filesystem_3_0::size_property(&f))
.add_p(filesystem_3_0::used_property(&f))
.add_p(filesystem_3_6::size_limit_property(&f))
.add_p(filesystem_3_7::origin_property(&f))
.add_p(filesystem_3_7::merge_scheduled_property(&f)),
);

let path = object_path.get_name().to_owned();
Expand Down Expand Up @@ -236,6 +250,18 @@ pub fn get_fs_properties(
consts::FILESYSTEM_MERGE_SCHEDULED_PROP => shared::fs_merge_scheduled_prop(fs)
},
consts::FILESYSTEM_INTERFACE_NAME_3_8 => {
consts::FILESYSTEM_NAME_PROP => shared::fs_name_prop(fs_name),
consts::FILESYSTEM_UUID_PROP => uuid_to_string!(fs_uuid),
consts::FILESYSTEM_DEVNODE_PROP => shared::fs_devnode_prop(fs, pool_name, fs_name),
consts::FILESYSTEM_POOL_PROP => parent.clone(),
consts::FILESYSTEM_CREATED_PROP => shared::fs_created_prop(fs),
consts::FILESYSTEM_SIZE_PROP => shared::fs_size_prop(fs),
consts::FILESYSTEM_USED_PROP => shared::fs_used_prop(fs),
consts::FILESYSTEM_SIZE_LIMIT_PROP => shared::fs_size_limit_prop(fs),
consts::FILESYSTEM_ORIGIN_PROP => shared::fs_origin_prop(fs),
consts::FILESYSTEM_MERGE_SCHEDULED_PROP => shared::fs_merge_scheduled_prop(fs)
},
consts::FILESYSTEM_INTERFACE_NAME_3_9 => {
consts::FILESYSTEM_NAME_PROP => shared::fs_name_prop(fs_name),
consts::FILESYSTEM_UUID_PROP => uuid_to_string!(fs_uuid),
consts::FILESYSTEM_DEVNODE_PROP => shared::fs_devnode_prop(fs, pool_name, fs_name),
Expand Down
57 changes: 57 additions & 0 deletions src/dbus_api/pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ mod pool_3_5;
mod pool_3_6;
mod pool_3_7;
mod pool_3_8;
mod pool_3_9;
pub mod prop_conv;
mod shared;

Expand Down Expand Up @@ -309,6 +310,44 @@ pub fn create_dbus_pool<'a>(
.add_p(pool_3_1::no_alloc_space_property(&f))
.add_p(pool_3_8::metadata_version_property(&f))
.add_p(pool_3_8::free_token_slots_property(&f)),
)
.add(
f.interface(consts::POOL_INTERFACE_NAME_3_9, ())
.add_m(pool_3_6::create_filesystems_method(&f))
.add_m(pool_3_7::destroy_filesystems_method(&f))
.add_m(pool_3_0::snapshot_filesystem_method(&f))
.add_m(pool_3_0::add_blockdevs_method(&f))
.add_m(pool_3_8::bind_clevis_method(&f))
.add_m(pool_3_8::unbind_clevis_method(&f))
.add_m(pool_3_5::init_cache_method(&f))
.add_m(pool_3_0::add_cachedevs_method(&f))
.add_m(pool_3_8::bind_keyring_method(&f))
.add_m(pool_3_8::unbind_keyring_method(&f))
.add_m(pool_3_8::rebind_keyring_method(&f))
.add_m(pool_3_8::rebind_clevis_method(&f))
.add_m(pool_3_0::rename_method(&f))
.add_m(pool_3_3::grow_physical_device_method(&f))
.add_m(pool_3_7::get_metadata_method(&f))
.add_m(pool_3_7::get_fs_metadata_method(&f))
.add_m(pool_3_9::encrypt_pool_method(&f))
.add_m(pool_3_9::reencrypt_pool_method(&f))
.add_m(pool_3_9::decrypt_pool_method(&f))
.add_p(pool_3_0::name_property(&f))
.add_p(pool_3_0::uuid_property(&f))
.add_p(pool_3_0::encrypted_property(&f))
.add_p(pool_3_0::avail_actions_property(&f))
.add_p(pool_3_8::key_descs_property(&f))
.add_p(pool_3_8::clevis_infos_property(&f))
.add_p(pool_3_0::has_cache_property(&f))
.add_p(pool_3_0::alloc_size_property(&f))
.add_p(pool_3_0::used_size_property(&f))
.add_p(pool_3_0::total_size_property(&f))
.add_p(pool_3_1::fs_limit_property(&f))
.add_p(pool_3_1::enable_overprov_property(&f))
.add_p(pool_3_1::no_alloc_space_property(&f))
.add_p(pool_3_8::metadata_version_property(&f))
.add_p(pool_3_8::free_token_slots_property(&f))
.add_p(pool_3_9::last_reencrypted_timestamp_property(&f)),
);

let path = object_path.get_name().to_owned();
Expand Down Expand Up @@ -457,6 +496,24 @@ pub fn get_pool_properties(
consts::POOL_NO_ALLOCABLE_SPACE_PROP => shared::pool_no_alloc_space(pool),
consts::POOL_METADATA_VERSION_PROP => shared::pool_metadata_version(pool),
consts::POOL_FREE_TOKEN_SLOTS_PROP => shared::pool_free_token_slots(pool)
},
consts::POOL_INTERFACE_NAME_3_9 => {
consts::POOL_NAME_PROP => shared::pool_name_prop(pool_name),
consts::POOL_UUID_PROP => uuid_to_string!(pool_uuid),
consts::POOL_ENCRYPTED_PROP => shared::pool_enc_prop(pool),
consts::POOL_AVAIL_ACTIONS_PROP => shared::pool_avail_actions_prop(pool),
consts::POOL_KEY_DESCS_PROP => shared::pool_key_descs_prop(pool),
consts::POOL_CLEVIS_INFOS_PROP => shared::pool_clevis_infos_prop(pool),
consts::POOL_HAS_CACHE_PROP => shared::pool_has_cache_prop(pool),
consts::POOL_ALLOC_SIZE_PROP => shared::pool_allocated_size(pool),
consts::POOL_TOTAL_USED_PROP => shared::pool_used_size(pool),
consts::POOL_TOTAL_SIZE_PROP => shared::pool_total_size(pool),
consts::POOL_FS_LIMIT_PROP => shared::pool_fs_limit(pool),
consts::POOL_OVERPROV_PROP => shared::pool_overprov_enabled(pool),
consts::POOL_NO_ALLOCABLE_SPACE_PROP => shared::pool_no_alloc_space(pool),
consts::POOL_METADATA_VERSION_PROP => shared::pool_metadata_version(pool),
consts::POOL_FREE_TOKEN_SLOTS_PROP => shared::pool_free_token_slots(pool),
consts::POOL_LAST_REENCRYPTED_TIMESTAMP_PROP => shared::pool_last_reencrypted_timestamp(pool)
}
}
}
2 changes: 1 addition & 1 deletion src/dbus_api/pool/pool_3_0/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub fn add_cachedevs_method(f: &Factory<MTSync<TData>, TData>) -> Method<MTSync<
pub fn encrypted_property(f: &Factory<MTSync<TData>, TData>) -> Property<MTSync<TData>, TData> {
f.property::<bool, _>(consts::POOL_ENCRYPTED_PROP, ())
.access(Access::Read)
.emits_changed(EmitsChangedSignal::Const)
.emits_changed(EmitsChangedSignal::True)
.on_get(get_pool_encrypted)
}

Expand Down
Loading
0