Skip to contentSkip to conversation

xc_core.c - Fix order of evaluation issue in xc_domain_dumpcore

PATCH New Ben Thomas 1 participant 1 message Mar 9, 2006

lore
Share & tools
lore

Ben Thomas

author
#0 lore raw

PATCH 1/1 xc_core.c - Fix order of evaluation issue in xc_domain_dumpcore

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.

Signature · 5 lines
------------------------------------------------------------------------
Ben Thomas                                         Virtual Iron Software
[email protected]                            Tower 1, Floor 2
978-849-1214                                       900 Chelmsford Street
                                                   Lowell, MA 01851
tools/libxc/xc_core.c +1 -1
diff -r 96678f701d42 tools/libxc/xc_core.c
@@ -6,7 +6,7 @@
 #include <zlib.h>
 
 /* 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

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel