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

[Patch] Re: [Xen-devel] [RFC] Is grant_read() runnable?

To: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Patch] Re: [Xen-devel] [RFC] Is grant_read() runnable?
From: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Date: Thu, 26 Jan 2006 09:01:17 +0900
Delivery-date: Thu, 26 Jan 2006 00:11:56 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <6DC621873B343Dtakebe_akio@xxxxxxxxxxxxxx>
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>
References: <6DC621873B343Dtakebe_akio@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, all

I'm sorry for poor English.
I rewrite my mail.

Even if/proc/xen/grant is read, nothing is displayed probably. 
I comment to the following sources. 

So I make patch. Is my patch correct?

----------------------
static int
grant_read(char *page, char **start, off_t off, int count, int *eof,
           void *data)
{
        int             len;
        unsigned int    i;
        grant_entry_t  *gt;

        gt = (grant_entry_t *)shared;
        len = 0; 

        for (i = 0; i < NR_GRANT_ENTRIES; i++) {
                if (len > (PAGE_SIZE - 200)) {    <---- always FAIL
                        len += sprintf( page + len, "Truncated.\n");
                        break;
                }
        }

        if (gt[i].flags) {   <--- always gt[NR_GRANT_ENTRIES].flags
                len += sprintf(page + len,
                               "Grant: ref (0x%x) flags (0x%hx) "
                               "dom (0x%hx) frame (0x%x)\n", 
                               i,
                               gt[i].flags,
                               gt[i].domid,
                               gt[i].frame );  <--- So This sprintf doesn't 
make sence almost.
        }

        *eof = 1;
        return len;
}


Best Regards,

Akio Takebe

>Hi, all
>
>I think grant_read() is not runnable.
>" (len > (PAGE_SIZE - 200)) " is not entered into if sentence 
>becase of len=0.
>So i always equal NR_GRANT_ENTRIES.
>
>Is the below patch correct?
>Please comment.
>
>Best Regards,
>
>Akio Takebe
>

Attachment: grant_read.patch
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>