From: Uma Sharma <uma.sharma523@gmail.com>
To: xen-devel@lists.xen.org
Cc: George.Dunlap@eu.citrix.com, Ian.Jackson@citrix.com,
Wei.Liu2@citrix.com, Ian.Campbell@citrix.com
Subject: [OPW PATCH V3] tools/xl: Call init function for libxl defined datatypes
Date: Sun, 19 Oct 2014 18:05:01 +0530 [thread overview]
Message-ID: <5443affe.27eb420a.5386.122b@mx.google.com> (raw)
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>
--
Changed since v1:
-Calling _init before using libxl_dominfo type and _dispose after
using in function main_list
-Calling _init for type libxl_bitmap in vcpuset() for cpumap
-Calling _init for type libxl_bitmap in main_cpupoolnumasplit() for cpumap
Signed-off-by: Uma Sharma <uma.sharma523@gmail.com>
--
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index c734f79..057033a 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4330,6 +4330,8 @@ int main_list(int argc, char **argv)
libxl_dominfo *info, *info_free=0;
int nb_domain, rc;
+ libxl_dominfo_init(&info_buf);
+
SWITCH_FOREACH_OPT(opt, "lvhZn", opts, "list", 0) {
case 'l':
details = 1;
@@ -4381,6 +4383,7 @@ int main_list(int argc, char **argv)
else
libxl_dominfo_dispose(info);
+ libxl_dominfo_dispose(&info_buf);
return 0;
}
@@ -4844,6 +4847,8 @@ static void vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
unsigned int max_vcpus, i;
libxl_bitmap cpumap;
+ libxl_bitmap_init(&cpumap);
+
max_vcpus = strtoul(nr_vcpus, &endptr, 10);
if (nr_vcpus == endptr) {
fprintf(stderr, "Error: Invalid argument.\n");
@@ -5215,6 +5220,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 +5268,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 +5295,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;
@@ -7253,6 +7264,7 @@ int main_cpupoolnumasplit(int argc, char **argv)
/* No options */
}
+ libxl_bitmap_init(&cpumap);
ret = 0;
poolinfo = libxl_list_cpupool(ctx, &n_pools);
next reply other threads:[~2014-10-19 12:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-19 12:35 Uma Sharma [this message]
2014-10-19 12:55 ` [OPW PATCH V3] tools/xl: Call init function for libxl defined datatypes Wei Liu
2014-10-19 13:15 ` Uma Sharma
2014-10-19 13:47 ` Wei Liu
2014-10-20 11:01 ` George Dunlap
2014-10-20 11:29 ` Uma Sharma
2014-10-20 13:31 ` Ian Campbell
2014-10-20 13:36 ` Uma Sharma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5443affe.27eb420a.5386.122b@mx.google.com \
--to=uma.sharma523@gmail.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@citrix.com \
--cc=Wei.Liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.