aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_private.h
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:46 +0000
committerIan Campbell <ian.campbell@citrix.com>2010-12-03 09:36:46 +0000
commit02e4f47747e6198c834017e5038fa6bf98a0cfeb (patch)
treee186d387ef6632056c5e55a9750a6e9f3987c0c4 /tools/libxc/xc_private.h
parent94705cc4bfe4d9d749d86f49045f62ed9e48a0bc (diff)
downloadxen-02e4f47747e6198c834017e5038fa6bf98a0cfeb.tar.gz
xen-02e4f47747e6198c834017e5038fa6bf98a0cfeb.tar.bz2
xen-02e4f47747e6198c834017e5038fa6bf98a0cfeb.zip
libxc: osdep: add framework for abstracting access to dom0 OS hypervisor interfaces.
This patch introduces the basic infrastructure and uses it for open and close operations on privcmd, evtchn and gnttab devices. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/libxc/xc_private.h')
-rw-r--r--tools/libxc/xc_private.h22
1 files changed, 6 insertions, 16 deletions
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 8f3b2a2d0d..ccd1605288 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -30,6 +30,7 @@
#include <sys/ioctl.h>
#include "xenctrl.h"
+#include "xenctrlosdep.h"
#include <xen/sys/privcmd.h>
@@ -65,14 +66,8 @@
*/
#define MAX_PAGECACHE_USAGE (4*1024)
-enum xc_interface_type {
- XC_INTERFACE_PRIVCMD,
- XC_INTERFACE_EVTCHN,
- XC_INTERFACE_GNTTAB,
-};
-
struct xc_interface_core {
- enum xc_interface_type type;
+ enum xc_osdep_type type;
int fd;
int flags;
xentoollog_logger *error_handler, *error_handler_tofree;
@@ -80,6 +75,10 @@ struct xc_interface_core {
struct xc_error last_error; /* for xc_get_last_error */
FILE *dombuild_logger_file;
const char *currently_progress_reporting;
+
+ xc_osdep_info_t osdep;
+ xc_osdep_ops *ops; /* backend operations */
+ xc_osdep_handle ops_handle; /* opaque data for xc_osdep_ops */
};
void xc_report_error(xc_interface *xch, int code, const char *fmt, ...);
@@ -264,15 +263,6 @@ static inline int do_sysctl(xc_interface *xch, struct xen_sysctl *sysctl)
int do_memory_op(xc_interface *xch, int cmd, void *arg, size_t len);
-int xc_interface_open_core(struct xc_interface_core *xch); /* returns fd, logs errors */
-int xc_interface_close_core(struct xc_interface_core *xch); /* no logging */
-
-int xc_evtchn_open_core(struct xc_interface_core *xce); /* returns fd, logs errors */
-int xc_evtchn_close_core(struct xc_interface_core *xce); /* no logging */
-
-int xc_gnttab_open_core(struct xc_interface_core *xcg); /* returns fd, logs errors */
-int xc_gnttab_close_core(struct xc_interface_core *xcg); /* no logging */
-
void *xc_map_foreign_ranges(xc_interface *xch, uint32_t dom,
size_t size, int prot, size_t chunksize,
privcmd_mmap_entry_t entries[], int nentries);