From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Thomas Subject: [PATCH] xc_core.c - xc_domain_dumpcore minor issues Date: Thu, 09 Mar 2006 16:57:53 -0500 Message-ID: <4410A4E1.2030600@virtualiron.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070709060006010308060102" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------070709060006010308060102 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit There are 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) -- ------------------------------------------------------------------------ Ben Thomas Virtual Iron Software bthomas@virtualiron.com Tower 1, Floor 2 978-849-1214 900 Chelmsford Street Lowell, MA 01851 --------------070709060006010308060102 Content-Type: text/plain; name="xc_core.c-patch2" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xc_core.c-patch2" diff -r 96678f701d42 tools/libxc/xc_core.c --- a/tools/libxc/xc_core.c Mon Mar 6 11:12:48 2006 -0500 +++ b/tools/libxc/xc_core.c Thu Mar 9 16:56:35 2006 -0500 @@ -54,7 +54,12 @@ 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) nr_vcpus++; --------------070709060006010308060102 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------070709060006010308060102--