From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Thomas Subject: [PATCH] xc_core.c - Fix order of evaluation issue in xc_domain_dumpcore Date: Wed, 08 Mar 2006 20:41:12 -0500 Message-ID: <440F87B8.7060600@virtualiron.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080806010908090009000308" 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. --------------080806010908090009000308 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Fix order-of-evaluation issue in xc_domain_dumpcore. The intent is to move blocks of memory 4096 pages at a time, and a buffer is allocated for this. Unfortunately, the #define is without parentheses and %/* are the same order and evaluated left to right. Result: very big buffer being used 4 pages at a time. Luckily, the fix is simple. Signed-off-by: Ben Thomas (bthomas@virtualiron.com) -- ------------------------------------------------------------------------ Ben Thomas Virtual Iron Software bthomas@virtualiron.com Tower 1, Floor 2 978-849-1214 900 Chelmsford Street Lowell, MA 01851 --------------080806010908090009000308 Content-Type: text/x-patch; name="xc_core.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xc_core.patch" 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 Wed Mar 8 20:36:21 2006 -0500 @@ -6,7 +6,7 @@ #include /* number of pages to write at a time */ -#define DUMP_INCREMENT 4 * 1024 +#define DUMP_INCREMENT (4 * 1024) #define round_pgup(_p) (((_p)+(PAGE_SIZE-1))&PAGE_MASK) static int --------------080806010908090009000308 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 --------------080806010908090009000308--