Re: [Qemu-devel] [PATCH 3/6] add-cow file format

2012-08-02 Thread Dong Xu Wang
On Wed, Aug 1, 2012 at 11:31 PM, Stefan Hajnoczi wrote: > On Tue, Jul 31, 2012 at 5:51 PM, Dong Xu Wang > wrote: >> +if (backing_filename) { >> +header.features |= ADD_COW_F_BACKING_FILE; >> +header.backing_filename_offset = sizeof(header) + 16 * 2; > > It's not obvious what 1

Re: [Qemu-devel] [PATCH 3/6] add-cow file format

2012-08-02 Thread Dong Xu Wang
On Wed, Aug 1, 2012 at 9:57 PM, Eric Blake wrote: > On 07/31/2012 10:51 AM, Dong Xu Wang wrote: >> This is the implementation code for add-cow file format. Because image_file >> might be very huge, then we can't read entire bitmap into memory, we must use >> a cache. Since qcow-cache.c has implemt

Re: [Qemu-devel] [PATCH 3/6] add-cow file format

2012-08-01 Thread Stefan Hajnoczi
On Tue, Jul 31, 2012 at 5:51 PM, Dong Xu Wang wrote: > +if (backing_filename) { > +header.features |= ADD_COW_F_BACKING_FILE; > +header.backing_filename_offset = sizeof(header) + 16 * 2; It's not obvious what 16 * 2 is. > +ret = bdrv_pwrite(bs, sizeof(le_header) + 16, > +

Re: [Qemu-devel] [PATCH 3/6] add-cow file format

2012-08-01 Thread Kevin Wolf
Am 01.08.2012 16:14, schrieb Stefan Hajnoczi: > On Wed, Aug 1, 2012 at 2:57 PM, Eric Blake wrote: >> On 07/31/2012 10:51 AM, Dong Xu Wang wrote: >>> This is the implementation code for add-cow file format. Because image_file >>> might be very huge, then we can't read entire bitmap into memory, we

Re: [Qemu-devel] [PATCH 3/6] add-cow file format

2012-08-01 Thread Stefan Hajnoczi
On Wed, Aug 1, 2012 at 2:57 PM, Eric Blake wrote: > On 07/31/2012 10:51 AM, Dong Xu Wang wrote: >> This is the implementation code for add-cow file format. Because image_file >> might be very huge, then we can't read entire bitmap into memory, we must use >> a cache. Since qcow-cache.c has implemt

Re: [Qemu-devel] [PATCH 3/6] add-cow file format

2012-08-01 Thread Eric Blake
On 07/31/2012 10:51 AM, Dong Xu Wang wrote: > This is the implementation code for add-cow file format. Because image_file > might be very huge, then we can't read entire bitmap into memory, we must use > a cache. Since qcow-cache.c has implemted cache code, we can create our cache s/implemted/impl

[Qemu-devel] [PATCH 3/6] add-cow file format

2012-07-31 Thread Dong Xu Wang
This is the implementation code for add-cow file format. Because image_file might be very huge, then we can't read entire bitmap into memory, we must use a cache. Since qcow-cache.c has implemted cache code, we can create our cache code based on it. Signed-off-by: Dong Xu Wang --- block/Makefile

Re: [Qemu-devel] [PATCH 3/6] add-cow file format

2012-06-17 Thread Dong Xu Wang
On Thu, Jun 14, 2012 at 7:13 PM, Paolo Bonzini wrote: > I just took a quick look at the flush code. > > Il 13/06/2012 16:36, Dong Xu Wang ha scritto: >> >> +bool add_cow_cache_set_writethrough(BlockDriverState *bs, AddCowCache *c, >> +    bool enable) >> +{ >> +    bool old = c->writethrough; >> +

Re: [Qemu-devel] [PATCH 3/6] add-cow file format

2012-06-14 Thread Paolo Bonzini
I just took a quick look at the flush code. Il 13/06/2012 16:36, Dong Xu Wang ha scritto: > > +bool add_cow_cache_set_writethrough(BlockDriverState *bs, AddCowCache *c, > +bool enable) > +{ > +bool old = c->writethrough; > + > +if (!old && enable) { > +add_cow_cache_flush(bs,

[Qemu-devel] [PATCH 3/6] add-cow file format

2012-06-13 Thread Dong Xu Wang
This is the implementation code for add-cow file format. Because image_file might be very huge, then we can't read entire bitmap into memory, we must use a cache. Since qcow-cache.c has implemted cache code, we can create our cache code based on it. Signed-off-by: Dong Xu Wang --- block/Makefile