ia64/xen-unstable

changeset 9214:e31f21fc391d

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>
author kaf24@firebug.cl.cam.ac.uk
date Thu Mar 09 23:07:27 2006 +0100 (2006-03-09)
parents 85b34394c9a2
children b13e54483c1a
files tools/libxc/xc_core.c
line diff
     1.1 --- a/tools/libxc/xc_core.c	Thu Mar 09 22:31:45 2006 +0100
     1.2 +++ b/tools/libxc/xc_core.c	Thu Mar 09 23:07:27 2006 +0100
     1.3 @@ -54,9 +54,14 @@ xc_domain_dumpcore(int xc_handle,
     1.4          goto error_out;
     1.5      }
     1.6   
     1.7 -    for (i = 0; i < info.max_vcpu_id; i++)
     1.8 +    if (domid != info.domid) {
     1.9 +        PERROR("Domain %d does not exist", domid);
    1.10 +        goto error_out;
    1.11 +    }
    1.12 +
    1.13 +    for (i = 0; i <= info.max_vcpu_id; i++)
    1.14          if (xc_vcpu_getcontext(xc_handle, domid,
    1.15 -                                       i, &ctxt[nr_vcpus]) == 0)
    1.16 +                               i, &ctxt[nr_vcpus]) == 0)
    1.17              nr_vcpus++;
    1.18   
    1.19      nr_pages = info.nr_pages;