From: David Scott <dave.scott@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH 2 of 5] tools: ocaml: move the nic_info record into a module to the field labels live in a separate namespace
Date: Mon, 28 Mar 2011 13:26:36 +0100 [thread overview]
Message-ID: <45326ad6a0d396bfcd3c.1301315196@ely> (raw)
In-Reply-To: <patchbomb.1301315194@ely>
# HG changeset patch
# User David Scott <dave.scott@eu.citrix.com>
# 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@eu.citrix.com>
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"
next prev parent reply other threads:[~2011-03-28 12:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-28 12:26 [PATCH 0 of 5] Improvements to libxl VIF hotplug, unplug; xapi can now use these functions David Scott
2011-03-28 12:26 ` [PATCH 1 of 5] libxl: fix memory management in "xl network-attach" David Scott
2011-03-28 14:37 ` Stefano Stabellini
2011-03-29 8:30 ` Ian Campbell
2011-03-28 12:26 ` David Scott [this message]
2011-03-29 8:42 ` [PATCH 2 of 5] tools: ocaml: move the nic_info record into a module to the field labels live in a separate namespace Ian Campbell
2011-03-30 17:18 ` Dave Scott
2011-03-28 12:26 ` [PATCH 3 of 5] libxl: add NIC QoS parameters David Scott
2011-03-28 14:37 ` Stefano Stabellini
2011-03-29 8:48 ` Ian Campbell
2011-03-28 12:26 ` [PATCH 4 of 5] tools: ocaml: add NIC QoS parameters to the ocaml libxl interface David Scott
2011-03-29 8:49 ` Ian Campbell
2011-03-28 12:26 ` [PATCH 5 of 5] tools: ocaml: rename nic_remove to nic_del, for consistency with libxl David Scott
2011-03-29 8:52 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45326ad6a0d396bfcd3c.1301315196@ely \
--to=dave.scott@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.