Re: [Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-21 Thread Paolo Bonzini
Il 21/02/2013 16:25, Dietmar Maurer ha scritto: >>> I just posted v5 of the patch. But I get a slow down of 15% if I use >>> bdrv_is_allocated_above. (tested with empty qcow2 files.) >> >> Strange, for an unallocated area bdrv_is_allocated_above and bdrv_read really >> do the same thing apart from

Re: [Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-21 Thread Dietmar Maurer
> > I just posted v5 of the patch. But I get a slow down of 15% if I use > > bdrv_is_allocated_above. (tested with empty qcow2 files.) > > Strange, for an unallocated area bdrv_is_allocated_above and bdrv_read really > do the same thing apart from writing the zeroes to the buffer. > The code looks

Re: [Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-21 Thread Paolo Bonzini
- Messaggio originale - > Da: "Dietmar Maurer" > A: "Paolo Bonzini" > Cc: qemu-devel@nongnu.org > Inviato: Giovedì, 21 febbraio 2013 12:40:52 > Oggetto: RE: [PATCH v3 2/6] add basic backup support to block driver > > > > > I think you do. You're wasting time reading unallocated > > >

Re: [Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-21 Thread Dietmar Maurer
> > > I think you do. You're wasting time reading unallocated clusters > > > and checking that they are zero. bdrv_is_allocated_above gives you > > > the same information much more efficiently. > > > > I thought that just returns information if the data is allocated, or > > if data is on backing

Re: [Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-21 Thread Dietmar Maurer
> > >> This should call bdrv_is_allocated_above like the other block jobs do. > > >> It would be needed later anyway to backup only the topmost image. > > > > > > I do not need that information now, so why do you want that I add dead > code? > > > > I think you do. You're wasting time reading unal

Re: [Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-21 Thread Dietmar Maurer
> >> This should call bdrv_is_allocated_above like the other block jobs do. > >> It would be needed later anyway to backup only the topmost image. > > > > I do not need that information now, so why do you want that I add dead code? > > I think you do. You're wasting time reading unallocated clust

Re: [Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-20 Thread Paolo Bonzini
Il 21/02/2013 07:33, Dietmar Maurer ha scritto: >> This should call bdrv_is_allocated_above like the other block jobs do. >> It would be needed later anyway to backup only the topmost image. > > I do not need that information now, so why do you want that I add dead code? I think you do. You're w

Re: [Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-20 Thread Dietmar Maurer
> This should call bdrv_is_allocated_above like the other block jobs do. > It would be needed later anyway to backup only the topmost image. I do not need that information now, so why do you want that I add dead code?

Re: [Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-20 Thread Paolo Bonzini
Il 19/02/2013 12:31, Dietmar Maurer ha scritto: > +start = 0; > +end = (bs->total_sectors + BACKUP_BLOCKS_PER_CLUSTER - 1) / > +BACKUP_BLOCKS_PER_CLUSTER; > + > +DPRINTF("backup_run start %s %zd %zd\n", bdrv_get_device_name(bs), > +start, end); > + > +int ret = 0

Re: [Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-19 Thread Eric Blake
On 02/19/2013 04:31 AM, Dietmar Maurer wrote: > Function backup_job_create() creates a block job to backup a block device. > The coroutine is started with backup_job_start(). > > We call backup_do_cow() for each write during backup. That function > reads the original data and pass it to backup_dum

[Qemu-devel] [PATCH v3 2/6] add basic backup support to block driver

2013-02-19 Thread Dietmar Maurer
Function backup_job_create() creates a block job to backup a block device. The coroutine is started with backup_job_start(). We call backup_do_cow() for each write during backup. That function reads the original data and pass it to backup_dump_cb(). The tracked_request infrastructure is used to s