Skip to content

Commit 572e69f

Browse files
mayastor-borsdsharma-dc
andcommitted
Merge #1842
1842: chore: reflect encryption state of replica r=dsharma-dc a=dsharma-dc Co-authored-by: Diwakar Sharma <[email protected]>
2 parents 32cb19a + 56ff635 commit 572e69f

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

io-engine/src/bin/io-engine-client/v1/replica_cli.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ async fn replica_list(mut ctx: Context, matches: &ArgMatches) -> crate::Result<(
351351
.allocated_bytes_snapshot_from_clone
352352
.unwrap_or_default()
353353
.to_string(),
354+
r.encrypted.unwrap_or_default().to_string(),
354355
]
355356
})
356357
.collect();
@@ -369,6 +370,7 @@ async fn replica_list(mut ctx: Context, matches: &ArgMatches) -> crate::Result<(
369370
"IS_CLONE",
370371
"SNAP_ANCESTOR_SIZE",
371372
"CLONE_SNAP_ANCESTOR_SIZE",
373+
"ENCRYPTED",
372374
],
373375
table,
374376
);

io-engine/src/core/logical_volume.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ pub trait LogicalVolume: std::fmt::Debug {
5050
fn bdev_share_uri(&self) -> Option<String>;
5151
/// Return the NVMf allowed hosts of this Logical Volume.
5252
fn nvmf_allowed_hosts(&self) -> Vec<String>;
53+
/// Returns true if this replica is encrypted.
54+
fn encrypted(&self) -> bool;
5355
}
5456

5557
/// Lvol space usage.

io-engine/src/grpc/v1/replica.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ impl From<&dyn ReplicaOps> for Replica {
150150
pooluuid: l.pool_uuid(),
151151
snapshot_uuid: l.snapshot_uuid(),
152152
entity_id: l.entity_id(),
153+
encrypted: Some(l.encrypted()),
153154
}
154155
}
155156
}

io-engine/src/lvm/lv_replica.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,11 @@ impl crate::core::LogicalVolume for LogicalVolume {
855855
fn nvmf_allowed_hosts(&self) -> Vec<String> {
856856
self.allowed_hosts().cloned().unwrap_or_default()
857857
}
858+
859+
fn encrypted(&self) -> bool {
860+
// until we support lvm backend with encryption
861+
false
862+
}
858863
}
859864

860865
#[async_trait::async_trait(?Send)]

io-engine/src/lvs/lvs_lvol.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,10 @@ impl LogicalVolume for Lvol {
724724
fn nvmf_allowed_hosts(&self) -> Vec<String> {
725725
self.allowed_hosts()
726726
}
727+
728+
fn encrypted(&self) -> bool {
729+
self.lvs().encrypted()
730+
}
727731
}
728732

729733
/// LvsLvol Trait Implementation for Lvol for Volume Specific Interface.

0 commit comments

Comments
 (0)