aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2012-03-01 12:26:13 +0000
committerIan Campbell <ian.campbell@citrix.com>2012-03-01 12:26:13 +0000
commitb14793cc5f3714b1c6ead00008f5250404c48307 (patch)
treea4176b51ee42dd7fbd65ea4010f0f29204774006 /tools
parent5fc905880c021ebb6e2a346619f050def5933aba (diff)
downloadxen-b14793cc5f3714b1c6ead00008f5250404c48307.tar.gz
xen-b14793cc5f3714b1c6ead00008f5250404c48307.tar.bz2
xen-b14793cc5f3714b1c6ead00008f5250404c48307.zip
libxl: Remove xen/sched.h from public interface
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/libxl/libxl.h9
-rw-r--r--tools/libxl/libxl_types.idl15
-rw-r--r--tools/libxl/libxl_utils.c7
-rw-r--r--tools/libxl/xl_cmdimpl.c10
-rw-r--r--tools/python/xen/lowlevel/xl/xl.c10
5 files changed, 30 insertions, 21 deletions
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index d1110f4a23..f44f1de9b4 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -137,8 +137,6 @@
#include <xentoollog.h>
-#include <xen/sched.h>
-
#include <libxl_uuid.h>
#include <_libxl_list.h>
@@ -638,12 +636,7 @@ int libxl_cpupool_cpuremove(libxl_ctx *ctx, uint32_t poolid, int cpu);
int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid);
-static inline int libxl_domid_valid_guest(uint32_t domid)
-{
- /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
- * does not check whether the domain actually exists */
- return domid > 0 && domid < DOMID_FIRST_RESERVED;
-}
+int libxl_domid_valid_guest(uint32_t domid);
int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
uint32_t *ssidref);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 567e48d437..7f656ab926 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -113,6 +113,15 @@ libxl_scheduler = Enumeration("scheduler", [
(7, "arinc653"),
])
+# Consistent with SHUTDOWN_* in sched.h
+libxl_shutdown_reason = Enumeration("shutdown_reason", [
+ (0, "poweroff"),
+ (1, "reboot"),
+ (2, "suspend"),
+ (3, "crash"),
+ (4, "watchdog"),
+ ])
+
#
# Complex libxl types
#
@@ -156,11 +165,11 @@ libxl_dominfo = Struct("dominfo",[
("shutdown", bool),
("dying", bool),
- # Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying).
+ # Valid iff (shutdown||dying).
#
# Otherwise set to a value guaranteed not to clash with any valid
- # SHUTDOWN_* constant.
- ("shutdown_reason", uint8),
+ # LIBXL_SHUTDOWN_REASON_* constant.
+ ("shutdown_reason", libxl_shutdown_reason),
("current_memkb", uint64),
("shared_memkb", uint64),
("max_memkb", uint64),
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 227364cffe..a5b3c17f55 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -507,6 +507,13 @@ void libxl_cputopology_list_free(libxl_cputopology *list, int nr)
free(list);
}
+int libxl_domid_valid_guest(uint32_t domid)
+{
+ /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
+ * does not check whether the domain actually exists */
+ return domid > 0 && domid < DOMID_FIRST_RESERVED;
+}
+
/*
* Local variables:
* mode: C
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index b8b7b5452c..9bcc7fe24f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1235,19 +1235,19 @@ static int handle_domain_death(libxl_ctx *ctx, uint32_t domid,
libxl_action_on_shutdown action;
switch (event->u.domain_shutdown.shutdown_reason) {
- case SHUTDOWN_poweroff:
+ case LIBXL_SHUTDOWN_REASON_POWEROFF:
action = d_config->on_poweroff;
break;
- case SHUTDOWN_reboot:
+ case LIBXL_SHUTDOWN_REASON_REBOOT:
action = d_config->on_reboot;
break;
- case SHUTDOWN_suspend:
+ case LIBXL_SHUTDOWN_REASON_SUSPEND:
LOG("Domain has suspended.");
return 0;
- case SHUTDOWN_crash:
+ case LIBXL_SHUTDOWN_REASON_CRASH:
action = d_config->on_crash;
break;
- case SHUTDOWN_watchdog:
+ case LIBXL_SHUTDOWN_REASON_WATCHDOG:
action = d_config->on_watchdog;
break;
default:
diff --git a/tools/python/xen/lowlevel/xl/xl.c b/tools/python/xen/lowlevel/xl/xl.c
index 625891a6bc..48a828645a 100644
--- a/tools/python/xen/lowlevel/xl/xl.c
+++ b/tools/python/xen/lowlevel/xl/xl.c
@@ -762,11 +762,11 @@ PyMODINIT_FUNC initxl(void)
Py_INCREF(xl_error_obj);
PyModule_AddObject(m, "Error", xl_error_obj);
- _INT_CONST(m, SHUTDOWN_poweroff);
- _INT_CONST(m, SHUTDOWN_reboot);
- _INT_CONST(m, SHUTDOWN_suspend);
- _INT_CONST(m, SHUTDOWN_crash);
- _INT_CONST(m, SHUTDOWN_watchdog);
+ _INT_CONST_LIBXL(m, SHUTDOWN_REASON_POWEROFF);
+ _INT_CONST_LIBXL(m, SHUTDOWN_REASON_REBOOT);
+ _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SUSPEND);
+ _INT_CONST_LIBXL(m, SHUTDOWN_REASON_CRASH);
+ _INT_CONST_LIBXL(m, SHUTDOWN_REASON_WATCHDOG);
genwrap__init(m);
}