Skip to content

Commit 2e48471

Browse files
mayastor-borsdsharma-dc
mayastor-bors
andcommitted
Merge #1836
1836: Populate disk info for encrypted pools r=dsharma-dc a=dsharma-dc The `DISKS` field is now populated for an encrypted pool also. ``` ./io-engine-client pool list NAME UUID STATE CAPACITY USED USED% CLUSTER_SIZE PAGE_SIZE MD_PAGE_SIZE MD_PAGES MD_USED_PAGES MD_USED% DISKS DISK_CAPACITY ENCRYPTED pool-2 f74d6a27-0ed6-4331-9760-29ab2fd76193 online 310378496 0 0.00% 4194304 4096 4096 75 1 1.33% aio:///dev/loop1?uuid=9cc90df3-828d-4b4a-a357-424f31332604 314572800 false pool-1 49c29a9f-bc2e-4c7d-9fd5-12972899c4ec online 5360320512 0 0.00% 4194304 4096 4096 1280 1 0.08% aio:///dev/loop0?uuid=7870a4dc-fb82-4a57-b3e5-a32b37782fbc 5368709120 true ``` Co-authored-by: Diwakar Sharma <diwakar.sharma@datacore.com>
2 parents 0762d9c + 8d1ddbf commit 2e48471

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ async fn list(mut ctx: Context, matches: &ArgMatches) -> crate::Result<()> {
664664
md_usage,
665665
p.disks.join(" "),
666666
ctx.units(disk_cap),
667+
p.encrypted.unwrap_or_default().to_string(),
667668
]
668669
})
669670
.collect();
@@ -683,6 +684,7 @@ async fn list(mut ctx: Context, matches: &ArgMatches) -> crate::Result<()> {
683684
"MD_USED%",
684685
"DISKS",
685686
"DISK_CAPACITY",
687+
"ENCRYPTED",
686688
],
687689
table,
688690
);

io-engine/src/lvs/mod.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{
22
bdev::PtplFileOps,
33
core::{
4-
snapshot::SnapshotDescriptor, CloneParams, LogicalVolume, Protocol, PtplProps, Share,
4+
snapshot::SnapshotDescriptor, Bdev, CloneParams, LogicalVolume, Protocol, PtplProps, Share,
55
SnapshotParams, UpdateProps,
66
},
77
pool_backend::{
@@ -186,7 +186,14 @@ impl IPoolProps for Lvs {
186186
}
187187

188188
fn disks(&self) -> Vec<String> {
189-
vec![self.base_bdev().bdev_uri_str().unwrap_or_else(|| "".into())]
189+
// Calling crypto_base_bdev() on non crypto bdev returns None.
190+
let disk_bdev = self
191+
.base_bdev()
192+
.crypto_base_bdev()
193+
.map(Bdev::new)
194+
.unwrap_or_else(|| self.base_bdev());
195+
196+
vec![disk_bdev.bdev_uri_str().unwrap_or_else(|| "".into())]
190197
}
191198

192199
fn disk_capacity(&self) -> u64 {

0 commit comments

Comments
 (0)