aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_core.c
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-09 23:07:27 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-09 23:07:27 +0100
commite7ccd01faf6a9f33b1fd4a2431ce25c5de8a9b38 (patch)
treeeca0072bd066ef1cd40cab3a8ec405ac188b6d10 /tools/libxc/xc_core.c
parentd27fbb006132147f73795ca4ad60a0e38b050b58 (diff)
downloadxen-e7ccd01faf6a9f33b1fd4a2431ce25c5de8a9b38.tar.gz
xen-e7ccd01faf6a9f33b1fd4a2431ce25c5de8a9b38.tar.bz2
xen-e7ccd01faf6a9f33b1fd4a2431ce25c5de8a9b38.zip
Fix a few small issues in xc_domain_dumpcore:
xc_domain_getinfo returns information about a domain, but not necessarily the one you asked about. Add check for this. max_vcpu_id in xc_domain_getinfo is really an ID, not a count, so make the loop include the last VCPU Signed-off-by: Ben Thomas <ben@virtualiron.com>
Diffstat (limited to 'tools/libxc/xc_core.c')
-rw-r--r--tools/libxc/xc_core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c
index 6e403f0e99..7e198ba891 100644
--- a/tools/libxc/xc_core.c
+++ b/tools/libxc/xc_core.c
@@ -54,9 +54,14 @@ xc_domain_dumpcore(int xc_handle,
goto error_out;
}
- for (i = 0; i < info.max_vcpu_id; i++)
+ if (domid != info.domid) {
+ PERROR("Domain %d does not exist", domid);
+ goto error_out;
+ }
+
+ for (i = 0; i <= info.max_vcpu_id; i++)
if (xc_vcpu_getcontext(xc_handle, domid,
- i, &ctxt[nr_vcpus]) == 0)
+ i, &ctxt[nr_vcpus]) == 0)
nr_vcpus++;
nr_pages = info.nr_pages;