From 69ebd8c13fe8efc5b5e7e6d0981401635524a7b2 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Tue, 7 May 2024 13:47:46 +0200 Subject: [PATCH] use ohex instead of hex --- albatross.opam | 2 +- client/albatross_client.ml | 2 +- src/dune | 2 +- src/vmm_core.ml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/albatross.opam b/albatross.opam index 43500dc3..fe4679b8 100644 --- a/albatross.opam +++ b/albatross.opam @@ -34,7 +34,7 @@ depends: [ "metrics-lwt" {>= "0.2.0"} "metrics-influx" {>= "0.2.0"} "metrics-rusage" - "hex" + "ohex" {>= "0.2.0"} "http-lwt-client" {>= "0.2.0"} "happy-eyeballs-lwt" "solo5-elftool" {>= "0.3"} diff --git a/client/albatross_client.ml b/client/albatross_client.ml index 821ccaea..5a868286 100644 --- a/client/albatross_client.ml +++ b/client/albatross_client.ml @@ -137,7 +137,7 @@ let prepare_update ~happy_eyeballs level host dryrun = function | Ok (_hdr, `Success (`Unikernel_info [ _name, Vmm_core.Unikernel.{ digest ; bridges ; block_devices ; argv ; cpuid ; memory ; fail_behaviour ; typ = `Solo5 as typ ; _ } ])) -> begin - let `Hex hash = Hex.of_cstruct digest in + let hash = Ohex.encode (Cstruct.to_string digest) in can_update ~happy_eyeballs host hash >>= function | Error `Msg msg -> Logs.err (fun m -> m "error in HTTP interaction: %s" msg); diff --git a/src/dune b/src/dune index e2e7b8b6..67ef4d87 100644 --- a/src/dune +++ b/src/dune @@ -7,7 +7,7 @@ (modules vmm_core vmm_commands vmm_compress vmm_trie vmm_trie vmm_ring vmm_asn vmm_resources) (libraries logs ipaddr ptime duration cstruct bigstringaf decompress.de decompress.zl asn1-combinators fpath - metrics mirage-crypto hex)) + metrics mirage-crypto ohex)) (library (name albatross_unix) diff --git a/src/vmm_core.ml b/src/vmm_core.ml index d09e4cbb..953660be 100644 --- a/src/vmm_core.ml +++ b/src/vmm_core.ml @@ -370,7 +370,7 @@ module Unikernel = struct } let pp ppf vm = - let `Hex hex_digest = Hex.of_cstruct vm.digest in + let hex_digest = Ohex.encode (Cstruct.to_string vm.digest) in Fmt.pf ppf "pid %d@ taps %a (block %a) cmdline %a digest %s" vm.pid Fmt.(list ~sep:(any ", ") string) vm.taps @@ -397,7 +397,7 @@ module Unikernel = struct bridges = cfg.bridges ; argv = cfg.argv ; digest = t.digest ; started = t.started } let pp_info ppf (info : info) = - let `Hex hex_digest = Hex.of_cstruct info.digest in + let hex_digest = Ohex.encode (Cstruct.to_string info.digest) in Fmt.pf ppf "typ %a@ started %a@ fail behaviour %a@ cpu %d@ %d MB memory@ block devices %a@ bridge %a@ digest %s" pp_typ info.typ (Ptime.pp_rfc3339 ()) info.started