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

[Xen-devel] [PATCH 2 of 5] tools: ocaml: move the nic_info record into a module to the field labels live in a separate namespace



# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1301314652 -3600
# Node ID 45326ad6a0d396bfcd3c83d209ab7a19d6499896
# Parent  85361e3dab12827c6321931c9e09d02fb22578ee
tools: ocaml: move the nic_info record into a module to the field labels live 
in a separate namespace.

Otherwise the redefinition of fields like "backend_domid" "devid" et al make 
the records un-instantiable.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 85361e3dab12 -r 45326ad6a0d3 tools/ocaml/libs/xl/xl.ml
--- a/tools/ocaml/libs/xl/xl.ml Mon Mar 28 13:17:32 2011 +0100
+++ b/tools/ocaml/libs/xl/xl.ml Mon Mar 28 13:17:32 2011 +0100
@@ -97,18 +97,20 @@
        | NICTYPE_IOEMU
        | NICTYPE_VIF
 
-type nic_info =
-{
-       backend_domid : domid;
-       devid : int;
-       mtu : int;
-       model : string;
-       mac : int array;
-       bridge : string;
-       ifname : string;
-       script : string;
-       nictype : nic_type;
-}
+module Nic_info = struct
+       type t =
+       {
+               backend_domid : domid;
+               devid : int;
+               mtu : int;
+               model : string;
+               mac : int array;
+               bridge : string;
+               ifname : string;
+               script : string;
+               nictype : nic_type;
+       }
+end
 
 type console_type =
        | CONSOLETYPE_XENCONSOLED
@@ -179,7 +181,7 @@
 external disk_add : disk_info -> domid -> unit = "stub_xl_disk_add"
 external disk_remove : disk_info -> domid -> unit = "stub_xl_disk_remove"
 
-external nic_add : nic_info -> domid -> unit = "stub_xl_nic_add"
+external nic_add : Nic_info.t -> domid -> unit = "stub_xl_nic_add"
 external nic_remove : disk_info -> domid -> unit = "stub_xl_nic_remove"
 
 external console_add : console_info -> build_state -> domid -> unit = 
"stub_xl_console_add"
diff -r 85361e3dab12 -r 45326ad6a0d3 tools/ocaml/libs/xl/xl.mli
--- a/tools/ocaml/libs/xl/xl.mli        Mon Mar 28 13:17:32 2011 +0100
+++ b/tools/ocaml/libs/xl/xl.mli        Mon Mar 28 13:17:32 2011 +0100
@@ -97,18 +97,20 @@
        | NICTYPE_IOEMU
        | NICTYPE_VIF
 
-type nic_info =
-{
-       backend_domid : domid;
-       devid : int;
-       mtu : int;
-       model : string;
-       mac : int array;
-       bridge : string;
-       ifname : string;
-       script : string;
-       nictype : nic_type;
-}
+module Nic_info : sig
+       type t =
+       {
+               backend_domid : domid;
+               devid : int;
+               mtu : int;
+               model : string;
+               mac : int array;
+               bridge : string;
+               ifname : string;
+               script : string;
+               nictype : nic_type;
+       }
+end
 
 type console_type =
        | CONSOLETYPE_XENCONSOLED
@@ -179,7 +181,7 @@
 external disk_add : disk_info -> domid -> unit = "stub_xl_disk_add"
 external disk_remove : disk_info -> domid -> unit = "stub_xl_disk_remove"
 
-external nic_add : nic_info -> domid -> unit = "stub_xl_nic_add"
+external nic_add : Nic_info.t -> domid -> unit = "stub_xl_nic_add"
 external nic_remove : disk_info -> domid -> unit = "stub_xl_nic_remove"
 
 external console_add : console_info -> build_state -> domid -> unit = 
"stub_xl_console_add"

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


 


Rackspace

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