From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5evD-0006dj-JV for qemu-devel@nongnu.org; Mon, 19 Sep 2011 10:34:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5ev8-0000jy-V2 for qemu-devel@nongnu.org; Mon, 19 Sep 2011 10:34:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5ev8-0000jh-Hi for qemu-devel@nongnu.org; Mon, 19 Sep 2011 10:34:06 -0400 Message-ID: <4E77538F.3060305@redhat.com> Date: Mon, 19 Sep 2011 16:37:03 +0200 From: Kevin Wolf MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Help needed -- vvfat.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pintu Kumar Cc: qemu-devel@nongnu.org Am 15.09.2011 14:49, schrieb Pintu Kumar: > Hi, > > This is regarding qemu block/vvfat.c. > > Currently vvfat scans all directories and sub-directories in the > beginning during init_directories(). > > I want to modify vvfat such that it should scan only the TOP directory > content and not the sub-directory content before mounting. > And after mounting vvfat I should be able to dynamically get the TOP > directory content when I do "ls -l" on that directory. > How can I do that? > > I tried skipping sub-directory in read_directory() as follows. > else if(S_ISDIR(st.st_mode)) > { > LOGD("Skipping sub-directory : %s\n", buffer); > s->current_mapping=NULL; > continue; > } > After that the sub-directories are visible after mounting and part1 is working. > But after mounting when I do "ls -l" on vvfat mounted path, on any > directory, vvfat_read() is not getting called. > > Somebody who knows about vvfat implementation please let me know where > is the problem. I doubt that this is possible. A guest OS doesn't expect that data on the disk changes when it didn't write to it. So for example, it could read in the whole FAT and never really look at the on-disk FAT any more. In practice, probably only parts of the FAT are cached, but that doesn't help you. You never know which parts are cached, and anyway, even if you knew which parts you may change, restricting changes to these parts of the FATs would be tricky... vvfat is already complicated enough without doing anything like this. Kevin