Skip to contentSkip to conversation

tools/ocaml: Drop libxl bindings

PATCH In review Andrew Cooper 2 participants 4 messages Feb 9, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/ocaml: Drop libxl bindings

There are significant issues with these bindings, and their companion half in Xapi was deleted in 2018

https://github.com/xapi-project/xen-api/commit/203292ebe0c487d7ae4adb961a6d080f4fbe933d

owing to there having been no development of these bindings since 2014.

In the unlikely event that we'd want to reinstate them, they'd need reworking basically from scratch anyway.

---
CC: Christian Lindig <[email protected]>
CC: David Scott <[email protected]>
CC: Edwin Török <[email protected]>
CC: Rob Hoes <[email protected]>

I'm unsure whether to drop xentoollog. They're technically orphaned by this change, but could be used in principle by the other bindings.

---
 tools/ocaml/Makefile                 |    4 -
 tools/ocaml/libs/Makefile            |    2 +-
 tools/ocaml/libs/xl/META.in          |    5 -
 tools/ocaml/libs/xl/Makefile         |   71 --
 tools/ocaml/libs/xl/genwrap.py       |  582 ------------
 tools/ocaml/libs/xl/xenlight.ml.in   |   94 --
 tools/ocaml/libs/xl/xenlight.mli.in  |   93 --
 tools/ocaml/libs/xl/xenlight_stubs.c | 1663 ----------------------------------
 tools/ocaml/test/Makefile            |   55 --
 tools/ocaml/test/dmesg.ml            |   17 -
 tools/ocaml/test/list_domains.ml     |   26 -
 tools/ocaml/test/raise_exception.ml  |    9 -
 tools/ocaml/test/send_debug_keys.ml  |   13 -
 tools/ocaml/test/xtl.ml              |   39 -
 14 files changed, 1 insertion(+), 2672 deletions(-)
 delete mode 100644 tools/ocaml/libs/xl/META.in
 delete mode 100644 tools/ocaml/libs/xl/Makefile
 delete mode 100644 tools/ocaml/libs/xl/genwrap.py
 delete mode 100644 tools/ocaml/libs/xl/xenlight.ml.in
 delete mode 100644 tools/ocaml/libs/xl/xenlight.mli.in
 delete mode 100644 tools/ocaml/libs/xl/xenlight_stubs.c
 delete mode 100644 tools/ocaml/test/Makefile
 delete mode 100644 tools/ocaml/test/dmesg.ml
 delete mode 100644 tools/ocaml/test/list_domains.ml
 delete mode 100644 tools/ocaml/test/raise_exception.ml
 delete mode 100644 tools/ocaml/test/send_debug_keys.ml
 delete mode 100644 tools/ocaml/test/xtl.ml
tools/ocaml/Makefile +0 -4
index 85bfd087c9c6..1557fd6c3c1a 100644
@@ -4,10 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
 SUBDIRS := libs
 SUBDIRS += xenstored
 
-ifeq ($(CONFIG_TESTS),y)
-SUBDIRS += test
-endif
-
 .NOTPARALLEL:
 # targets here must be run in order, otherwise we can try
 # to build programs before the libraries are done
tools/ocaml/libs/Makefile +1 -1
index 5146c5248460..49ea7dd1cb8a 100644
@@ -5,7 +5,7 @@ SUBDIRS= \
 	mmap \
 	xentoollog \
 	eventchn xc \
-	xb xs xl
+	xb xs
 
 .PHONY: all
 all: subdirs-all
tools/ocaml/libs/xl/META.in deleted +0 -5
deleted file mode 100644
index 3f0c5526cb2e..000000000000
@@ -1,5 +0,0 @@
-version = "@VERSION@"
-description = "Xen Toolstack Library"
-requires = "xentoollog"
-archive(byte) = "xenlight.cma"
-archive(native) = "xenlight.cmxa"
tools/ocaml/libs/xl/Makefile deleted +0 -71

71 lines not on this page · raw message

tools/ocaml/libs/xl/genwrap.py deleted +0 -582

582 lines not on this page · raw message

tools/ocaml/libs/xl/xenlight.ml.in deleted +0 -94

94 lines not on this page · raw message

tools/ocaml/libs/xl/xenlight.mli.in deleted +0 -93

93 lines not on this page · raw message

tools/ocaml/libs/xl/xenlight_stubs.c deleted +0 -1663

1,663 lines not on this page · raw message

tools/ocaml/test/Makefile deleted +0 -55

55 lines not on this page · raw message

tools/ocaml/test/dmesg.ml deleted +0 -17
deleted file mode 100644
index f9efe5dc3066..000000000000
@@ -1,17 +0,0 @@
-
-let _ =
-  Xenlight.register_exceptions ();
-  let logger = Xtl.create_stdio_logger ~level:Xentoollog.Debug () in
-  let ctx = Xenlight.ctx_alloc logger in
-
-  let open Xenlight.Host in
-  let reader = xen_console_read_start ctx 0 in
-  (try
-     while true do
-       let line = xen_console_read_line ctx reader in
-       print_string line
-     done
-   with End_of_file -> ());
-  let _ = xen_console_read_finish ctx reader in
-  ()
-
tools/ocaml/test/list_domains.ml deleted +0 -26
deleted file mode 100644
index 94f1cec05043..000000000000
@@ -1,26 +0,0 @@
-open Printf
-
-let bool_as_char b c = if b then c else '-'
-
-let print_dominfo dominfo =
-  let id = dominfo.Xenlight.Dominfo.domid
-  and running = bool_as_char dominfo.Xenlight.Dominfo.running 'r'
-  and blocked = bool_as_char dominfo.Xenlight.Dominfo.blocked 'b'
-  and paused = bool_as_char dominfo.Xenlight.Dominfo.paused 'p'
-  and shutdown = bool_as_char dominfo.Xenlight.Dominfo.shutdown 's'
-  and dying = bool_as_char dominfo.Xenlight.Dominfo.dying 'd'
-  and memory = dominfo.Xenlight.Dominfo.current_memkb
-  in
-  printf "Dom %d: %c%c%c%c%c %LdKB\n" id running blocked paused shutdown dying memory
-
-let _ =
-  let logger = Xtl.create_stdio_logger (*~level:Xentoollog.Debug*) () in
-  let ctx = Xenlight.ctx_alloc logger in
-  try
-    let domains = Xenlight.Dominfo.list ctx in
-    List.iter (fun d -> print_dominfo d) domains
-  with Xenlight.Error(err, fn) -> begin
-      printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
-    end
-
-
tools/ocaml/test/raise_exception.ml deleted +0 -9
deleted file mode 100644
index 8c24c3555b58..000000000000
@@ -1,9 +0,0 @@
-open Printf
-
-let _ =
-  try
-    Xenlight.test_raise_exception ()
-  with Xenlight.Error(err, fn) -> begin
-      printf "Caught Exception: %s: %s\n" (Xenlight.string_of_error err) fn;
-    end
-
tools/ocaml/test/send_debug_keys.ml deleted +0 -13
deleted file mode 100644
index 67b1605dfe20..000000000000
@@ -1,13 +0,0 @@
-open Printf
-
-let send_keys ctx s =
-  printf "Sending debug key %s\n" s;
-  Xenlight.Host.send_debug_keys ctx s;
-  ()
-
-let _ =
-  let logger = Xtl.create_stdio_logger () in
-  let ctx = Xenlight.ctx_alloc logger in
-  Arg.parse [
-  ] (fun s -> send_keys ctx s) "usage: send_debug_keys <keys>"
-
tools/ocaml/test/xtl.ml deleted +0 -39
deleted file mode 100644
index 458b11bbaac2..000000000000
@@ -1,39 +0,0 @@
-open Printf
-open Xentoollog
-
-let stdio_vmessage min_level level errno ctx msg =
-  let level_str = level_to_string level
-  and errno_str = match errno with None -> "" | Some s -> sprintf ": errno=%d" s
-  and ctx_str = match ctx with None -> "" | Some s -> sprintf ": %s" s in
-  if compare min_level level <= 0 then begin
-    printf "%s%s%s: %s\n" level_str ctx_str errno_str msg;
-    flush stdout;
-  end
-
-let stdio_progress _ctx what percent dne total =
-  let nl = if dne = total then "\n" else "" in
-  printf "\rProgress %s %d%% (%Ld/%Ld)%s" what percent dne total nl;
-  flush stdout
-
-let create_stdio_logger ?(level=Info) () =
-  let cbs = {
-    vmessage = stdio_vmessage level;
-    progress = stdio_progress; } in
-  create "Xentoollog.stdio_logger" cbs
-
-let do_test level =
-  let lgr = create_stdio_logger ~level:level () in
-  begin
-    test lgr;
-  end
-
-let () =
-  let debug_level = ref Info in
-  let speclist = [
-    ("-v", Arg.Unit (fun () -> debug_level := Debug), "Verbose");
-    ("-q", Arg.Unit (fun () -> debug_level := Critical), "Quiet");
-  ] in
-  let usage_msg = "usage: xtl [OPTIONS]" in
-  Arg.parse speclist (fun _ -> ()) usage_msg;
-
-  do_test !debug_level
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 39 lines · Andrew Cooper

There are significant issues with these bindings, and their companion half in Xapi was deleted in 2018

https://github.com/xapi-project/xen-api/commit/203292ebe0c487d7ae4adb961a6d080f4fbe933d

owing to there having been no development of these bindings since 2014.

In the unlikely event that we'd want to reinstate them, they'd need reworking basically from scratch anyway.

---
CC: Christian Lindig <[email protected]>
CC: David Scott <[email protected]>
CC: Edwin Török <[email protected]>
CC: Rob Hoes <[email protected]>

I'm unsure whether to drop xentoollog. They're technically orphaned by this change, but could be used in principle by the other bindings.
---

tools/ocaml/Makefile                 |    4 -
tools/ocaml/libs/Makefile            |    2 +-
tools/ocaml/libs/xl/META.in          |    5 -
tools/ocaml/libs/xl/Makefile         |   71 --
tools/ocaml/libs/xl/genwrap.py       |  582 ------------
tools/ocaml/libs/xl/xenlight.ml.in   |   94 --
tools/ocaml/libs/xl/xenlight.mli.in  |   93 --
tools/ocaml/libs/xl/xenlight_stubs.c | 1663 ----------------------------------
tools/ocaml/test/Makefile            |   55 --
tools/ocaml/test/dmesg.ml            |   17 -
tools/ocaml/test/list_domains.ml     |   26 -
tools/ocaml/test/raise_exception.ml  |    9 -
tools/ocaml/test/send_debug_keys.ml  |   13 -
tools/ocaml/test/xtl.ml              |   39 -
14 files changed, 1 insertion(+), 2672 deletions(-)
Quoted 13 lines

delete mode 100644 tools/ocaml/libs/xl/META.in delete mode 100644 tools/ocaml/libs/xl/Makefile delete mode 100644 tools/ocaml/libs/xl/genwrap.py delete mode 100644 tools/ocaml/libs/xl/xenlight.ml.in delete mode 100644 tools/ocaml/libs/xl/xenlight.mli.in delete mode 100644 tools/ocaml/libs/xl/xenlight_stubs.c delete mode 100644 tools/ocaml/test/Makefile delete mode 100644 tools/ocaml/test/dmesg.ml delete mode 100644 tools/ocaml/test/list_domains.ml delete mode 100644 tools/ocaml/test/raise_exception.ml delete mode 100644 tools/ocaml/test/send_debug_keys.ml delete mode 100644 tools/ocaml/test/xtl.ml

#2 lore raw
In reply to Andrew Cooper
Quoted 11 lines · Andrew Cooper

There are significant issues with these bindings, and their companion half in Xapi was deleted in 2018

https://github.com/xapi-project/xen-api/commit/203292ebe0c487d7ae4adb961a6d080f4fbe933d

owing to there having been no development of these bindings since 2014.

In the unlikely event that we'd want to reinstate them, they'd need reworking basically from scratch anyway.

Quoted 8 lines

---
CC: Christian Lindig <[email protected]>
CC: David Scott <[email protected]>
CC: Edwin Török <[email protected]>
CC: Rob Hoes <[email protected]>

I'm unsure whether to drop xentoollog. They're technically orphaned by this change, but could be used in principle by the other bindings.

It turns out that the xentoollog bindings segfault anyway, and are an an equal state of disrepair to the libxl bindings.  In agreement with Edvin and Christian, I've dropped them too in this change, but I won't bother reposting an extra several thousand line deletion.

~Andrew

#3 lore raw
Quoted 25 lines · Andrew Cooper
Quoted 11 lines · Andrew Cooper

There are significant issues with these bindings, and their companion half in Xapi was deleted in 2018

https://github.com/xapi-project/xen-api/commit/203292ebe0c487d7ae4adb961a6d080f4fbe933d

owing to there having been no development of these bindings since 2014.

In the unlikely event that we'd want to reinstate them, they'd need reworking basically from scratch anyway.

Quoted 8 lines

---
CC: Christian Lindig <[email protected]>
CC: David Scott <[email protected]>
CC: Edwin Török <[email protected]>
CC: Rob Hoes <[email protected]>

I'm unsure whether to drop xentoollog. They're technically orphaned by this change, but could be used in principle by the other bindings.

Quoted 6 lines

It turns out that the xentoollog bindings segfault anyway, and are an an equal state of disrepair to the libxl bindings. In agreement with Edvin and Christian, I've dropped them too in this change, but I won't bother reposting an extra several thousand line deletion.

~Andrew