WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] CP-1625: Xapi interface to xen-cmdline script

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] CP-1625: Xapi interface to xen-cmdline script
From: Rob Hoes <rob.hoes@xxxxxxxxxx>
Date: Tue, 16 Feb 2010 23:11:18 +0000
Delivery-date: Tue, 16 Feb 2010 15:11:49 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
CP-1625: Xapi interface to xen-cmdline script

This interface is used to view, set and remove the CPU feature masks applied by 
Xen in the next boot.

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r c1e01ad7272e ocaml/xapi/OMakefile
--- a/ocaml/xapi/OMakefile      Tue Feb 16 10:53:29 2010 +0000
+++ b/ocaml/xapi/OMakefile      Tue Feb 16 21:41:09 2010 +0000
@@ -231,7 +231,8 @@
        ../license/v6client \
        bios_strings \
        xapi_config \
-       ../license/grace_retry
+       ../license/grace_retry \
+       xen_cmdline
 
 OCamlProgram(xapi, $(XAPI_MODULES))
 OCamlDocProgram(xapi, $(XAPI_MODULES))
diff -r c1e01ad7272e ocaml/xapi/xen_cmdline.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/ocaml/xapi/xen_cmdline.ml Tue Feb 16 21:41:09 2010 +0000
@@ -0,0 +1,32 @@
+(*
+ * Copyright (C) 2006-2009 Citrix Systems Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+let xen_cmdline_script = "/opt/xensource/libexec/xen-cmdline"
+
+let call_script args = 
+       try
+               let out, _ = Forkhelpers.execute_command_get_output 
xen_cmdline_script args in
+               out
+       with 
+       | Forkhelpers.Spawn_internal_error(stderr, stdout, Unix.WEXITED n) ->
+               failwith "Error while calling xen-cmdline script"
+               
+let list_cpuid_masks () =
+       call_script ["--list-cpuid-masks"]
+
+let set_cpuid_masks masks =
+       call_script ("--set-cpuid-masks" :: (List.map (fun (k,v) -> k ^ "=" ^ 
v) masks))
+       
+let delete_cpuid_masks masks =
+       List.map (fun mask -> call_script ("--delete-cpuid-masks" :: [mask])) 
masks

Attachment: xen-cmdline
Description: Text document

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] CP-1625: Xapi interface to xen-cmdline script, Rob Hoes <=