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

Re: [Xen-devel] [PATCH 4 of 5 V2] libxl: move libxl__sched_set_params into libxl.c



On 29/05/12 14:57, Ian Campbell wrote:
# HG changeset patch
# User Ian Campbell<ian.campbell@xxxxxxxxxx>
# Date 1338299813 -3600
# Node ID d89b5eeb94519fdc056f91663676cf012c40b654
# Parent  274de8e1e0d116070d34731d93b53ce44530e5a0
libxl: move libxl__sched_set_params into libxl.c

All the other sched functions are here and I'm just about to make those static
functions as I make libxl__sched_set_params the public function.

Signed-off-by: Ian Campbell<ian.campbell@xxxxxxxxxx>
Acked-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

diff -r 274de8e1e0d1 -r d89b5eeb9451 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue May 29 14:55:29 2012 +0100
+++ b/tools/libxl/libxl.c       Tue May 29 14:56:53 2012 +0100
@@ -3450,6 +3450,33 @@ int libxl_sched_sedf_domain_set(libxl_ct
      return 0;
  }

+int libxl__sched_set_params(libxl__gc *gc, uint32_t domid,
+                            libxl_domain_sched_params *scparams)
+{
+    libxl_scheduler sched = scparams->sched;
+    int ret;
+
+    if (sched == LIBXL_SCHEDULER_UNKNOWN)
+        sched = libxl__domain_scheduler(gc, domid);
+
+    switch (sched) {
+    case LIBXL_SCHEDULER_SEDF:
+        ret=libxl_sched_sedf_domain_set(CTX, domid, scparams);
+        break;
+    case LIBXL_SCHEDULER_CREDIT:
+        ret=libxl_sched_credit_domain_set(CTX, domid, scparams);
+        break;
+    case LIBXL_SCHEDULER_CREDIT2:
+        ret=libxl_sched_credit2_domain_set(CTX, domid, scparams);
+        break;
+    default:
+        LOG(ERROR, "Unknown scheduler");
+        ret=ERROR_INVAL;
+        break;
+    }
+    return ret;
+}
+
  int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid,
                         libxl_trigger trigger, uint32_t vcpuid)
  {
diff -r 274de8e1e0d1 -r d89b5eeb9451 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Tue May 29 14:55:29 2012 +0100
+++ b/tools/libxl/libxl_dom.c   Tue May 29 14:56:53 2012 +0100
@@ -42,33 +42,6 @@ libxl_domain_type libxl__domain_type(lib
          return LIBXL_DOMAIN_TYPE_PV;
  }

-int libxl__sched_set_params(libxl__gc *gc, uint32_t domid,
-                            libxl_domain_sched_params *scparams)
-{
-    libxl_scheduler sched = scparams->sched;
-    int ret;
-
-    if (sched == LIBXL_SCHEDULER_UNKNOWN)
-        sched = libxl__domain_scheduler(gc, domid);
-
-    switch (sched) {
-    case LIBXL_SCHEDULER_SEDF:
-        ret=libxl_sched_sedf_domain_set(CTX, domid, scparams);
-        break;
-    case LIBXL_SCHEDULER_CREDIT:
-        ret=libxl_sched_credit_domain_set(CTX, domid, scparams);
-        break;
-    case LIBXL_SCHEDULER_CREDIT2:
-        ret=libxl_sched_credit2_domain_set(CTX, domid, scparams);
-        break;
-    default:
-        LOG(ERROR, "Unknown scheduler");
-        ret=ERROR_INVAL;
-        break;
-    }
-    return ret;
-}
-
  int libxl__domain_shutdown_reason(libxl__gc *gc, uint32_t domid)
  {
      libxl_ctx *ctx = libxl__gc_owner(gc);


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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