From: Uma Sharma Subject: [OPW PATCH] tools/xl: Call init function for libxl_domain_sched_params Date: Fri, 17 Oct 2014 04:11:33 +0530 Message-ID: <544049a4.8937460a.770a.6430@mx.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: George.Dunlap@eu.citrix.com, Ian.Jackson@citrix.com, Wei.Liu2@citrix.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org 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 --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index c734f79..d214cbd 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -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;