|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxl: Remove xen/sched.h from public interface
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1330604773 0
# Node ID b8f2b17e897b013e5715b47872ae360371f10034
# Parent ba05ea3bf452ac9c5bb78f86f99ead38d581e590
libxl: Remove xen/sched.h from public interface
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
diff -r ba05ea3bf452 -r b8f2b17e897b tools/libxl/libxl.h
--- a/tools/libxl/libxl.h Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h Thu Mar 01 12:26:13 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_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 ba05ea3bf452 -r b8f2b17e897b tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_types.idl Thu Mar 01 12:26:13 2012 +0000
@@ -113,6 +113,15 @@
(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 @@
("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 ba05ea3bf452 -r b8f2b17e897b tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_utils.c Thu Mar 01 12:26:13 2012 +0000
@@ -507,6 +507,13 @@
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 ba05ea3bf452 -r b8f2b17e897b tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c Thu Mar 01 12:26:13 2012 +0000
@@ -1235,19 +1235,19 @@
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 ba05ea3bf452 -r b8f2b17e897b tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c Thu Mar 01 12:26:13 2012 +0000
@@ -762,11 +762,11 @@
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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |