[PATCH 3/7] xen/sched: credit2: migrate to new sched_ops

Furkan Caliskan <[email protected]> Mon, 3 Aug 2026 08:06:10 +0300
Newsgroups gmane.comp.emulators.xen.devel
Message-ID <[email protected]>
Declare sched_credit2_def as a struct sched_ops instead of a struct
scheduler, dropping the .sched_data field, and register it with
REGISTER_SCHED_OPS() so it is found through sched_ops_array[]
instead of schedulers[].

This moves the credit2 scheduler onto the new sched_ops
registration path.

Signed-off-by: Furkan Caliskan <[email protected]>
---
 xen/common/sched/credit2.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 95946634d1..9bcc90004a 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -4230,11 +4230,10 @@ csched2_deinit(struct scheduler *ops)
     xfree(prv);
 }
 
-static const struct scheduler sched_credit2_def = {
+static const struct sched_ops sched_credit2_def = {
     .name           = "SMP Credit Scheduler rev2",
     .opt_name       = "credit2",
     .sched_id       = XEN_SCHEDULER_CREDIT2,
-    .sched_data     = NULL,
 
     .global_init    = csched2_global_init,
 
@@ -4269,4 +4268,4 @@ static const struct scheduler sched_credit2_def = {
     .free_domdata   = csched2_free_domdata,
 };
 
-REGISTER_SCHEDULER(sched_credit2_def);
+REGISTER_SCHED_OPS(sched_credit2_def);
-- 
2.34.1