Skip to content

Commit

Permalink
nydus-image inspect -R support mapped_block_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
Xin Yin committed Jul 18, 2023
1 parent 239902b commit 0a236ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bin/nydus-image/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,16 @@ impl RafsInspector {
let mut value = json!([]);
for blob_info in blob_infos.iter() {
if self.request_mode {
let mapped_blkaddr = extra_infos
.get(&blob_info.blob_id())
.map(|v| v.mapped_blkaddr)
.unwrap_or_default();
let v = json!({"blob_id": blob_info.blob_id(),
"readahead_offset": blob_info.prefetch_offset(),
"readahead_size": blob_info.prefetch_size(),
"decompressed_size": blob_info.uncompressed_size(),
"compressed_size": blob_info.compressed_size(),});
"compressed_size": blob_info.compressed_size(),
"mapped_block_address": mapped_blkaddr});
value.as_array_mut().unwrap().push(v);
} else {
let mapped_blkaddr = extra_infos
Expand Down

0 comments on commit 0a236ad

Please sign in to comment.