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

[PATCH v1 05/19] xen/sysctl: wrap around XEN_SYSCTL_sched_id


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Wed, 12 Mar 2025 12:06:18 +0800
  • 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 (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=MulITfmVWa9VrAVpSfm2qWFDXdm5/Mzq9x+66kMeZ7g=; b=mMpA6DUnPQoNbNpliA33T+ZAPtSswrb8Sp2PnhEcqpmm7yvcY/GXzCWcWMBcLZvRlcoCeygKK8zsGkYQrKwbutRC1nuKCuZCsWcwnMxmizmYWtgj2yTZ5XcfzntP06iACdl++/Ho+xhDKWrjgI+yYP2hT08Y/ZWJhho7LOEI0pyGU6MzQccrrmM9broJX5/yeV9A+qx5LGOkbTQLQwReaY5oDhn+ogekp6Xmlx/qUfETITojinfUtwB6p1abxlyUkDZNzcLR8oS2vnjsVzPRX3llR3TH8YnrcdPiRcOKcjpLn7YmfzythLu3IjhTRToUoF38VBOgQjbB/gNpJPpDYw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZSmlVcRQhYFo2TKTDFfb5Umk/3L9lW135zemp2Zag00QgFHqtCySlg3U6k5snHdfh2qjXIUIxW1YYiBD8HaCY7uyJ4iNEz7O/D7Zbx8eaM/KbO3v44mJgba0JxntQ9xh2VwVaaI05bAkcERjpmp0rZ43lgGreol6/riWq4XGQ5CjALqLBM9tI/tv5NK74hhgZCZi5yUEB/ED8RkIOrot2TsJRyQ6qCXA3C+Wbo9Isk7kJTIc/sE96s8M5S2NsVqqXKTeEtYU/jc+5XpAE/0q3n+tUd4qFPrhop6c13Qv1nxUv4LSEqmkMZjrK0YF85oAQmfCcQitMXH4l6bUjekxyQ==
  • Cc: <ray.huang@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <gwd@xxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "Anthony PERARD" <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 12 Mar 2025 04:07:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The following function shall be wrapped:
- scheduler_id

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
---
 xen/common/sched/core.c | 2 ++
 xen/include/xen/sched.h | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index d6296d99fd..ea452d8b3e 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -2052,11 +2052,13 @@ long do_set_timer_op(s_time_t timeout)
     return 0;
 }
 
+#ifdef CONFIG_SYSCTL
 /* scheduler_id - fetch ID of current scheduler */
 int scheduler_id(void)
 {
     return operations.sched_id;
 }
+#endif
 
 /* Adjust scheduling parameter for a given domain. */
 long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 559d201e0c..9bdeb85aa4 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -849,7 +849,14 @@ int  sched_init_domain(struct domain *d, unsigned int 
poolid);
 void sched_destroy_domain(struct domain *d);
 long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op);
 long sched_adjust_global(struct xen_sysctl_scheduler_op *op);
+#ifdef CONFIG_SYSCTL
 int  scheduler_id(void);
+#else
+static inline int scheduler_id(void)
+{
+    return -EOPNOTSUPP;
+}
+#endif
 
 /*
  * sched_get_id_by_name - retrieves a scheduler id given a scheduler name
-- 
2.34.1




 


Rackspace

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