On Tue, May 24, 2011 at 10:15:09PM +0300, Blue Swirl wrote: > > +static bool aio_inflight(BdrvCopyState *s, int64_t sector) > > +{ > > + int64_t chunk = sector / (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK; > > + > > + if (s->aio_bitmap && > > + (sector << BDRV_SECTOR_BITS) < bdrv_getlength(s->src)) { > > + return !!(s->aio_bitmap[chunk / (sizeof(unsigned long) * 8)] & > > + (1UL << (chunk % (sizeof(unsigned long) * 8)))); > > Please use the bitmap functions in bitmap.h, also in the next function.
Can't do, this bitmap can be larger than 2^32, while bitmap.h uses 'int' for index. > > + if (bdrv_open(s->src, s->src_filename, open_flags, NULL) < 0) { > > + error_report("%s: %s: cannot fallback to source image\n", __func__, > > + s->src_filename); > > Below qerror_report() is used. What is the problem? Don't get the point. Fixed other comments, thanks for reviewing.