oxenstored: Don't re-open a xenctrl handle for every domain introduction
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 3 Oct 2018 09:32:54 +0000 (10:32 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 4 Oct 2018 13:54:36 +0000 (14:54 +0100)
commit129025fe30934c6a04bbd9c05ade479d34ce4985
treeae12f0644390fa18891266c2e461e7ac99ad4e82
parentdf8601938a715d60f658dae2fea896ee57dc48fd
oxenstored: Don't re-open a xenctrl handle for every domain introduction

Currently, an xc handle is opened in main() which is used for cleanup
activities, and a new xc handle is temporarily opened every time a domain is
introduced.  This is inefficient, and amongst other things, requires full root
privileges for the lifetime of oxenstored.

All code using the Xenctrl handle is in domains.ml, so initialise xc as a
global (now happens just before main() is called) and drop it as a parameter
from Domains.create and Domains.cleanup.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
tools/ocaml/xenstored/domains.ml
tools/ocaml/xenstored/process.ml
tools/ocaml/xenstored/xenstored.ml