Skip to content

Commit

Permalink
Print devices only instead of the whole manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
reynir committed Nov 20, 2024
1 parent 2ae9939 commit 4156297
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/vmm_unix.ml
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,18 @@ let equal_string_lists b1 b2 err =

let devices_match ~bridges ~block_devices mft =
let (manifest_block, manifest_net) = solo5_image_devices mft in
let pp_entry ppf = function
| Solo5_elftool.Dev_block_basic name -> Fmt.pf ppf "block %S" name
| Solo5_elftool.Dev_net_basic name -> Fmt.pf ppf "net %S" name
in
let* () =
equal_string_lists manifest_block block_devices
(Format.asprintf "specified block device(s) does not match with manifest. Declared manifest: %a"
Solo5_elftool.pp_mft mft)
(Fmt.str "specified block device(s) does not match with manifest. Declared devices: %a"
Fmt.(list ~sep:(any ", ") pp_entry) mft.entries)
in
equal_string_lists manifest_net bridges
(Format.asprintf "specified bridge(s) does not match with the manifest. Declared manifest: %a"
Solo5_elftool.pp_mft mft)
(Fmt.str "specified bridge(s) does not match with the manifest. Declared devices: %a"
Fmt.(list ~sep:(any ", ") pp_entry) mft.entries)

let manifest_devices_match ~bridges ~block_devices image =
let* mft = Solo5_elftool.query_manifest (owee_buf_of_str image) in
Expand Down

0 comments on commit 4156297

Please sign in to comment.