Re: [Qemu-devel] [PATCH 1/2] drity-bitmap: refactor merge: separte can_merge

2018-07-05 Thread John Snow
On 07/05/2018 02:55 PM, Eric Blake wrote: > On 07/05/2018 01:51 PM, John Snow wrote: > >> >>> -    assert(!bdrv_dirty_bitmap_readonly(dest)); >>> - >>> -    if (!hbitmap_merge(dest->bitmap, src->bitmap)) { >>> -    error_setg(errp, "Bitmaps are incompatible and can't be >>> merged"); >>> + 

Re: [Qemu-devel] [PATCH 1/2] drity-bitmap: refactor merge: separte can_merge

2018-07-05 Thread Eric Blake
On 07/05/2018 01:51 PM, John Snow wrote: -assert(!bdrv_dirty_bitmap_readonly(dest)); - -if (!hbitmap_merge(dest->bitmap, src->bitmap)) { -error_setg(errp, "Bitmaps are incompatible and can't be merged"); +if (bdrv_can_merge_dirty_bitmap(dest, src, errp)) { +bool ret

Re: [Qemu-devel] [PATCH 1/2] drity-bitmap: refactor merge: separte can_merge

2018-07-05 Thread John Snow
On 07/03/2018 06:53 AM, Vladimir Sementsov-Ogievskiy wrote: > Separate can_merge, to reuse it for transaction support for merge > command. > > Also, switch some asserts to errors. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > include/block/dirty-bitmap.h | 3 +++ > include/qemu/hb

Re: [Qemu-devel] [PATCH 1/2] drity-bitmap: refactor merge: separte can_merge

2018-07-03 Thread Eric Blake
On 07/03/2018 05:53 AM, Vladimir Sementsov-Ogievskiy wrote: In the subject: s/drity/dirty/, s/separte/separate/ Separate can_merge, to reuse it for transaction support for merge command. Also, switch some asserts to errors. Signed-off-by: Vladimir Sementsov-Ogievskiy --- Reviewed-by: Eric

[Qemu-devel] [PATCH 1/2] drity-bitmap: refactor merge: separte can_merge

2018-07-03 Thread Vladimir Sementsov-Ogievskiy
Separate can_merge, to reuse it for transaction support for merge command. Also, switch some asserts to errors. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/dirty-bitmap.h | 3 +++ include/qemu/hbitmap.h | 8 block/dirty-bitmap.c | 32 ++