]> xenbits.xensource.com Git - people/hx242/xen.git/commitdiff
tools/ocaml: Build fix following libxl API changes
authorAnthony PERARD <anthony.perard@citrix.com>
Fri, 20 Sep 2019 16:19:02 +0000 (17:19 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Mon, 23 Sep 2019 10:14:41 +0000 (11:14 +0100)
The following libxl API became asynchronous and gained an additional
`ao_how' parameter:
    libxl_domain_pause()
    libxl_domain_unpause()
    libxl_send_trigger()

Adapt the ocaml binding.

Build tested only.

Fixes: edaa631ddcee665cdfae1cf6bc7492c791e01ef4
Fixes: 95627b87c3159928458ee586e8c5c593bdd248d8
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/ocaml/libs/xl/xenlight.ml.in
tools/ocaml/libs/xl/xenlight.mli.in
tools/ocaml/libs/xl/xenlight_stubs.c

index 80e620a9be66cc9691ed5b67f94ab3f6e833d068..954e56fc740b1018e9881a9241b17edfedd8b02c 100644 (file)
@@ -41,10 +41,10 @@ module Domain = struct
        external reboot : ctx -> domid -> unit = "stub_libxl_domain_reboot"
        external destroy : ctx -> domid -> ?async:'a -> unit -> unit = "stub_libxl_domain_destroy"
        external suspend : ctx -> domid -> Unix.file_descr -> ?async:'a -> unit -> unit = "stub_libxl_domain_suspend"
-       external pause : ctx -> domid -> unit = "stub_libxl_domain_pause"
-       external unpause : ctx -> domid -> unit = "stub_libxl_domain_unpause"
+       external pause : ctx -> domid -> ?async:'a -> unit = "stub_libxl_domain_pause"
+       external unpause : ctx -> domid -> ?async:'a -> unit = "stub_libxl_domain_unpause"
 
-       external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
+       external send_trigger : ctx -> domid -> trigger -> int -> ?async:'a -> unit = "stub_xl_send_trigger"
        external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
 end
 
index b2c06b5eed7674d8096f937649f076c40ea3db66..c08304ae8b01def6420778c20de692b3808dbad9 100644 (file)
@@ -43,10 +43,10 @@ module Domain : sig
        external reboot : ctx -> domid -> unit = "stub_libxl_domain_reboot"
        external destroy : ctx -> domid -> ?async:'a -> unit -> unit = "stub_libxl_domain_destroy"
        external suspend : ctx -> domid -> Unix.file_descr -> ?async:'a -> unit -> unit = "stub_libxl_domain_suspend"
-       external pause : ctx -> domid -> unit = "stub_libxl_domain_pause"
-       external unpause : ctx -> domid -> unit = "stub_libxl_domain_unpause"
+       external pause : ctx -> domid -> ?async:'a -> unit = "stub_libxl_domain_pause"
+       external unpause : ctx -> domid -> ?async:'a -> unit = "stub_libxl_domain_unpause"
 
-       external send_trigger : ctx -> domid -> trigger -> int -> unit = "stub_xl_send_trigger"
+       external send_trigger : ctx -> domid -> trigger -> int -> ?async:'a -> unit = "stub_xl_send_trigger"
        external send_sysrq : ctx -> domid -> char -> unit = "stub_xl_send_sysrq"
 end
 
index 0140780a342ecaf3985303a7fd39bcc2a40616cc..37b046df6351309fe285266c32d2ff849eb09ad8 100644 (file)
@@ -622,32 +622,38 @@ value stub_libxl_domain_suspend(value ctx, value domid, value fd, value async, v
        CAMLreturn(Val_unit);
 }
 
-value stub_libxl_domain_pause(value ctx, value domid)
+value stub_libxl_domain_pause(value ctx, value domid, value async)
 {
-       CAMLparam2(ctx, domid);
+       CAMLparam3(ctx, domid, async);
        int ret;
        uint32_t c_domid = Int_val(domid);
+       libxl_asyncop_how *ao_how = aohow_val(async);
 
        caml_enter_blocking_section();
-       ret = libxl_domain_pause(CTX, c_domid);
+       ret = libxl_domain_pause(CTX, c_domid, ao_how);
        caml_leave_blocking_section();
 
+       free(ao_how);
+
        if (ret != 0)
                failwith_xl(ret, "domain_pause");
 
        CAMLreturn(Val_unit);
 }
 
-value stub_libxl_domain_unpause(value ctx, value domid)
+value stub_libxl_domain_unpause(value ctx, value domid, value async)
 {
-       CAMLparam2(ctx, domid);
+       CAMLparam3(ctx, domid, async);
        int ret;
        uint32_t c_domid = Int_val(domid);
+       libxl_asyncop_how *ao_how = aohow_val(async);
 
        caml_enter_blocking_section();
-       ret = libxl_domain_unpause(CTX, c_domid);
+       ret = libxl_domain_unpause(CTX, c_domid, ao_how);
        caml_leave_blocking_section();
 
+       free(ao_how);
+
        if (ret != 0)
                failwith_xl(ret, "domain_unpause");
 
@@ -1031,20 +1037,23 @@ value stub_xl_domain_sched_params_set(value ctx, value domid, value scinfo)
        CAMLreturn(Val_unit);
 }
 
-value stub_xl_send_trigger(value ctx, value domid, value trigger, value vcpuid)
+value stub_xl_send_trigger(value ctx, value domid, value trigger, value vcpuid, value async)
 {
-       CAMLparam4(ctx, domid, trigger, vcpuid);
+       CAMLparam5(ctx, domid, trigger, vcpuid, async);
        int ret;
        uint32_t c_domid = Int_val(domid);
        libxl_trigger c_trigger = LIBXL_TRIGGER_UNKNOWN;
        int c_vcpuid = Int_val(vcpuid);
+       libxl_asyncop_how *ao_how = aohow_val(async);
 
        trigger_val(CTX, &c_trigger, trigger);
 
        caml_enter_blocking_section();
-       ret = libxl_send_trigger(CTX, c_domid, c_trigger, c_vcpuid);
+       ret = libxl_send_trigger(CTX, c_domid, c_trigger, c_vcpuid, ao_how);
        caml_leave_blocking_section();
 
+       free(ao_how);
+
        if (ret != 0)
                failwith_xl(ret, "send_trigger");