From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTOhS-0005yC-3s for qemu-devel@nongnu.org; Sun, 05 Jun 2011 21:33:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QTOhR-0000F8-7H for qemu-devel@nongnu.org; Sun, 05 Jun 2011 21:33:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QTOhQ-0000Ew-R5 for qemu-devel@nongnu.org; Sun, 05 Jun 2011 21:33:49 -0400 Date: Fri, 3 Jun 2011 12:59:42 -0300 From: Marcelo Tosatti Message-ID: <20110603155942.GA2900@amt.cnet> References: <20110523213115.164535428@amt.cnet> <20110523213411.003695437@amt.cnet> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [patch 6/7] QEMU live block copy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: kwolf@redhat.com, Jes.Sorensen@redhat.com, dlaor@redhat.com, qemu-devel@nongnu.org, avi@redhat.com On Tue, May 24, 2011 at 10:15:09PM +0300, Blue Swirl wrote: > > +static bool aio_inflight(BdrvCopyState *s, int64_t sector) > > +{ > > + =A0 =A0int64_t chunk =3D sector / (int64_t)BDRV_SECTORS_PER_DIRTY_C= HUNK; > > + > > + =A0 =A0if (s->aio_bitmap && > > + =A0 =A0 =A0 =A0(sector << BDRV_SECTOR_BITS) < bdrv_getlength(s->src= )) { > > + =A0 =A0 =A0 =A0return !!(s->aio_bitmap[chunk / (sizeof(unsigned lon= g) * 8)] & > > + =A0 =A0 =A0 =A0 =A0 =A0(1UL << (chunk % (sizeof(unsigned long) * 8)= ))); >=20 > 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. > > + =A0 =A0if (bdrv_open(s->src, s->src_filename, open_flags, NULL) < 0= ) { > > + =A0 =A0 =A0 =A0error_report("%s: %s: cannot fallback to source imag= e\n", __func__, > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 s->src_filename); >=20 > Below qerror_report() is used. What is the problem? Don't get the point. Fixed other comments, thanks for reviewing.