WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] don't use PAGE_SIZE in userspace

To: Alex Williamson <alex.williamson@xxxxxx>
Subject: Re: [Xen-devel] [PATCH] don't use PAGE_SIZE in userspace
From: Tony Breeds <tony@xxxxxxxxxxxxxxxxxx>
Date: Wed, 20 Dec 2006 14:26:45 +1100
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, julian@xxxxxxxxxxxxx
Delivery-date: Tue, 19 Dec 2006 19:27:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1166582883.5054.6.camel@bling>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Alex Williamson <alex.williamson@xxxxxx>, julian@xxxxxxxxxxxxx, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
References: <1166582883.5054.6.camel@bling>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Tue, Dec 19, 2006 at 07:48:03PM -0700, Alex Williamson wrote:
> 
>    PAGE_SIZE is not a constant on all architectures, getpagesize()
> should be used from userspace.  Thanks,
> 
>       Alex
> 
> Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
> ---
> 
> diff -r 381f119b15a0 tools/blktap/drivers/block-qcow.c
> --- a/tools/blktap/drivers/block-qcow.c       Tue Dec 19 21:33:12 2006 +0000
> +++ b/tools/blktap/drivers/block-qcow.c       Tue Dec 19 19:41:01 2006 -0700
> @@ -1353,7 +1353,8 @@ int qcow_create(const char *filename, ui
>       free(ptr);
>  
>       /*adjust file length to 4 KByte boundary*/
> -     length = ROUNDUP(header_size + (l1_size * sizeof(uint64_t)),PAGE_SIZE);
> +     length = ROUNDUP(header_size + (l1_size * sizeof(uint64_t)),
> +             getpagesize());

How about updateing the comment above, aswell?

Yours Tony

   linux.conf.au       http://linux.conf.au/ || http://lca2007.linux.org.au/
   Jan 15-20 2007      The Australian Linux Technical Conference!


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>