|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] [PATCH 2 of 7] [OCAML] Remove the uuid library
On Thu, 2011-09-29 at 22:17 +0100, Jon Ludlam wrote:
> diff -r c5df5f625ee2 -r 42cdb34ec175 tools/ocaml/libs/xc/META.in
> --- a/tools/ocaml/libs/xc/META.in
> +++ b/tools/ocaml/libs/xc/META.in
> @@ -1,5 +1,5 @@
> version = "@VERSION@"
> description = "Xen Control Interface"
> -requires = "mmap,uuid"
> +requires = "unix,mmap"
> archive(byte) = "xc.cma"
> archive(native) = "xc.cmxa"
Is the addition of unix here really part of removing uuid? I don't see
any additional use of unix arising from the change.
xc does seem to use unix already so the change is probably correct, just
not really part of this change. I'd be happier if it went in separately,
but:
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> diff -r c5df5f625ee2 -r 42cdb34ec175 tools/ocaml/libs/xc/Makefile
> --- a/tools/ocaml/libs/xc/Makefile
> +++ b/tools/ocaml/libs/xc/Makefile
> @@ -3,7 +3,7 @@
> include $(TOPLEVEL)/common.make
>
> CFLAGS += -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
> -OCAMLINCLUDE += -I ../mmap -I ../uuid
> +OCAMLINCLUDE += -I ../mmap
>
> OBJS = xc
> INTF = xc.cmi
> diff -r c5df5f625ee2 -r 42cdb34ec175 tools/ocaml/libs/xc/xc.ml
> --- a/tools/ocaml/libs/xc/xc.ml
> +++ b/tools/ocaml/libs/xc/xc.ml
> @@ -118,14 +118,23 @@
> external _domain_create: handle -> int32 -> domain_create_flag list -> int
> array -> domid
> = "stub_xc_domain_create"
>
> +let int_array_of_uuid_string s =
> + try
> + Scanf.sscanf s
> +
> "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
> + (fun a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13
> a14 a15 ->
> + [| a0; a1; a2; a3; a4; a5; a6; a7;
> + a8; a9; a10; a11; a12; a13; a14; a15 |])
> + with _ -> invalid_arg ("Xc.int_array_of_uuid_string: " ^ s)
> +
> let domain_create handle n flags uuid =
> - _domain_create handle n flags (Uuid.int_array_of_uuid uuid)
> + _domain_create handle n flags (int_array_of_uuid_string uuid)
>
> external _domain_sethandle: handle -> domid -> int array -> unit
> = "stub_xc_domain_sethandle"
>
> let domain_sethandle handle n uuid =
> - _domain_sethandle handle n (Uuid.int_array_of_uuid uuid)
> + _domain_sethandle handle n (int_array_of_uuid_string uuid)
>
> external domain_max_vcpus: handle -> domid -> int -> unit
> = "stub_xc_domain_max_vcpus"
> diff -r c5df5f625ee2 -r 42cdb34ec175 tools/ocaml/libs/xc/xc.mli
> --- a/tools/ocaml/libs/xc/xc.mli
> +++ b/tools/ocaml/libs/xc/xc.mli
> @@ -74,12 +74,8 @@
> external is_fake : unit -> bool = "stub_xc_interface_is_fake"
> external interface_close : handle -> unit = "stub_xc_interface_close"
> val with_intf : (handle -> 'a) -> 'a
> -external _domain_create : handle -> int32 -> domain_create_flag list -> int
> array -> domid
> - = "stub_xc_domain_create"
> -val domain_create : handle -> int32 -> domain_create_flag list -> 'a Uuid.t
> -> domid
> -external _domain_sethandle : handle -> domid -> int array -> unit
> - = "stub_xc_domain_sethandle"
> -val domain_sethandle : handle -> domid -> 'a Uuid.t -> unit
> +val domain_create : handle -> int32 -> domain_create_flag list -> string ->
> domid
> +val domain_sethandle : handle -> domid -> string -> unit
> external domain_max_vcpus : handle -> domid -> int -> unit
> = "stub_xc_domain_max_vcpus"
> external domain_pause : handle -> domid -> unit = "stub_xc_domain_pause"
> diff -r c5df5f625ee2 -r 42cdb34ec175 tools/ocaml/xenstored/Makefile
> --- a/tools/ocaml/xenstored/Makefile
> +++ b/tools/ocaml/xenstored/Makefile
> @@ -5,7 +5,6 @@
> OCAMLINCLUDE += \
> -I $(OCAML_TOPLEVEL)/libs/log \
> -I $(OCAML_TOPLEVEL)/libs/xb \
> - -I $(OCAML_TOPLEVEL)/libs/uuid \
> -I $(OCAML_TOPLEVEL)/libs/mmap \
> -I $(OCAML_TOPLEVEL)/libs/xc \
> -I $(OCAML_TOPLEVEL)/libs/eventchn
> @@ -34,7 +33,6 @@
> INTF = symbol.cmi trie.cmi
> XENSTOREDLIBS = \
> unix.cmxa \
> - $(OCAML_TOPLEVEL)/libs/uuid/uuid.cmxa \
> -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap
> $(OCAML_TOPLEVEL)/libs/mmap/mmap.cmxa \
> -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/log
> $(OCAML_TOPLEVEL)/libs/log/log.cmxa \
> -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn
> $(OCAML_TOPLEVEL)/libs/eventchn/eventchn.cmxa \
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|