On 12/03/18 19:35, Michael Young wrote:
Here is version 4 of the patch where I have replaced the uses of s with b
where the patch changes it from string to bytes. I have also removed the
two trailing spaces and changed stmp back to s.
Michael Young
0001-make-xen-ocaml-safe-strings-compliant.patch
From da088e4eef2bbea4be262e12db4c36960ff5145a Mon Sep 17 00:00:00 2001
From: Michael Young<m.a.yo...@durham.ac.uk>
Date: Mon, 12 Mar 2018 18:49:29 +0000
Subject: [PATCH v4] make xen ocaml safe-strings compliant
Xen built with ocaml 4.06 gives errors such as
Error: This expression has type bytes but an expression was
expected of type string
as Byte and safe-strings which were introduced in 4.02 are the
default in 4.06.
This patch which is partly by Richard W.M. Jones of Red Hat
fromhttps://bugzilla.redhat.com/show_bug.cgi?id=1526703
fixes these issues.
v4: Where string s is now bytes, rename it to b.
Signed-off-by: Michael Young<m.a.yo...@durham.ac.uk>
---
tools/ocaml/libs/xb/xb.ml | 34 ++++++++++++++++++----------------
tools/ocaml/libs/xb/xb.mli | 10 +++++-----
tools/ocaml/xenstored/logging.ml | 22 +++++++++++-----------
tools/ocaml/xenstored/stdext.ml | 2 +-
tools/ocaml/xenstored/utils.ml | 20 ++++++++++----------
5 files changed, 45 insertions(+), 43 deletions(-)
Reviewed-by: Christian Lindig<christian.lin...@citrix.com>
This patch is good to go. One caveat, though: the conversion between bytes and
strings
is not just a cast but involves copying and thus has a performance cost which we
want to keep in mind. The OCaml low-level libraries like Unix.read return
(mutable) bytes,
but most code expects (immutable) strings. I believe that it would be difficult
to avoid
this in the long run and this patch is the right way to go.
-- Christian
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel