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-devel

[Xen-devel] [PATCH 2 of 5] tools: ocaml: move the nic_info record into a

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [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
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Mon, 28 Mar 2011 13:26:36 +0100
Delivery-date: Mon, 28 Mar 2011 06:03:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1301315194@ely>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1301315194@ely>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
# 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

<Prev in Thread] Current Thread [Next in Thread>