aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxen
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libxen')
-rw-r--r--tools/libxen/include/xen/api/xen_xspolicy.h13
-rw-r--r--tools/libxen/src/xen_xspolicy.c18
2 files changed, 31 insertions, 0 deletions
diff --git a/tools/libxen/include/xen/api/xen_xspolicy.h b/tools/libxen/include/xen/api/xen_xspolicy.h
index 3ecdc4b54d..b0808f4d57 100644
--- a/tools/libxen/include/xen/api/xen_xspolicy.h
+++ b/tools/libxen/include/xen/api/xen_xspolicy.h
@@ -240,6 +240,19 @@ xen_xspolicy_set_xspolicy(xen_session *session, xen_xs_policystate **result,
bool overwrite);
+
+/**
+ * Attempt to reset the system's policy to the DEFAULT policy for the
+ * respective policy type. This is done by updating the system and therefore
+ * underlies the same restrictions of a policy update. This operation may
+ * for example fail if other domains than Domain-0 are running and have
+ * different labels than Domain-0.
+ */
+bool
+xen_xspolicy_reset_xspolicy(xen_session *session, xen_xs_policystate **result,
+ xs_type type);
+
+
/**
* Remove any policy from having the system booted with.
*/
diff --git a/tools/libxen/src/xen_xspolicy.c b/tools/libxen/src/xen_xspolicy.c
index ccafe1f4e8..e5f290c1a1 100644
--- a/tools/libxen/src/xen_xspolicy.c
+++ b/tools/libxen/src/xen_xspolicy.c
@@ -225,6 +225,24 @@ xen_xspolicy_set_xspolicy(xen_session *session, xen_xs_policystate **result,
bool
+xen_xspolicy_reset_xspolicy(xen_session *session, xen_xs_policystate **result,
+ xs_type type)
+{
+ abstract_value param_values[] =
+ {
+ { .type = &abstract_type_int,
+ .u.int_val = type },
+ };
+
+ abstract_type result_type = xen_xs_policystate_abstract_type_;
+
+ *result = NULL;
+ XEN_CALL_("XSPolicy.reset_xspolicy");
+ return session->ok;
+}
+
+
+bool
xen_xspolicy_get_xspolicy(xen_session *session, xen_xs_policystate **result)
{
abstract_value param_values[] =