Skip to contentSkip to conversation

oxenstored: allow compilation prior to OCaml 3.12.0

PATCH Superseded Jonathan Davies 3 participants 4 messages Mar 30, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oxenstored: allow compilation prior to OCaml 3.12.0

Commit 363ae55c8 used an OCaml feature called record field punning. This broke the build on compilers prior to OCaml 3.12.0.

This patch makes no semantic change but now uses backwards-compatible syntax.

---
 tools/ocaml/xenstored/process.ml |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/ocaml/xenstored/process.ml +1 -1
index fb5fdaf..7b60376 100644
@@ -484,7 +484,7 @@ let do_input store cons doms con =
 	if newpacket then (
 		let packet = Connection.pop_in con in
 		let tid, rid, ty, data = Xenbus.Xb.Packet.unpack packet in
-		let req = {Packet.tid; Packet.rid; Packet.ty; Packet.data} in
+		let req = {Packet.tid=tid; Packet.rid=rid; Packet.ty=ty; Packet.data=data} in
 
 		(* As we don't log IO, do not call an unnecessary sanitize_data 
 		   info "[%s] -> [%d] %s \"%s\""
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#1 lore raw
Quoted 7 lines · Jonathan Davies

Commit 363ae55c8 used an OCaml feature called record field punning. This broke the build on compilers prior to OCaml 3.12.0.

This patch makes no semantic change but now uses backwards-compatible syntax.

This should be Tested-by (and maybe Reported-by). Reviewed-by implies that I understood what you did. I make no such claim ;-)

-boris

Quoted 9 lines
---
  tools/ocaml/xenstored/process.ml |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/ocaml/xenstored/process.ml +0 -0
index fb5fdaf..7b60376 100644

tools/ocaml/xenstored/process.ml let do_input store cons doms con = · line 490

Quoted 8 lines
tools/ocaml/xenstored/process.ml +1 -1
@@ -484,7 +484,7 @@ let do_input store cons doms con =
  	if newpacket then (
  		let packet = Connection.pop_in con in
  		let tid, rid, ty, data = Xenbus.Xb.Packet.unpack packet in
-		let req = {Packet.tid; Packet.rid; Packet.ty; Packet.data} in
+		let req = {Packet.tid=tid; Packet.rid=rid; Packet.ty=ty; Packet.data=data} in
 
  		(* As we don't log IO, do not call an unnecessary sanitize_data
  		   info "[%s] -> [%d] %s \"%s\""

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw
Quoted 7 lines · Boris Ostrovsky
Quoted 4 lines · Jonathan Davies

Commit 363ae55c8 used an OCaml feature called record field punning. This broke the build on compilers prior to OCaml 3.12.0.

This patch makes no semantic change but now uses backwards-compatible

syntax.

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

This should be Tested-by (and maybe Reported-by). Reviewed-by implies that I understood what you did. I make no such claim ;-)

-boris

My apologies!

Corrected version coming up.

Jonathan

Quoted 19 lines
Quoted 10 lines
---
  tools/ocaml/xenstored/process.ml |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/ocaml/xenstored/process.ml +0 -0
index fb5fdaf..7b60376 100644

tools/ocaml/xenstored/process.ml let do_input store cons doms con = · line 490

Quoted 8 lines
tools/ocaml/xenstored/process.ml +2 -1
@@ -484,7 +484,7 @@ let do_input store cons doms con =
  	if newpacket then (
  		let packet = Connection.pop_in con in
  		let tid, rid, ty, data = Xenbus.Xb.Packet.unpack packet in
-		let req = {Packet.tid; Packet.rid; Packet.ty; Packet.data} in
+		let req = {Packet.tid=tid; Packet.rid=rid; Packet.ty=ty;
+Packet.data=data} in
 
  		(* As we don't log IO, do not call an unnecessary

sanitize_data

Quoted 7 lines
Quoted 1 line

info "[%s] -> [%d] %s \"%s\""

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Tested-by Boris Ostrovsky on v1 1/1
#3 lore raw
In reply to Jonathan Davies
Quoted 7 lines · Jonathan Davies

Commit 363ae55c8 used an OCaml feature called record field punning. This broke the build on compilers prior to OCaml 3.12.0.

This patch makes no semantic change but now uses backwards-compatible syntax.

This should be

Other than that I don't really have comment on this patch. :-)

Quoted 20 lines
---
 tools/ocaml/xenstored/process.ml |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/ocaml/xenstored/process.ml +1 -1
index fb5fdaf..7b60376 100644
@@ -484,7 +484,7 @@ let do_input store cons doms con =
 	if newpacket then (
 		let packet = Connection.pop_in con in
 		let tid, rid, ty, data = Xenbus.Xb.Packet.unpack packet in
-		let req = {Packet.tid; Packet.rid; Packet.ty; Packet.data} in
+		let req = {Packet.tid=tid; Packet.rid=rid; Packet.ty=ty; Packet.data=data} in
 
 		(* As we don't log IO, do not call an unnecessary sanitize_data 
 		   info "[%s] -> [%d] %s \"%s\""
Signature · 1 line
1.7.10.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel