[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tools/xl: Guard main_dt_overlay() with LIBXL_HAVE_DT_OVERLAY


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 6 Sep 2023 10:36:14 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2N9qman4jPoFedFZdZwqNPAoopTV8srge1tPN9OvOTw=; b=OCfXYgvOsLkQ5MatLusUdv+JuAd5xAznjt0j/2JdYsPVu1kI7MccRL8LpNJKxYzxpgnzuW2qoLa3EOf3UDZuzEv2CZ9a44MeMQVAUEmhv6W+gmw1i3+Yz+xikYqlV+GgOIFseODekindF8wtZguDcDL1Yg6S2wZa8PWeEbl6cAzrjWJkmns7+kEJZxvR8JC09OQgd61chZ5Uw11dOaEktJufLj3Js+mPbV1rZakKvyfebE9GWeuw5oO6LAUDVHgcnhspARK672tbpey3k7i1E/PVmaNc9HAlbJVZrmAmHcALPQVx0+yMY7HGbGQ2T52WrZJRKpQGif98OgQ08sOzEQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T9+CgbifMdb0JZ2kJyJRPYodmoIloX7XVEH6Rql4vVEiKtzEdT1Gj4ph398guFJRYch1AzcXoL1WtTDgLrCJ4PYtD2s4CN/of+nnPPE4l0sOzHDML8PCuD6Astzb0rW7v8lsnHHyL0cqShBYU19q01a4t0TkWxrv3StrJiaZHZks42L4ML0lt+clhGQfP0GfYYrlQN+h8Rzn1ypD4+9uIzu4BC0iQ0KZHRji8YyK4b1PFkDS7XV34QvEq882Miq/6oOI7fLB6YMcNic09kZlLIbbj/Kvuwo+3QMHSf7YFaHpQcI3iDZm+bLki2jRLBPOcYxwaqGYTm/EauewDM4TwA==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, <jbeulich@xxxxxxxx>, <stefano.stabellini@xxxxxxx>, <vikram.garhwal@xxxxxxx>
  • Delivery-date: Wed, 06 Sep 2023 08:36:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

main_dt_overlay() makes a call to libxl_dt_overlay() which is for now
only compiled for Arm. This causes the build failure as reported by
gitlab CI and OSSTEST. Fix it by guarding the function, prototype and
entry in cmd_table[] using LIBXL_HAVE_DT_OVERLAY. This has an advantage
over regular Arm guard so that the code will not need to be modified again
if other architecture gain support for this feature.

Fixes: 61765a07e3d8 ("tools/xl: Add new xl command overlay for device tree 
overlay support")
Reported-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
There are still other parts of dt overlay support in toolstack that would
want to be revisited in order to use guards suitable to be used by other
arches.
---
 tools/xl/xl.h           | 2 ++
 tools/xl/xl_cmdtable.c  | 2 ++
 tools/xl/xl_vmcontrol.c | 3 +++
 3 files changed, 7 insertions(+)

diff --git a/tools/xl/xl.h b/tools/xl/xl.h
index a923daccd340..3045b5a8e3f0 100644
--- a/tools/xl/xl.h
+++ b/tools/xl/xl.h
@@ -138,7 +138,9 @@ int main_shutdown(int argc, char **argv);
 int main_reboot(int argc, char **argv);
 int main_list(int argc, char **argv);
 int main_vm_list(int argc, char **argv);
+#ifdef LIBXL_HAVE_DT_OVERLAY
 int main_dt_overlay(int argc, char **argv);
+#endif
 int main_create(int argc, char **argv);
 int main_config_update(int argc, char **argv);
 int main_button_press(int argc, char **argv);
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 2463521156a1..62bdb2aeaa35 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -631,12 +631,14 @@ const struct cmd_spec cmd_table[] = {
       "Issue a qemu monitor command to the device model of a domain",
       "<Domain> <Command>",
     },
+#ifdef LIBXL_HAVE_DT_OVERLAY
     { "dt-overlay",
       &main_dt_overlay, 0, 1,
       "Add/Remove a device tree overlay",
       "add/remove <.dtbo>"
       "-h print this help\n"
     },
+#endif
 };
 
 const int cmdtable_len = ARRAY_SIZE(cmd_table);
diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c
index cea5b4a88e81..98f6bd2e7607 100644
--- a/tools/xl/xl_vmcontrol.c
+++ b/tools/xl/xl_vmcontrol.c
@@ -1265,6 +1265,7 @@ int main_create(int argc, char **argv)
     return 0;
 }
 
+#ifdef LIBXL_HAVE_DT_OVERLAY
 int main_dt_overlay(int argc, char **argv)
 {
     const char *overlay_ops = NULL;
@@ -1317,6 +1318,8 @@ int main_dt_overlay(int argc, char **argv)
 
     return rc;
 }
+#endif
+
 /*
  * Local variables:
  * mode: C
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.