libxc: Provide access to internal handles
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 4 May 2018 15:00:42 +0000 (16:00 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 6 Jul 2018 15:27:52 +0000 (16:27 +0100)
commitdbb3c4d0a458f4bca91ec50ac81f5f7a739f8729
tree19aa482967343593d9abf52f8d2352bb0a9a007f
parent5403d8a4af0d381241a0d89747a42e3ce9fb570a
libxc: Provide access to internal handles

In order to support auditing of qemu depriv, my audit tool wants to
know the fd of a privcmd handle on which it can easily make
hypercalls.  xencall provides such a handle, but has no cooked
facilities for making hypercalls.  So I open a libxc handle.  That
means I need to get the privcmd fd out of the libxc handle.

ISTM that it is best to do this by providing an interface to get the
underlying library handles for a libxc handle.  This kind of interface
is quite common elsewhere and has not caused problems.

libxc is not a stable API so the downside risk of providing this
access is not significant.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
tools/libxc/include/xenctrl.h
tools/libxc/xc_private.c