]> xenbits.xensource.com Git - xen.git/commit
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)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 17 May 2019 16:00:42 +0000 (17:00 +0100)
commit50c382310ef800a168c94cd417ebb7a504411558
tree0b70481794171c1300047ca08294b73e6ad6582f
parentedbe12140d621003afd44b1516125b64308117c9
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>
(cherry picked from commit 129025fe30934c6a04bbd9c05ade479d34ce4985)
tools/ocaml/xenstored/domains.ml
tools/ocaml/xenstored/process.ml
tools/ocaml/xenstored/xenstored.ml