From 834ea533204d5dd13618e88040598d0fe5701e36 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Thu, 5 Sep 2024 11:05:03 +0200 Subject: [PATCH] dump state when policy was added or removed --- src/vmm_vmmd.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vmm_vmmd.ml b/src/vmm_vmmd.ml index 5275254..d12cbfa 100644 --- a/src/vmm_vmmd.ml +++ b/src/vmm_vmmd.ml @@ -259,7 +259,9 @@ let handle_policy_cmd t id = | `Policy_remove -> Logs.debug (fun m -> m "remove policy %a" Name.pp id) ; let* resources = Vmm_resources.remove_policy t.resources path in - Ok ({ t with resources }, `End (`Success (`String "removed policy"))) + let t = { t with resources } in + dump_state t ; + Ok (t, `End (`Success (`String "removed policy"))) | `Policy_add policy -> Logs.debug (fun m -> m "insert policy %a" Name.pp id) ; let same_policy = match Vmm_resources.find_policy t.resources path with @@ -270,7 +272,9 @@ let handle_policy_cmd t id = Ok (t, `Loop (`Success (`String "no modification of policy"))) else let* resources = Vmm_resources.insert_policy t.resources path policy in - Ok ({ t with resources }, `Loop (`Success (`String "added policy"))) + let t = { t with resources } in + dump_state t ; + Ok (t, `Loop (`Success (`String "added policy"))) | `Policy_info -> Logs.debug (fun m -> m "policy %a" Name.pp id) ; let policies =