From nobody Tue Nov 11 06:54:13 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1568996416; cv=none; d=zoho.com; s=zohoarc; b=bhsy4fNI3V3+D7Zu242tLzSl4X36TjS7YbKlo3sZkmYW1U47yS/6GbYfLti98pGSZiyB4ABvnHeb/0cjN1Nc5bImG0iInXB52AiruN86aZt9ZDxywtnD0RiloeBXXdnW53SzMPSCg+2w/Zta1DV48lzhSPFJnQPOAb5IB2KeGeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568996416; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=14Lxsf1MHUo00x2rxUtVEUGCcXXdTOURx6SVwOoJi7s=; b=dPFrt9sJEknWyGA5E8kththysUQsWRVRcQhtdxNDjFUq7o/elEXo0r36k7dE3ASlWxU0jXFBHZbMeexfTpr4kD+CqOxEn/mKn0JJ6nUIk9Fm71+SUgMI08xMKQGJT4LACtFc7X80uCgv6YU1SS+UVPIHOcLogaWbRXFFqsNQaP8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1568996416115482.6042334104078; Fri, 20 Sep 2019 09:20:16 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iBLch-0008IS-SW; Fri, 20 Sep 2019 16:19:07 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iBLcg-0008IN-Hb for xen-devel@lists.xenproject.org; Fri, 20 Sep 2019 16:19:06 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5d7af7d8-dbc2-11e9-9597-12813bfff9fa; Fri, 20 Sep 2019 16:19:05 +0000 (UTC) X-Inumbo-ID: 5d7af7d8-dbc2-11e9-9597-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1568996346; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=stCqnNB4JBrXmMUlv51cntYfgeLmB+J54lSVrwG+vO4=; b=BMxv/X0ZIeWA8XyWBAw/O46iJ36Bnvnf4QnwV4GrJ5IM6C8MuCltnC1I 8rgrt8vVoAfzlWFSMovHMYcsRrhUEFDAGXPjloRkL0y9vC18+Y5cczjNx 8oFaHYN0J6SXcDxmmrpKrNz/6Gx6DkeWplxTAz9U3jI/dnwSTDwjDHknw A=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 7wyLFNiHZrHYjM4Pt6TddFXsjfDd53da53pKh/5D+H2QX9xbbV93Oa9fz17zL0q3pf9EWd5tAj nbqYwEeVZGkHPhzqYuv94YMnAID6xz5P/iSRnoFKbI9LDL2y43MDRtFmcw0RiI1yKlKUWIUbel 3Rq6jR+YbLaW5Qzqq6KRZhVDLFMWWSwnF9MiSIF21pPyCX8lEGRNRJZ1KtyzW0deOS/nWWZtx8 9upUYjqxGjoNwA4mFVdIQlSBFBXUVoby+y5xmX/8Z438dK2MDq6HL60uEaIYndvDqvMiNC1r/w Hrc= X-SBRS: 2.7 X-MesageID: 5856485 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,529,1559534400"; d="scan'208";a="5856485" From: Anthony PERARD To: Date: Fri, 20 Sep 2019 17:19:02 +0100 Message-ID: <20190920161902.1353598-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] tools/ocaml: Build fix following libxl API changes X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Christian Lindig , Wei Liu , David Scott Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- Notes: Currently, all libxl API that takes an `ao_how` have `?async:'a -> unit` in the ocaml definition (and an extra unused value unit in the c stub file), is that `unit` needed ? =20 I tried to add it, but then for stub_xl_send_trigger() I had to use CAMLparam6, and that doesn't exist. tools/ocaml/libs/xl/xenlight.ml.in | 6 +++--- tools/ocaml/libs/xl/xenlight.mli.in | 6 +++--- tools/ocaml/libs/xl/xenlight_stubs.c | 27 ++++++++++++++++++--------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/tools/ocaml/libs/xl/xenlight.ml.in b/tools/ocaml/libs/xl/xenli= ght.ml.in index 80e620a9be66..954e56fc740b 100644 --- a/tools/ocaml/libs/xl/xenlight.ml.in +++ b/tools/ocaml/libs/xl/xenlight.ml.in @@ -41,10 +41,10 @@ module Domain =3D struct external reboot : ctx -> domid -> unit =3D "stub_libxl_domain_reboot" external destroy : ctx -> domid -> ?async:'a -> unit -> unit =3D "stub_li= bxl_domain_destroy" external suspend : ctx -> domid -> Unix.file_descr -> ?async:'a -> unit -= > unit =3D "stub_libxl_domain_suspend" - external pause : ctx -> domid -> unit =3D "stub_libxl_domain_pause" - external unpause : ctx -> domid -> unit =3D "stub_libxl_domain_unpause" + external pause : ctx -> domid -> ?async:'a -> unit =3D "stub_libxl_domain= _pause" + external unpause : ctx -> domid -> ?async:'a -> unit =3D "stub_libxl_doma= in_unpause" =20 - external send_trigger : ctx -> domid -> trigger -> int -> unit =3D "stub_= xl_send_trigger" + external send_trigger : ctx -> domid -> trigger -> int -> ?async:'a -> un= it =3D "stub_xl_send_trigger" external send_sysrq : ctx -> domid -> char -> unit =3D "stub_xl_send_sysr= q" end =20 diff --git a/tools/ocaml/libs/xl/xenlight.mli.in b/tools/ocaml/libs/xl/xenl= ight.mli.in index b2c06b5eed76..c08304ae8b01 100644 --- a/tools/ocaml/libs/xl/xenlight.mli.in +++ b/tools/ocaml/libs/xl/xenlight.mli.in @@ -43,10 +43,10 @@ module Domain : sig external reboot : ctx -> domid -> unit =3D "stub_libxl_domain_reboot" external destroy : ctx -> domid -> ?async:'a -> unit -> unit =3D "stub_li= bxl_domain_destroy" external suspend : ctx -> domid -> Unix.file_descr -> ?async:'a -> unit -= > unit =3D "stub_libxl_domain_suspend" - external pause : ctx -> domid -> unit =3D "stub_libxl_domain_pause" - external unpause : ctx -> domid -> unit =3D "stub_libxl_domain_unpause" + external pause : ctx -> domid -> ?async:'a -> unit =3D "stub_libxl_domain= _pause" + external unpause : ctx -> domid -> ?async:'a -> unit =3D "stub_libxl_doma= in_unpause" =20 - external send_trigger : ctx -> domid -> trigger -> int -> unit =3D "stub_= xl_send_trigger" + external send_trigger : ctx -> domid -> trigger -> int -> ?async:'a -> un= it =3D "stub_xl_send_trigger" external send_sysrq : ctx -> domid -> char -> unit =3D "stub_xl_send_sysr= q" end =20 diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c b/tools/ocaml/libs/xl/xen= light_stubs.c index 0140780a342e..37b046df6351 100644 --- a/tools/ocaml/libs/xl/xenlight_stubs.c +++ b/tools/ocaml/libs/xl/xenlight_stubs.c @@ -622,32 +622,38 @@ value stub_libxl_domain_suspend(value ctx, value domi= d, value fd, value async, v CAMLreturn(Val_unit); } =20 -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 =3D Int_val(domid); + libxl_asyncop_how *ao_how =3D aohow_val(async); =20 caml_enter_blocking_section(); - ret =3D libxl_domain_pause(CTX, c_domid); + ret =3D libxl_domain_pause(CTX, c_domid, ao_how); caml_leave_blocking_section(); =20 + free(ao_how); + if (ret !=3D 0) failwith_xl(ret, "domain_pause"); =20 CAMLreturn(Val_unit); } =20 -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 =3D Int_val(domid); + libxl_asyncop_how *ao_how =3D aohow_val(async); =20 caml_enter_blocking_section(); - ret =3D libxl_domain_unpause(CTX, c_domid); + ret =3D libxl_domain_unpause(CTX, c_domid, ao_how); caml_leave_blocking_section(); =20 + free(ao_how); + if (ret !=3D 0) failwith_xl(ret, "domain_unpause"); =20 @@ -1031,20 +1037,23 @@ value stub_xl_domain_sched_params_set(value ctx, va= lue domid, value scinfo) CAMLreturn(Val_unit); } =20 -value stub_xl_send_trigger(value ctx, value domid, value trigger, value vc= puid) +value stub_xl_send_trigger(value ctx, value domid, value trigger, value vc= puid, value async) { - CAMLparam4(ctx, domid, trigger, vcpuid); + CAMLparam5(ctx, domid, trigger, vcpuid, async); int ret; uint32_t c_domid =3D Int_val(domid); libxl_trigger c_trigger =3D LIBXL_TRIGGER_UNKNOWN; int c_vcpuid =3D Int_val(vcpuid); + libxl_asyncop_how *ao_how =3D aohow_val(async); =20 trigger_val(CTX, &c_trigger, trigger); =20 caml_enter_blocking_section(); - ret =3D libxl_send_trigger(CTX, c_domid, c_trigger, c_vcpuid); + ret =3D libxl_send_trigger(CTX, c_domid, c_trigger, c_vcpuid, ao_how); caml_leave_blocking_section(); =20 + free(ao_how); + if (ret !=3D 0) failwith_xl(ret, "send_trigger"); =20 --=20 Anthony PERARD _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel