From: Ian Jackson Date: Tue, 15 Jul 2008 17:40:04 +0000 (+0100) Subject: Saner calculation of stubdom IDE_DMA_BUF_SECTORS. X-Git-Tag: xen-3.3.0-rc1~30 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2102c06b1fdb0ea0e3cae56311fce3be7118b306;p=qemu-xen-4.0-testing.git Saner calculation of stubdom IDE_DMA_BUF_SECTORS. Thanks to Samuel Thibault. Signed-off-by: Ian Jackson --- diff --git a/hw/ide.c b/hw/ide.c index 37bcf56b..79c52040 100644 --- a/hw/ide.c +++ b/hw/ide.c @@ -201,20 +201,10 @@ /* set to 1 set disable mult support */ #define MAX_MULT_SECTORS 16 -#ifdef CONFIG_STUBDOM -#include -#define IDE_DMA_BUF_SIZE (BLKIF_MAX_SEGMENTS_PER_REQUEST * TARGET_PAGE_SIZE) -#else -#define IDE_DMA_BUF_SIZE 131072 -#endif -#if (IDE_DMA_BUF_SIZE < MAX_MULT_SECTORS * 512) -#error "IDE_DMA_BUF_SIZE must be bigger or equal to MAX_MULT_SECTORS * 512" -#endif - #ifdef CONFIG_STUBDOM #include #define IDE_DMA_BUF_SECTORS \ - ((BLKIF_MAX_SEGMENTS_PER_REQUEST * TARGET_PAGE_SIZE) / 512) + (((BLKIF_MAX_SEGMENTS_PER_REQUEST - 1 ) * TARGET_PAGE_SIZE) / 512) #else #define IDE_DMA_BUF_SECTORS 256 #endif