Re: [Qemu-devel] [PATCH 2/3] dmg: use pread

2010-05-11 Thread Kevin Wolf
Am 10.05.2010 22:20, schrieb Christoph Hellwig: > On Mon, May 10, 2010 at 12:07:40PM +0200, Kevin Wolf wrote: >>> + if (type == 0x6d697368 && count >= 244) { >>> int new_size, chunk_count; >>> - if(lseek(s->fd,200,SEEK_CUR)<0) >>> - goto fail; >>> + >>> +offset

Re: [Qemu-devel] [PATCH 2/3] dmg: use pread

2010-05-10 Thread Christoph Hellwig
On Mon, May 10, 2010 at 12:07:40PM +0200, Kevin Wolf wrote: > > > > -info_begin=read_off(s->fd); > > -if(info_begin==0) > > - goto fail; > > -if(lseek(s->fd,info_begin,SEEK_SET)<0) > > - goto fail; > > We seek to info_begin. > > > -if(read_uint32(s->fd)!=0x100) > > - goto

Re: [Qemu-devel] [PATCH 2/3] dmg: use pread

2010-05-10 Thread Kevin Wolf
Am 07.05.2010 16:56, schrieb Christoph Hellwig: > Use pread instead of lseek + read in preparation of using the qemu > block API. Note that dmg actually uses the implicit file offset > a lot in dmg_open, and we had to replace it with an offset variable. > > Signed-off-by: Christoph Hellwig > >

[Qemu-devel] [PATCH 2/3] dmg: use pread

2010-05-07 Thread Christoph Hellwig
Use pread instead of lseek + read in preparation of using the qemu block API. Note that dmg actually uses the implicit file offset a lot in dmg_open, and we had to replace it with an offset variable. Signed-off-by: Christoph Hellwig Index: qemu-kevin/block/dmg.c