From 18dd9f7fc27fbe3c802c4e8f7e8ac3150eb7d624 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Mon, 10 Aug 2015 09:00:19 +0100 Subject: [PATCH] oxenstored: move sd_notify_ready out of main loop Oxenstored only needs to notify systemd its readiness state once. Move sd_notify_ready out of main loop. Signed-off-by: Wei Liu Acked-by: Dave Scott Tested-by: Andrew Cooper --- tools/ocaml/xenstored/xenstored.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ocaml/xenstored/xenstored.ml b/tools/ocaml/xenstored/xenstored.ml index f4840247b6..42b8183d4d 100644 --- a/tools/ocaml/xenstored/xenstored.ml +++ b/tools/ocaml/xenstored/xenstored.ml @@ -428,11 +428,11 @@ let _ = process_domains store cons domains in + if Systemd.launched_by_systemd () then + Systemd.sd_notify_ready (); while not !quit do try - if Systemd.launched_by_systemd() then - Systemd.sd_notify_ready (); main_loop () with exc -> error "caught exception %s" (Printexc.to_string exc); -- 2.30.2