-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prints an existing VMSA binary file as json. Using json for output lets us use existing json processing tools for any diff or analysis or reformatting. The downside is the json pretty printer is not too pretty with our big reserved* arrays. The json field names match the internal Vmsa stuct field names, so any change there will change the `show` output. I think this is fine, since the kernel Vmsa structure can change on us anyways, so `vmsa show` may not be stable across sevctl versions anyways. Signed-off-by: Cole Robinson <crobinso@redhat.com>
- Loading branch information
1 parent
503756b
commit f11015f
Showing
7 changed files
with
1,290 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use crate::{Vmsa, VmsaShowCmdArgs}; | ||
|
||
pub fn cmd(args: VmsaShowCmdArgs) -> super::Result<()> { | ||
let vmsa = Vmsa::from_file(&args.filename)?; | ||
|
||
println!("{}", serde_json::to_string_pretty(&vmsa).unwrap()); | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.