Skip to content

Commit

Permalink
Remove code for handling only pool size change
Browse files Browse the repository at this point in the history
From now on, if the pool size changes, then so will some other
properties, so we will likely always need to go with the pool foreground
change methods.

Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Jul 11, 2023
1 parent 826183d commit f1fa313
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 68 deletions.
53 changes: 0 additions & 53 deletions src/dbus_api/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,55 +722,6 @@ impl DbusTreeHandler {
);
}

/// Send a signal indicating that the pool total size has changed.
fn handle_pool_size_change(&self, path: Path<'static>, new_size: Bytes) {
if let Err(e) = self.property_changed_invalidated_signal(
&path,
prop_hashmap! {
consts::POOL_INTERFACE_NAME_3_0 => {
Vec::new(),
consts::POOL_TOTAL_SIZE_PROP.to_string() =>
box_variant!(pool_size_to_prop(new_size))
},
consts::POOL_INTERFACE_NAME_3_1 => {
Vec::new(),
consts::POOL_TOTAL_SIZE_PROP.to_string() =>
box_variant!(pool_size_to_prop(new_size))
},
consts::POOL_INTERFACE_NAME_3_2 => {
Vec::new(),
consts::POOL_TOTAL_SIZE_PROP.to_string() =>
box_variant!(pool_size_to_prop(new_size))
},
consts::POOL_INTERFACE_NAME_3_3 => {
Vec::new(),
consts::POOL_TOTAL_SIZE_PROP.to_string() =>
box_variant!(pool_size_to_prop(new_size))
},
consts::POOL_INTERFACE_NAME_3_4 => {
Vec::new(),
consts::POOL_TOTAL_SIZE_PROP.to_string() =>
box_variant!(pool_size_to_prop(new_size))
},
consts::POOL_INTERFACE_NAME_3_5 => {
Vec::new(),
consts::POOL_TOTAL_SIZE_PROP.to_string() =>
box_variant!(pool_size_to_prop(new_size))
},
consts::POOL_INTERFACE_NAME_3_6 => {
Vec::new(),
consts::POOL_TOTAL_SIZE_PROP.to_string() =>
box_variant!(pool_size_to_prop(new_size))
}
},
) {
warn!(
"Failed to send a signal over D-Bus indicating pool size change: {}",
e
);
}
}

/// Send a signal indicating that the pool filesystem limit has changed.
fn handle_pool_fs_limit_change(&self, path: Path<'static>, new_fs_limit: u64) {
if let Err(e) = self.property_changed_invalidated_signal(
Expand Down Expand Up @@ -1150,10 +1101,6 @@ impl DbusTreeHandler {
self.handle_pool_cache_change(item, has_cache);
Ok(true)
}
DbusAction::PoolSizeChange(path, new_size) => {
self.handle_pool_size_change(path, new_size);
Ok(true)
}
DbusAction::PoolFsLimitChange(path, new_limit) => {
self.handle_pool_fs_limit_change(path, new_limit);
Ok(true)
Expand Down
15 changes: 0 additions & 15 deletions src/dbus_api/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ pub enum DbusAction {
PoolKeyDescChange(Path<'static>, Option<PoolEncryptionInfo>),
PoolClevisInfoChange(Path<'static>, Option<PoolEncryptionInfo>),
PoolCacheChange(Path<'static>, bool),
PoolSizeChange(Path<'static>, Bytes),
PoolFsLimitChange(Path<'static>, u64),
PoolOverprovModeChange(Path<'static>, bool),
LockedPoolsChange(LockedPoolsInfo),
Expand Down Expand Up @@ -353,20 +352,6 @@ impl DbusContext {
}
}

/// Send changed signal for pool TotalPhysicalSize property.
pub fn push_pool_size_change(&self, item: &Path<'static>, new_size: Bytes) {
if let Err(e) = self
.sender
.send(DbusAction::PoolSizeChange(item.clone(), new_size))
{
warn!(
"D-Bus pool size change event could not be sent to the processing thread; \
no signal will be sent out for the size change of pool with path {}: {}",
item, e,
)
}
}

/// Send changed signal for pool FsLimit property.
pub fn push_pool_fs_limit_change(&self, item: &Path<'static>, new_fs_limit: u64) {
if let Err(e) = self
Expand Down

0 comments on commit f1fa313

Please sign in to comment.