[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tools: ocaml: lay ground work for auto generating xl datatypes.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1303315988 -3600
# Node ID 24da3ce526fec84020891ffc4fd2498c263f42ca
# Parent  f026866216ece1a72b5a17e31a5fbef0c65358b0
tools: ocaml: lay ground work for auto generating xl datatypes.

Doesn't actually generate anything yet but puts all the moving parts
into place. In particular sets up the
xl.ml.in+_libxl_types.ml.in->xl.ml transformation using sed. This
appears to be the only/best way to do this for ocaml due to the lack
of a preprocessor and/or an include mechanism which has an inmpact on
namespacing.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r f026866216ec -r 24da3ce526fe .hgignore
--- a/.hgignore Wed Apr 20 17:13:08 2011 +0100
+++ b/.hgignore Wed Apr 20 17:13:08 2011 +0100
@@ -295,6 +295,11 @@
 ^tools/ocaml/.*/.*\.cmx?a$
 ^tools/ocaml/.*/META$
 ^tools/ocaml/.*/\.ocamldep\.make$
+^tools/ocaml/libs/xl/_libxl_types\.ml\.in$
+^tools/ocaml/libs/xl/_libxl_types\.mli\.in$
+^tools/ocaml/libs/xl/_libxl_types\.inc$
+^tools/ocaml/libs/xl/xl\.ml$
+^tools/ocaml/libs/xl/xl\.mli$
 ^tools/ocaml/xenstored/oxenstored$
 ^xen/\.banner.*$
 ^xen/BLOG$
diff -r f026866216ec -r 24da3ce526fe tools/ocaml/libs/xl/Makefile
--- a/tools/ocaml/libs/xl/Makefile      Wed Apr 20 17:13:08 2011 +0100
+++ b/tools/ocaml/libs/xl/Makefile      Wed Apr 20 17:13:08 2011 +0100
@@ -15,8 +15,36 @@
 
 OCAML_LIBRARY = xl
 
+GENERATED_FILES += xl.ml xl.mli
+GENERATED_FILES += _libxl_types.ml.in _libxl_types.mli.in
+GENERATED_FILES += _libxl_types.inc
+
 all: $(INTF) $(LIBS)
 
+xl.ml: xl.ml.in _libxl_types.ml.in
+       $(Q)sed -e '1i(*\
+ * AUTO-GENERATED FILE DO NOT EDIT\
+ * Generated from xl.ml.in and _libxl_types.ml.in\
+ *)\
+' \
+           -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.ml.in' \
+         < xl.ml.in > xl.ml
+
+xl.mli: xl.mli.in _libxl_types.mli.in
+       $(Q)sed -e '1i(*\
+ * AUTO-GENERATED FILE DO NOT EDIT\
+ * Generated from xl.mli.in and _libxl_types.mli.in\
+ *)\
+' \
+           -e '/^(\* @@LIBXL_TYPES@@ \*)$$/r_libxl_types.mli.in' \
+         < xl.mli.in > xl.mli
+
+_libxl_types.ml.in _libxl_types.mli.in _libxl_types.inc: genwrap.py 
$(XEN_ROOT)/tools/libxl/libxl.idl \
+                $(XEN_ROOT)/tools/libxl/libxltypes.py
+       PYTHONPATH=$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \
+               $(XEN_ROOT)/tools/libxl/libxl.idl \
+               _libxl_types.mli.in _libxl_types.ml.in _libxl_types.inc
+
 libs: $(LIBS)
 
 .PHONY: install
diff -r f026866216ec -r 24da3ce526fe tools/ocaml/libs/xl/genwrap.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py    Wed Apr 20 17:13:08 2011 +0100
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+
+import sys,os
+
+import libxltypes
+
+def autogen_header(open_comment, close_comment):
+    s = open_comment + " AUTO-GENERATED FILE DO NOT EDIT " + close_comment + 
"\n"
+    s += open_comment + " autogenerated by \n"
+    s += reduce(lambda x,y: x + " ", range(len(open_comment + " ")), "")
+    s += "%s" % " ".join(sys.argv)
+    s += "\n " + close_comment + "\n\n"
+    return s
+
+if __name__ == '__main__':
+    if len(sys.argv) < 4:
+        print >>sys.stderr, "Usage: genwrap.py <idl> <mli> <ml> <c-inc>"
+        sys.exit(1)
+
+    idl = sys.argv[1]
+    (_,types) = libxltypes.parse(idl)
+
+    
+    _ml = sys.argv[3]
+    ml = open(_ml, 'w')
+    ml.write(autogen_header("(*", "*)"))
+
+    _mli = sys.argv[2]
+    mli = open(_mli, 'w')
+    mli.write(autogen_header("(*", "*)"))
+    
+    _cinc = sys.argv[4]
+    cinc = open(_cinc, 'w')
+    cinc.write(autogen_header("/*", "*/"))
+
+    # TODO: autogenerate something
+
+    ml.write("(* END OF AUTO-GENERATED CODE *)\n")
+    ml.close()
+    mli.write("(* END OF AUTO-GENERATED CODE *)\n")
+    mli.close()
+    cinc.close()
diff -r f026866216ec -r 24da3ce526fe tools/ocaml/libs/xl/xl.ml
--- a/tools/ocaml/libs/xl/xl.ml Wed Apr 20 17:13:08 2011 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-(*
- * Copyright (C) 2009-2011 Citrix Ltd.
- * Author Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
- *
- * 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.
- *)
-
-exception Error of string
-
-type domid = int
-
-type console_type =
-       | CONSOLETYPE_XENCONSOLED
-       | CONSOLETYPE_IOEMU
-
-type disk_phystype =
-       | PHYSTYPE_QCOW
-       | PHYSTYPE_QCOW2
-       | PHYSTYPE_VHD
-       | PHYSTYPE_AIO
-       | PHYSTYPE_FILE
-       | PHYSTYPE_PHY
-
-type nic_type =
-       | NICTYPE_IOEMU
-       | NICTYPE_VIF
-
-type button =
-       | Button_Power
-       | Button_Sleep
-
-module Device_vfb = struct
-       type t =
-       {
-               backend_domid : domid;
-               devid : int;
-               vnc : bool;
-               vnclisten : string;
-               vncpasswd : string;
-               vncdisplay : int;
-               vncunused : bool;
-               keymap : string;
-               sdl : bool;
-               opengl : bool;
-               display : string;
-               xauthority : string;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_vfb_add"
-       external clean_shutdown : domid -> unit = 
"stub_xl_device_vfb_clean_shutdown"
-       external hard_shutdown : domid -> unit = 
"stub_xl_device_vfb_hard_shutdown"
-end
-
-module Device_vkb = struct
-       type t =
-       {
-               backend_domid : domid;
-               devid : int;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_vkb_add"
-       external clean_shutdown : domid -> unit = 
"stub_xl_device_vkb_clean_shutdown"
-       external hard_shutdown : domid -> unit = 
"stub_xl_device_vkb_hard_shutdown"
-end
-
-module Device_console = struct
-       type t =
-       {
-               backend_domid : domid;
-               devid : int;
-               consoletype : console_type;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_console_add"
-end
-
-module Device_disk = struct
-       type t =
-       {
-               backend_domid : domid;
-               physpath : string;
-               phystype : disk_phystype;
-               virtpath : string;
-               unpluggable : bool;
-               readwrite : bool;
-               is_cdrom : bool;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_disk_add"
-       external del : t -> domid -> unit = "stub_xl_device_disk_del"
-end
-
-module Device_nic = struct
-       type t =
-       {
-               backend_domid : domid;
-               devid : int;
-               mtu : int;
-               model : string;
-               mac : int array;
-               bridge : string;
-               ifname : string;
-               script : string;
-               nictype : nic_type;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_nic_add"
-       external del : t -> domid -> unit = "stub_xl_device_nic_del"
-end
-
-module Device_pci = struct
-       type t =
-       {
-               func : int;
-               dev : int;
-               bus : int;
-               domain : int;
-               vdevfn : int;
-               msitranslate : bool;
-               power_mgmt : bool;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_pci_add"
-       external remove : t -> domid -> unit = "stub_xl_device_pci_remove"
-       external shutdown : domid -> unit = "stub_xl_device_pci_shutdown"
-end
-
-module Physinfo = struct
-       type t =
-       {
-               threads_per_core : int;
-               cores_per_socket : int;
-               max_cpu_id : int;
-               nr_cpus : int;
-               cpu_khz : int;
-               total_pages : int64;
-               free_pages : int64;
-               scrub_pages : int64;
-               nr_nodes : int;
-               hwcap : int32 array;
-               physcap : int32;
-       }
-       external get : unit -> t = "stub_xl_physinfo"
-
-end
-
-module Sched_credit = struct
-       type t =
-       {
-               weight : int;
-               cap : int;
-       }
-       external domain_get : domid -> t = "stub_xl_sched_credit_domain_get"
-       external domain_set : domid -> t -> unit = 
"stub_xl_sched_credit_domain_set"
-end
-
-module Topologyinfo = struct
-       type t =
-       {
-               core : int;
-               socket : int;
-               node : int;
-       }
-       external get : unit -> t = "stub_xl_topologyinfo"
-end
-
-external button_press : domid -> button -> unit = "stub_xl_button_press"
-
-
-external send_trigger : domid -> string -> int -> unit = "stub_xl_send_trigger"
-external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
-external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"
-
-let _ = Callback.register_exception "xl.error" (Error "register_callback")
diff -r f026866216ec -r 24da3ce526fe tools/ocaml/libs/xl/xl.ml.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xl/xl.ml.in      Wed Apr 20 17:13:08 2011 +0100
@@ -0,0 +1,178 @@
+(*
+ * Copyright (C) 2009-2011 Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
+ *
+ * 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.
+ *)
+
+exception Error of string
+
+type domid = int
+
+(* @@LIBXL_TYPES@@ *)
+
+type console_type =
+       | CONSOLETYPE_XENCONSOLED
+       | CONSOLETYPE_IOEMU
+
+type disk_phystype =
+       | PHYSTYPE_QCOW
+       | PHYSTYPE_QCOW2
+       | PHYSTYPE_VHD
+       | PHYSTYPE_AIO
+       | PHYSTYPE_FILE
+       | PHYSTYPE_PHY
+
+type nic_type =
+       | NICTYPE_IOEMU
+       | NICTYPE_VIF
+
+type button =
+       | Button_Power
+       | Button_Sleep
+
+module Device_vfb = struct
+       type t =
+       {
+               backend_domid : domid;
+               devid : int;
+               vnc : bool;
+               vnclisten : string;
+               vncpasswd : string;
+               vncdisplay : int;
+               vncunused : bool;
+               keymap : string;
+               sdl : bool;
+               opengl : bool;
+               display : string;
+               xauthority : string;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_vfb_add"
+       external clean_shutdown : domid -> unit = 
"stub_xl_device_vfb_clean_shutdown"
+       external hard_shutdown : domid -> unit = 
"stub_xl_device_vfb_hard_shutdown"
+end
+
+module Device_vkb = struct
+       type t =
+       {
+               backend_domid : domid;
+               devid : int;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_vkb_add"
+       external clean_shutdown : domid -> unit = 
"stub_xl_device_vkb_clean_shutdown"
+       external hard_shutdown : domid -> unit = 
"stub_xl_device_vkb_hard_shutdown"
+end
+
+module Device_console = struct
+       type t =
+       {
+               backend_domid : domid;
+               devid : int;
+               consoletype : console_type;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_console_add"
+end
+
+module Device_disk = struct
+       type t =
+       {
+               backend_domid : domid;
+               physpath : string;
+               phystype : disk_phystype;
+               virtpath : string;
+               unpluggable : bool;
+               readwrite : bool;
+               is_cdrom : bool;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_disk_add"
+       external del : t -> domid -> unit = "stub_xl_device_disk_del"
+end
+
+module Device_nic = struct
+       type t =
+       {
+               backend_domid : domid;
+               devid : int;
+               mtu : int;
+               model : string;
+               mac : int array;
+               bridge : string;
+               ifname : string;
+               script : string;
+               nictype : nic_type;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_nic_add"
+       external del : t -> domid -> unit = "stub_xl_device_nic_del"
+end
+
+module Device_pci = struct
+       type t =
+       {
+               func : int;
+               dev : int;
+               bus : int;
+               domain : int;
+               vdevfn : int;
+               msitranslate : bool;
+               power_mgmt : bool;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_pci_add"
+       external remove : t -> domid -> unit = "stub_xl_device_pci_remove"
+       external shutdown : domid -> unit = "stub_xl_device_pci_shutdown"
+end
+
+module Physinfo = struct
+       type t =
+       {
+               threads_per_core : int;
+               cores_per_socket : int;
+               max_cpu_id : int;
+               nr_cpus : int;
+               cpu_khz : int;
+               total_pages : int64;
+               free_pages : int64;
+               scrub_pages : int64;
+               nr_nodes : int;
+               hwcap : int32 array;
+               physcap : int32;
+       }
+       external get : unit -> t = "stub_xl_physinfo"
+
+end
+
+module Sched_credit = struct
+       type t =
+       {
+               weight : int;
+               cap : int;
+       }
+       external domain_get : domid -> t = "stub_xl_sched_credit_domain_get"
+       external domain_set : domid -> t -> unit = 
"stub_xl_sched_credit_domain_set"
+end
+
+module Topologyinfo = struct
+       type t =
+       {
+               core : int;
+               socket : int;
+               node : int;
+       }
+       external get : unit -> t = "stub_xl_topologyinfo"
+end
+
+external button_press : domid -> button -> unit = "stub_xl_button_press"
+
+
+external send_trigger : domid -> string -> int -> unit = "stub_xl_send_trigger"
+external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
+external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"
+
+let _ = Callback.register_exception "xl.error" (Error "register_callback")
diff -r f026866216ec -r 24da3ce526fe tools/ocaml/libs/xl/xl.mli
--- a/tools/ocaml/libs/xl/xl.mli        Wed Apr 20 17:13:08 2011 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-(*
- * Copyright (C) 2009-2011 Citrix Ltd.
- * Author Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
- *
- * 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.
- *)
-
-exception Error of string
-
-type domid = int
-
-type console_type =
-       | CONSOLETYPE_XENCONSOLED
-       | CONSOLETYPE_IOEMU
-
-type disk_phystype =
-       | PHYSTYPE_QCOW
-       | PHYSTYPE_QCOW2
-       | PHYSTYPE_VHD
-       | PHYSTYPE_AIO
-       | PHYSTYPE_FILE
-       | PHYSTYPE_PHY
-
-type nic_type =
-       | NICTYPE_IOEMU
-       | NICTYPE_VIF
-
-type button =
-       | Button_Power
-       | Button_Sleep
-
-module Device_vfb : sig
-       type t =
-       {
-               backend_domid : domid;
-               devid : int;
-               vnc : bool;
-               vnclisten : string;
-               vncpasswd : string;
-               vncdisplay : int;
-               vncunused : bool;
-               keymap : string;
-               sdl : bool;
-               opengl : bool;
-               display : string;
-               xauthority : string;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_vfb_add"
-       external clean_shutdown : domid -> unit = 
"stub_xl_device_vfb_clean_shutdown"
-       external hard_shutdown : domid -> unit = 
"stub_xl_device_vfb_hard_shutdown"
-end
-
-module Device_vkb : sig
-       type t =
-       {
-               backend_domid : domid;
-               devid : int;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_vkb_add"
-       external clean_shutdown : domid -> unit = 
"stub_xl_device_vkb_clean_shutdown"
-       external hard_shutdown : domid -> unit = 
"stub_xl_device_vkb_hard_shutdown"
-end
-
-module Device_console : sig
-       type t =
-       {
-               backend_domid : domid;
-               devid : int;
-               consoletype : console_type;
-       }
-
-       external add : t -> domid -> unit = "stub_xl_device_console_add"
-end
-
-module Device_disk : sig
-       type t =
-       {
-               backend_domid : domid;
-               physpath : string;
-               phystype : disk_phystype;
-               virtpath : string;
-               unpluggable : bool;
-               readwrite : bool;
-               is_cdrom : bool;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_disk_add"
-       external del : t -> domid -> unit = "stub_xl_device_disk_del"
-end
-
-module Device_nic : sig
-       type t =
-       {
-               backend_domid : domid;
-               devid : int;
-               mtu : int;
-               model : string;
-               mac : int array;
-               bridge : string;
-               ifname : string;
-               script : string;
-               nictype : nic_type;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_nic_add"
-       external del : t -> domid -> unit = "stub_xl_device_nic_del"
-end
-
-module Device_pci : sig
-       type t =
-       {
-               func : int;
-               dev : int;
-               bus : int;
-               domain : int;
-               vdevfn : int;
-               msitranslate : bool;
-               power_mgmt : bool;
-       }
-       external add : t -> domid -> unit = "stub_xl_device_pci_add"
-       external remove : t -> domid -> unit = "stub_xl_device_pci_remove"
-       external shutdown : domid -> unit = "stub_xl_device_pci_shutdown"
-end
-
-module Physinfo : sig
-       type t =
-       {
-               threads_per_core : int;
-               cores_per_socket : int;
-               max_cpu_id : int;
-               nr_cpus : int;
-               cpu_khz : int;
-               total_pages : int64;
-               free_pages : int64;
-               scrub_pages : int64;
-               nr_nodes : int;
-               hwcap : int32 array;
-               physcap : int32;
-       }
-       external get : unit -> t = "stub_xl_physinfo"
-end
-
-module Sched_credit : sig
-       type t =
-       {
-               weight : int;
-               cap : int;
-       }
-       external domain_get : domid -> t = "stub_xl_sched_credit_domain_get"
-       external domain_set : domid -> t -> unit = 
"stub_xl_sched_credit_domain_set"
-end
-
-module Topologyinfo : sig
-       type t =
-       {
-               core : int;
-               socket : int;
-               node : int;
-       }
-       external get : unit -> t = "stub_xl_topologyinfo"
-end
-
-external button_press : domid -> button -> unit = "stub_xl_button_press"
-
-external send_trigger : domid -> string -> int -> unit = "stub_xl_send_trigger"
-external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
-external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"
diff -r f026866216ec -r 24da3ce526fe tools/ocaml/libs/xl/xl.mli.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/ocaml/libs/xl/xl.mli.in     Wed Apr 20 17:13:08 2011 +0100
@@ -0,0 +1,175 @@
+(*
+ * Copyright (C) 2009-2011 Citrix Ltd.
+ * Author Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
+ *
+ * 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.
+ *)
+
+exception Error of string
+
+type domid = int
+
+(* @@LIBXL_TYPES@@ *)
+
+type console_type =
+       | CONSOLETYPE_XENCONSOLED
+       | CONSOLETYPE_IOEMU
+
+type disk_phystype =
+       | PHYSTYPE_QCOW
+       | PHYSTYPE_QCOW2
+       | PHYSTYPE_VHD
+       | PHYSTYPE_AIO
+       | PHYSTYPE_FILE
+       | PHYSTYPE_PHY
+
+type nic_type =
+       | NICTYPE_IOEMU
+       | NICTYPE_VIF
+
+type button =
+       | Button_Power
+       | Button_Sleep
+
+module Device_vfb : sig
+       type t =
+       {
+               backend_domid : domid;
+               devid : int;
+               vnc : bool;
+               vnclisten : string;
+               vncpasswd : string;
+               vncdisplay : int;
+               vncunused : bool;
+               keymap : string;
+               sdl : bool;
+               opengl : bool;
+               display : string;
+               xauthority : string;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_vfb_add"
+       external clean_shutdown : domid -> unit = 
"stub_xl_device_vfb_clean_shutdown"
+       external hard_shutdown : domid -> unit = 
"stub_xl_device_vfb_hard_shutdown"
+end
+
+module Device_vkb : sig
+       type t =
+       {
+               backend_domid : domid;
+               devid : int;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_vkb_add"
+       external clean_shutdown : domid -> unit = 
"stub_xl_device_vkb_clean_shutdown"
+       external hard_shutdown : domid -> unit = 
"stub_xl_device_vkb_hard_shutdown"
+end
+
+module Device_console : sig
+       type t =
+       {
+               backend_domid : domid;
+               devid : int;
+               consoletype : console_type;
+       }
+
+       external add : t -> domid -> unit = "stub_xl_device_console_add"
+end
+
+module Device_disk : sig
+       type t =
+       {
+               backend_domid : domid;
+               physpath : string;
+               phystype : disk_phystype;
+               virtpath : string;
+               unpluggable : bool;
+               readwrite : bool;
+               is_cdrom : bool;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_disk_add"
+       external del : t -> domid -> unit = "stub_xl_device_disk_del"
+end
+
+module Device_nic : sig
+       type t =
+       {
+               backend_domid : domid;
+               devid : int;
+               mtu : int;
+               model : string;
+               mac : int array;
+               bridge : string;
+               ifname : string;
+               script : string;
+               nictype : nic_type;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_nic_add"
+       external del : t -> domid -> unit = "stub_xl_device_nic_del"
+end
+
+module Device_pci : sig
+       type t =
+       {
+               func : int;
+               dev : int;
+               bus : int;
+               domain : int;
+               vdevfn : int;
+               msitranslate : bool;
+               power_mgmt : bool;
+       }
+       external add : t -> domid -> unit = "stub_xl_device_pci_add"
+       external remove : t -> domid -> unit = "stub_xl_device_pci_remove"
+       external shutdown : domid -> unit = "stub_xl_device_pci_shutdown"
+end
+
+module Physinfo : sig
+       type t =
+       {
+               threads_per_core : int;
+               cores_per_socket : int;
+               max_cpu_id : int;
+               nr_cpus : int;
+               cpu_khz : int;
+               total_pages : int64;
+               free_pages : int64;
+               scrub_pages : int64;
+               nr_nodes : int;
+               hwcap : int32 array;
+               physcap : int32;
+       }
+       external get : unit -> t = "stub_xl_physinfo"
+end
+
+module Sched_credit : sig
+       type t =
+       {
+               weight : int;
+               cap : int;
+       }
+       external domain_get : domid -> t = "stub_xl_sched_credit_domain_get"
+       external domain_set : domid -> t -> unit = 
"stub_xl_sched_credit_domain_set"
+end
+
+module Topologyinfo : sig
+       type t =
+       {
+               core : int;
+               socket : int;
+               node : int;
+       }
+       external get : unit -> t = "stub_xl_topologyinfo"
+end
+
+external button_press : domid -> button -> unit = "stub_xl_button_press"
+
+external send_trigger : domid -> string -> int -> unit = "stub_xl_send_trigger"
+external send_sysrq : domid -> char -> unit = "stub_xl_send_sysrq"
+external send_debug_keys : domid -> string -> unit = "stub_xl_send_debug_keys"
diff -r f026866216ec -r 24da3ce526fe tools/ocaml/libs/xl/xl_stubs.c
--- a/tools/ocaml/libs/xl/xl_stubs.c    Wed Apr 20 17:13:08 2011 +0100
+++ b/tools/ocaml/libs/xl/xl_stubs.c    Wed Apr 20 17:13:08 2011 +0100
@@ -26,7 +26,7 @@
 #include <stdint.h>
 #include <string.h>
 
-#include "libxl.h"
+#include <libxl.h>
 
 struct caml_logger {
        struct xentoollog_logger logger;
@@ -130,6 +130,8 @@
 
 #endif
 
+#include "_libxl_types.inc"
+
 static int device_disk_val(caml_gc *gc, libxl_device_disk *c_val, value v)
 {
        CAMLparam1(v);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.