Skip to contentSkip to conversation

tools/xl: Call init function for libxl_domain_sched_params

PATCH Superseded Uma Sharma 2 participants 2 messages Oct 16, 2014 – Oct 17, 2014

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Uma Sharma

author
#0 lore raw

PATCH 1/1 tools/xl: Call init function for libxl_domain_sched_params

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.

---

tools/libxl/xl_cmdimpl.c +6 -0
index c734f79..d214cbd 100644
@@ -5215,6 +5215,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;
@@ -5261,6 +5263,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;
@@ -5286,6 +5290,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;
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Uma Sharma

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.

The commit log line is too long. We normally have 72 or 80 column per line.

I don't think you need to resend this patch just to reformat commit log. But it would be better to configure your editor to line-wrap automatically for you in the future.

Quoted 1 line

Thanks for your contribution!

Wei.