[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 02 of 27 V4] libxl: Remove xen/sched.h from public interface
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxx> # Date 1330533035 0 # Node ID 84a2d39f711e439952cdc3fd0b0a9a065dae2c5c # Parent 81854ea73a132154021df881c58aff6f870a4384 libxl: Remove xen/sched.h from public interface Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> diff -r 81854ea73a13 -r 84a2d39f711e tools/libxl/libxl.h --- a/tools/libxl/libxl.h Wed Feb 29 16:30:35 2012 +0000 +++ b/tools/libxl/libxl.h Wed Feb 29 16:30:35 2012 +0000 @@ -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 *c 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 -r 81854ea73a13 -r 84a2d39f711e tools/libxl/libxl_types.idl --- a/tools/libxl/libxl_types.idl Wed Feb 29 16:30:35 2012 +0000 +++ b/tools/libxl/libxl_types.idl Wed Feb 29 16:30:35 2012 +0000 @@ -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 -r 81854ea73a13 -r 84a2d39f711e tools/libxl/libxl_utils.c --- a/tools/libxl/libxl_utils.c Wed Feb 29 16:30:35 2012 +0000 +++ b/tools/libxl/libxl_utils.c Wed Feb 29 16:30:35 2012 +0000 @@ -507,6 +507,13 @@ void libxl_cputopology_list_free(libxl_c 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 -r 81854ea73a13 -r 84a2d39f711e tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Wed Feb 29 16:30:35 2012 +0000 +++ b/tools/libxl/xl_cmdimpl.c Wed Feb 29 16:30:35 2012 +0000 @@ -1235,19 +1235,19 @@ static int handle_domain_death(libxl_ctx 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 -r 81854ea73a13 -r 84a2d39f711e tools/python/xen/lowlevel/xl/xl.c --- a/tools/python/xen/lowlevel/xl/xl.c Wed Feb 29 16:30:35 2012 +0000 +++ b/tools/python/xen/lowlevel/xl/xl.c Wed Feb 29 16:30:35 2012 +0000 @@ -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); } _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |