tools/xl: Call init function for libxl_domain_sched_params
authorUma Sharma <uma.sharma523@gmail.com>
Mon, 20 Oct 2014 21:42:11 +0000 (03:12 +0530)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 12 Jan 2015 17:35:44 +0000 (17:35 +0000)
This patch calls init function for libxl_domain_sched_params before
passing it as reference to sched_domain_get() function in
tools/libxl/xl_cmdimpl.c
IDL generated libxl types should be used only after calling the init
function even if the variable is simply being passed by reference as
an output parameter to a libxl function

Signed-off-by: Uma Sharma <uma.sharma523@gmail.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
--

tools/libxl/xl_cmdimpl.c

index ed0d478f8111b08694fcb205d2b6ed3198d57ef7..fb7573e39c9c29b5509723b2ca504dd5d20056ed 100644 (file)
@@ -5387,6 +5387,8 @@ static int sched_credit_domain_output(int domid)
         printf("%-33s %4s %6s %4s\n", "Name", "ID", "Weight", "Cap");
         return 0;
     }
+
+    libxl_domain_sched_params_init(&scinfo);
     rc = sched_domain_get(LIBXL_SCHEDULER_CREDIT, domid, &scinfo);
     if (rc)
         return rc;
@@ -5433,6 +5435,8 @@ static int sched_credit2_domain_output(
         printf("%-33s %4s %6s\n", "Name", "ID", "Weight");
         return 0;
     }
+
+    libxl_domain_sched_params_init(&scinfo);
     rc = sched_domain_get(LIBXL_SCHEDULER_CREDIT2, domid, &scinfo);
     if (rc)
         return rc;
@@ -5458,6 +5462,8 @@ static int sched_sedf_domain_output(
                "Slice", "Latency", "Extra", "Weight");
         return 0;
     }
+
+    libxl_domain_sched_params_init(&scinfo);
     rc = sched_domain_get(LIBXL_SCHEDULER_SEDF, domid, &scinfo);
     if (rc)
         return rc;