From patchwork Thu Aug 22 09:06:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Sultanov X-Patchwork-Id: 13773038 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5579DC3DA4A for ; Thu, 22 Aug 2024 09:08:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.781621.1191108 (Exim 4.92) (envelope-from ) id 1sh3nK-00035K-Ax; Thu, 22 Aug 2024 09:07:50 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 781621.1191108; Thu, 22 Aug 2024 09:07:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sh3nK-00035D-7H; Thu, 22 Aug 2024 09:07:50 +0000 Received: by outflank-mailman (input) for mailman id 781621; Thu, 22 Aug 2024 09:06:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sh3m8-00031f-US for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 09:06:36 +0000 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [2a00:1450:4864:20::630]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id d4a99749-6065-11ef-8776-851b0ebba9a2; Thu, 22 Aug 2024 11:06:34 +0200 (CEST) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a86859e2fc0so70576166b.3 for ; Thu, 22 Aug 2024 02:06:34 -0700 (PDT) Received: from EMEAENGAAD87503.citrite.net ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a868f2e6717sm88948266b.96.2024.08.22.02.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 02:06:33 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d4a99749-6065-11ef-8776-851b0ebba9a2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1724317594; x=1724922394; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=nlhcotXPcm3V0aCfa011qTB8OJqHN9ilqhFJWLxdY/g=; b=KJCo6U1tYO+C1kGdV0pkk2tn+qanO2c+rII5qM/crBclMUf7ypj0H228TxAun1PQQL sxIB9uTATSUQcvU5wfS0j7qmW69/fqp8QOaBmlceeT6PSlurI/jJbkR8NGuILGWqj9fw 9HpKFVUksbCh3X8T0KhkHhlE+hS4Orjy8aYs8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724317594; x=1724922394; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nlhcotXPcm3V0aCfa011qTB8OJqHN9ilqhFJWLxdY/g=; b=C+Sj12tOmX1cm5L41VNyS3DHhVTO/bAtwzWEwYaK5lLOzt60ZQ2LqLzNvQ1YdbdCgu OAfSy7XGDQq1uNLxM1hIBvpPTxZFsAKL8/8hww9hpR0VZn7NMqHPLdga5N24gyXI86WU gDGRUwHuUM1rKdV2u/wsqMnohnJUrAqOPevFT9Dhd8rVga/DFEZLQ7aG4BxJcUbHAYTa TAgTs7R8U6eOA+3UpWG7HV43XFfMEIiFxwF2O8f7Zu0fSPjmPzNwdnUXWd1s+nXnwrxx Umwql4hINUniHBCI+ipauP9PZ62Td6VW2kXMDExWw8VT/Je7j0d8i31hqNaMMKPQ1gG4 j1aA== X-Gm-Message-State: AOJu0YwQ5qYQrr6PyeDOosZo1V2uj/c/8IklKBtI9AANBJ8bJ3Tel9Ow 44vcDd0V2sduDPC+kthm3140I+GTVevVKfAfXWr6FSOOHm5qjgcDRAOMm3kaHXAvE2Bk6qvuq/j 4Iu8= X-Google-Smtp-Source: AGHT+IEiB7layv7P6SORlBAgpx54WlOYrTLxhW+HkUgimcpsGyORfLMAuVC3gSPgQHKAWe/P+qIKkA== X-Received: by 2002:a17:907:7e84:b0:a86:7fc2:398b with SMTP id a640c23a62f3a-a867fc2493emr305094366b.15.1724317593805; Thu, 22 Aug 2024 02:06:33 -0700 (PDT) From: Andrii Sultanov To: xen-devel@lists.xenproject.org Cc: Andrii Sultanov , Christian Lindig , David Scott , Anthony PERARD , Andrew Cooper , Jan Beulich , Julien Grall , Stefano Stabellini Subject: [PATCH v1 0/4] Stabilize Oxenstored's interface with Date: Thu, 22 Aug 2024 10:06:01 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Oxenstored depends on unstable Xenctrl, utilizing only a few of its functions. This patch series introduces a dynamically-loaded OCaml plugin that aims to stabilize 'Xenctrl.domain_getinfo' and 'Xenctrl.domain_getinfolist' by hiding the instability behind a versioned interface. This, in turn, would allow to fork Oxenstored out of the xen tree, speeding up its development and allowing it to transition to an OCaml-standard build system. This is only one step towards the long-term goal of being able to drop libxenctrl: https://gitlab.com/xen-project/xen/-/issues/190 Commits and notes further in the patches explain the exact mechanism behind this. I've tested this oxenstored with a V2 interface and plugin, with V1 plugin continuing to be compiled, loaded, and working correctly. A dynamic-loading approach was chosen because it allows one to easily review the remaining usages of Xenctrl and does not force oxenstored to be recompiled every time xen changes. This patch series passed the Gitlab CI (https://gitlab.com/xen-project/people/asultanov/xen/-/pipelines/1421643375), and was further tested on some hosts. Oxenstored currently uses the single-domain 'domain_getinfo' function, whereas Cxenstored uses the more-efficient 'domain_getinfolist'. Both of these are provided in the plugin to allow a transition from one to the other without modifying the interface in the future. A prototype of oxenstored using domain_getinfolist was also developed, though it is not a part of the current patch series. It also passed the Gitlab CI and was tested on hosts. (https://gitlab.com/xen-project/people/asultanov/xen/-/pipelines/1421686622) A Gitlab repository with these patches applied, if it's easier for anyone to review it on there: https://gitlab.com/xen-project/people/asultanov/xen/-/compare/staging...staging?from_project_id=2336572 Andrii Sultanov (4): tools/ocaml/common.make: Remove '-cc $(CC)' flag from OCAMLOPTFLAGS ocaml/libs: Implement a dynamically-loaded plugin for Xenctrl.domain_getinfo tools/oxenstored: Use the plugin for Xenctrl.domain_getinfo Makefile.rules: Fix OCaml libs Config.mk | 2 +- configure | 7 + m4/paths.m4 | 4 + tools/configure | 7 + tools/ocaml/Makefile | 1 + tools/ocaml/Makefile.rules | 21 ++- tools/ocaml/common.make | 2 +- tools/ocaml/libs/Makefile | 2 +- tools/ocaml/libs/xenstoredglue/META.in | 4 + tools/ocaml/libs/xenstoredglue/Makefile | 39 ++++ .../domain_getinfo_plugin_v1/META.in | 5 + .../domain_getinfo_plugin_v1/Makefile | 38 ++++ .../domain_getinfo_stubs_v1.c | 169 ++++++++++++++++++ .../domain_getinfo_v1.ml | 51 ++++++ .../domain_getinfo_v1.mli | 0 .../libs/xenstoredglue/plugin_interface_v1.ml | 25 +++ .../xenstoredglue/plugin_interface_v1.mli | 34 ++++ tools/ocaml/xenstored/Makefile | 5 +- tools/ocaml/xenstored/domains.ml | 63 +++++-- tools/ocaml/xenstored/paths.ml.in | 1 + 20 files changed, 454 insertions(+), 26 deletions(-) create mode 100644 tools/ocaml/libs/xenstoredglue/META.in create mode 100644 tools/ocaml/libs/xenstoredglue/Makefile create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/META.in create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.ml create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.mli create mode 100644 tools/ocaml/libs/xenstoredglue/plugin_interface_v1.ml create mode 100644 tools/ocaml/libs/xenstoredglue/plugin_interface_v1.mli Acked-by: Christian Lindig