xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Ocaml: misc fixes
@ 2018-02-07 17:09 Wei Liu
  2018-02-07 17:09 ` [PATCH 1/2] ocaml/xb: update xb.mli in accordance with df1e4c6e7f8 Wei Liu
  2018-02-07 17:09 ` [PATCH 2/2] ocaml/libs/xb: don't generate *.mli automatically Wei Liu
  0 siblings, 2 replies; 5+ messages in thread
From: Wei Liu @ 2018-02-07 17:09 UTC (permalink / raw)
  To: Xen-devel; +Cc: Wei Liu, christian.lindig

Wei Liu (2):
  ocaml/xb: update xb.mli in accordance with df1e4c6e7f8
  ocaml/libs/xb: don't generate *.mli automatically

 tools/ocaml/libs/xb/Makefile    |  4 ----
 tools/ocaml/libs/xb/op.mli      | 29 +++++++++++++++++++++++++++++
 tools/ocaml/libs/xb/packet.mli  | 13 +++++++++++++
 tools/ocaml/libs/xb/partial.mli | 14 ++++++++++++++
 tools/ocaml/libs/xb/xb.mli      |  4 ++--
 5 files changed, 58 insertions(+), 6 deletions(-)
 create mode 100644 tools/ocaml/libs/xb/op.mli
 create mode 100644 tools/ocaml/libs/xb/packet.mli
 create mode 100644 tools/ocaml/libs/xb/partial.mli

-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] ocaml/xb: update xb.mli in accordance with df1e4c6e7f8
  2018-02-07 17:09 [PATCH 0/2] Ocaml: misc fixes Wei Liu
@ 2018-02-07 17:09 ` Wei Liu
  2018-02-07 17:21   ` Christian Lindig
  2018-02-07 17:09 ` [PATCH 2/2] ocaml/libs/xb: don't generate *.mli automatically Wei Liu
  1 sibling, 1 reply; 5+ messages in thread
From: Wei Liu @ 2018-02-07 17:09 UTC (permalink / raw)
  To: Xen-devel; +Cc: Wei Liu, christian.lindig

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/ocaml/libs/xb/xb.mli | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xb/xb.mli b/tools/ocaml/libs/xb/xb.mli
index b4d705201f..95d1c6f840 100644
--- a/tools/ocaml/libs/xb/xb.mli
+++ b/tools/ocaml/libs/xb/xb.mli
@@ -76,10 +76,10 @@ type t = {
 val init_partial_in : unit -> partial_buf
 val reconnect : t -> unit
 val queue : t -> Packet.t -> unit
-val read_fd : backend_fd -> 'a -> string -> int -> int
+val read_fd : backend_fd -> 'a -> bytes -> int -> int
 val read_mmap : backend_mmap -> 'a -> string -> int -> int
 val read : t -> string -> int -> int
-val write_fd : backend_fd -> 'a -> string -> int -> int
+val write_fd : backend_fd -> 'a -> bytes -> int -> int
 val write_mmap : backend_mmap -> 'a -> string -> int -> int
 val write : t -> string -> int -> int
 val output : t -> bool
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ocaml/libs/xb: don't generate *.mli automatically
  2018-02-07 17:09 [PATCH 0/2] Ocaml: misc fixes Wei Liu
  2018-02-07 17:09 ` [PATCH 1/2] ocaml/xb: update xb.mli in accordance with df1e4c6e7f8 Wei Liu
@ 2018-02-07 17:09 ` Wei Liu
  2018-02-07 17:21   ` Christian Lindig
  1 sibling, 1 reply; 5+ messages in thread
From: Wei Liu @ 2018-02-07 17:09 UTC (permalink / raw)
  To: Xen-devel; +Cc: Wei Liu, christian.lindig

To stay in line with other parts of the ocaml code base.

This requires committing a bunch of mli files in tree.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 tools/ocaml/libs/xb/Makefile    |  4 ----
 tools/ocaml/libs/xb/op.mli      | 29 +++++++++++++++++++++++++++++
 tools/ocaml/libs/xb/packet.mli  | 13 +++++++++++++
 tools/ocaml/libs/xb/partial.mli | 14 ++++++++++++++
 4 files changed, 56 insertions(+), 4 deletions(-)
 create mode 100644 tools/ocaml/libs/xb/op.mli
 create mode 100644 tools/ocaml/libs/xb/packet.mli
 create mode 100644 tools/ocaml/libs/xb/partial.mli

diff --git a/tools/ocaml/libs/xb/Makefile b/tools/ocaml/libs/xb/Makefile
index 09d1bc8946..be4499147e 100644
--- a/tools/ocaml/libs/xb/Makefile
+++ b/tools/ocaml/libs/xb/Makefile
@@ -39,10 +39,6 @@ xenbus.cmo : $(foreach obj, $(OBJS), $(obj).cmo)
 	$(E) " CMO      $@"
 	$(OCAMLC) -pack -o $@ $^
 
-%.mli: %.ml
-	$(E) " MLI      $@"
-	$(Q)$(OCAMLC) $(OCAMLINCLUDE) -i $< $o
-
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
diff --git a/tools/ocaml/libs/xb/op.mli b/tools/ocaml/libs/xb/op.mli
new file mode 100644
index 0000000000..ecabfff0d1
--- /dev/null
+++ b/tools/ocaml/libs/xb/op.mli
@@ -0,0 +1,29 @@
+type operation =
+    Debug
+  | Directory
+  | Read
+  | Getperms
+  | Watch
+  | Unwatch
+  | Transaction_start
+  | Transaction_end
+  | Introduce
+  | Release
+  | Getdomainpath
+  | Write
+  | Mkdir
+  | Rm
+  | Setperms
+  | Watchevent
+  | Error
+  | Isintroduced
+  | Resume
+  | Set_target
+  | Reset_watches
+  | Invalid
+val operation_c_mapping : operation array
+val size : int
+val array_search : 'a -> 'a array -> int
+val of_cval : int -> operation
+val to_cval : operation -> int
+val to_string : operation -> string
diff --git a/tools/ocaml/libs/xb/packet.mli b/tools/ocaml/libs/xb/packet.mli
new file mode 100644
index 0000000000..f4e53c73a8
--- /dev/null
+++ b/tools/ocaml/libs/xb/packet.mli
@@ -0,0 +1,13 @@
+type t = { tid : int; rid : int; ty : Op.operation; data : string; }
+exception Error of string
+exception DataError of string
+external string_of_header : int -> int -> int -> int -> string
+  = "stub_string_of_header"
+val create : int -> int -> Op.operation -> string -> t
+val of_partialpkt : Partial.pkt -> t
+val to_string : t -> string
+val unpack : t -> int * int * Op.operation * string
+val get_tid : t -> int
+val get_ty : t -> Op.operation
+val get_data : t -> string
+val get_rid : t -> int
diff --git a/tools/ocaml/libs/xb/partial.mli b/tools/ocaml/libs/xb/partial.mli
new file mode 100644
index 0000000000..359a75e88d
--- /dev/null
+++ b/tools/ocaml/libs/xb/partial.mli
@@ -0,0 +1,14 @@
+type pkt = {
+  tid : int;
+  rid : int;
+  ty : Op.operation;
+  len : int;
+  buf : Buffer.t;
+}
+external header_size : unit -> int = "stub_header_size"
+external header_of_string_internal : string -> int * int * int * int
+  = "stub_header_of_string"
+val xenstore_payload_max : int
+val of_string : string -> pkt
+val append : pkt -> string -> int -> unit
+val to_complete : pkt -> int
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] ocaml/libs/xb: don't generate *.mli automatically
  2018-02-07 17:09 ` [PATCH 2/2] ocaml/libs/xb: don't generate *.mli automatically Wei Liu
@ 2018-02-07 17:21   ` Christian Lindig
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Lindig @ 2018-02-07 17:21 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel



> On 7. Feb 2018, at 17:09, Wei Liu <wei.liu2@citrix.com> wrote:
> 
> To stay in line with other parts of the ocaml code base.
> 
> This requires committing a bunch of mli files in tree.
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> tools/ocaml/libs/xb/Makefile    |  4 ----
> tools/ocaml/libs/xb/op.mli      | 29 +++++++++++++++++++++++++++++
> tools/ocaml/libs/xb/packet.mli  | 13 +++++++++++++
> tools/ocaml/libs/xb/partial.mli | 14 ++++++++++++++
> 4 files changed, 56 insertions(+), 4 deletions(-)
> create mode 100644 tools/ocaml/libs/xb/op.mli
> create mode 100644 tools/ocaml/libs/xb/packet.mli
> create mode 100644 tools/ocaml/libs/xb/partial.mli
> 
> diff --git a/tools/ocaml/libs/xb/Makefile b/tools/ocaml/libs/xb/Makefile
> index 09d1bc8946..be4499147e 100644
> --- a/tools/ocaml/libs/xb/Makefile
> +++ b/tools/ocaml/libs/xb/Makefile
> @@ -39,10 +39,6 @@ xenbus.cmo : $(foreach obj, $(OBJS), $(obj).cmo)
> 	$(E) " CMO      $@"
> 	$(OCAMLC) -pack -o $@ $^
> 
> -%.mli: %.ml
> -	$(E) " MLI      $@"
> -	$(Q)$(OCAMLC) $(OCAMLINCLUDE) -i $< $o
> -
> .PHONY: install
> install: $(LIBS) META
> 	mkdir -p $(OCAMLDESTDIR)
> diff --git a/tools/ocaml/libs/xb/op.mli b/tools/ocaml/libs/xb/op.mli
> new file mode 100644
> index 0000000000..ecabfff0d1
> --- /dev/null
> +++ b/tools/ocaml/libs/xb/op.mli
> @@ -0,0 +1,29 @@
> +type operation =
> +    Debug
> +  | Directory
> +  | Read
> +  | Getperms
> +  | Watch
> +  | Unwatch
> +  | Transaction_start
> +  | Transaction_end
> +  | Introduce
> +  | Release
> +  | Getdomainpath
> +  | Write
> +  | Mkdir
> +  | Rm
> +  | Setperms
> +  | Watchevent
> +  | Error
> +  | Isintroduced
> +  | Resume
> +  | Set_target
> +  | Reset_watches
> +  | Invalid
> +val operation_c_mapping : operation array
> +val size : int
> +val array_search : 'a -> 'a array -> int
> +val of_cval : int -> operation
> +val to_cval : operation -> int
> +val to_string : operation -> string
> diff --git a/tools/ocaml/libs/xb/packet.mli b/tools/ocaml/libs/xb/packet.mli
> new file mode 100644
> index 0000000000..f4e53c73a8
> --- /dev/null
> +++ b/tools/ocaml/libs/xb/packet.mli
> @@ -0,0 +1,13 @@
> +type t = { tid : int; rid : int; ty : Op.operation; data : string; }
> +exception Error of string
> +exception DataError of string
> +external string_of_header : int -> int -> int -> int -> string
> +  = "stub_string_of_header"
> +val create : int -> int -> Op.operation -> string -> t
> +val of_partialpkt : Partial.pkt -> t
> +val to_string : t -> string
> +val unpack : t -> int * int * Op.operation * string
> +val get_tid : t -> int
> +val get_ty : t -> Op.operation
> +val get_data : t -> string
> +val get_rid : t -> int
> diff --git a/tools/ocaml/libs/xb/partial.mli b/tools/ocaml/libs/xb/partial.mli
> new file mode 100644
> index 0000000000..359a75e88d
> --- /dev/null
> +++ b/tools/ocaml/libs/xb/partial.mli
> @@ -0,0 +1,14 @@
> +type pkt = {
> +  tid : int;
> +  rid : int;
> +  ty : Op.operation;
> +  len : int;
> +  buf : Buffer.t;
> +}
> +external header_size : unit -> int = "stub_header_size"
> +external header_of_string_internal : string -> int * int * int * int
> +  = "stub_header_of_string"
> +val xenstore_payload_max : int
> +val of_string : string -> pkt
> +val append : pkt -> string -> int -> unit
> +val to_complete : pkt -> int
> -- 
> 2.11.0
> 

Acked-by: Christian Lindig <christian.lindig@citrix.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] ocaml/xb: update xb.mli in accordance with df1e4c6e7f8
  2018-02-07 17:09 ` [PATCH 1/2] ocaml/xb: update xb.mli in accordance with df1e4c6e7f8 Wei Liu
@ 2018-02-07 17:21   ` Christian Lindig
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Lindig @ 2018-02-07 17:21 UTC (permalink / raw)
  To: Wei Liu; +Cc: Xen-devel



> On 7. Feb 2018, at 17:09, Wei Liu <wei.liu2@citrix.com> wrote:
> 
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> tools/ocaml/libs/xb/xb.mli | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/ocaml/libs/xb/xb.mli b/tools/ocaml/libs/xb/xb.mli
> index b4d705201f..95d1c6f840 100644
> --- a/tools/ocaml/libs/xb/xb.mli
> +++ b/tools/ocaml/libs/xb/xb.mli
> @@ -76,10 +76,10 @@ type t = {
> val init_partial_in : unit -> partial_buf
> val reconnect : t -> unit
> val queue : t -> Packet.t -> unit
> -val read_fd : backend_fd -> 'a -> string -> int -> int
> +val read_fd : backend_fd -> 'a -> bytes -> int -> int
> val read_mmap : backend_mmap -> 'a -> string -> int -> int
> val read : t -> string -> int -> int
> -val write_fd : backend_fd -> 'a -> string -> int -> int
> +val write_fd : backend_fd -> 'a -> bytes -> int -> int
> val write_mmap : backend_mmap -> 'a -> string -> int -> int
> val write : t -> string -> int -> int
> val output : t -> bool
> -- 
> 2.11.0
> 

Acked-by: Christian Lindig <christian.lindig@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-07 17:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-07 17:09 [PATCH 0/2] Ocaml: misc fixes Wei Liu
2018-02-07 17:09 ` [PATCH 1/2] ocaml/xb: update xb.mli in accordance with df1e4c6e7f8 Wei Liu
2018-02-07 17:21   ` Christian Lindig
2018-02-07 17:09 ` [PATCH 2/2] ocaml/libs/xb: don't generate *.mli automatically Wei Liu
2018-02-07 17:21   ` Christian Lindig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).