From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsMtX-0006yg-3B for qemu-devel@nongnu.org; Wed, 04 Jun 2014 21:55:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsMtS-0006q2-0e for qemu-devel@nongnu.org; Wed, 04 Jun 2014 21:55:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsMtR-0006mg-PS for qemu-devel@nongnu.org; Wed, 04 Jun 2014 21:55:01 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s551sxdG003363 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 4 Jun 2014 21:54:59 -0400 Message-ID: <538FCDF2.4080409@redhat.com> Date: Wed, 04 Jun 2014 19:54:58 -0600 From: Eric Blake MIME-Version: 1.0 References: <538FA3C8.7000108@redhat.com> <20140605001214.GA2639@localhost.localdomain> In-Reply-To: <20140605001214.GA2639@localhost.localdomain> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="St4nptMJC6fP2CosRGNiDEh2uHOMkk4WK" Subject: Re: [Qemu-devel] active block commit bug? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: Fam Zheng , "qemu-devel@nongnu.org" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --St4nptMJC6fP2CosRGNiDEh2uHOMkk4WK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/04/2014 06:12 PM, Jeff Cody wrote: >> Huh? I thought that an active commit was not supposed to complete >> automatically, but that the job would remain around until I either >> 'block-job-cancel' or 'block-job-complete' it. That is, I should have= >> gotten a BLOCK_JOB_READY event and still see the job when I query for >> it. Where am I going wrong, or did I uncover a bug in active commit? >> >=20 > I tried repeating your findings, but I couldn't, until I noticed that > 'f' was just a 0-length raw image in your test. >=20 > The snapshot file will be the same size, 0. So when we go to perform > the active commit, we short-circuit at the beginning, since we are > committing a zero-length image: That explains it. > =20 > s->common.len =3D bdrv_getlength(bs); > if (s->common.len <=3D 0) { > block_job_completed(&s->common, s->common.len); > return; > } > ^^^^^ > we exit early here, with a completed message, since there is > nothing to do. >=20 > If 'g' had increased to non-zero size, then you would have received a > BLOCK_JOB_READY instead. Sounds like we have an off-by-one condition if empty files behave differently from other files. We ought to fix that bug (not that your normal guest will ever have a 0-length backing file, but this was what I was trying to use for libvirt's probing of whether active commit is supported) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --St4nptMJC6fP2CosRGNiDEh2uHOMkk4WK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTj83yAAoJEKeha0olJ0Nqk28H/00plT3BP31Q0a1tbnpaon9Z SumKr5NQpyNxLW4/Co3/kSszn2vH51Uf6A1Ft+jJNugj36p1g574nGEu97FSc2KL aPd7VALbRXXua4LoR3ZOvf5rc2p1VYI5XTTl2MXHNUdR9P5anMRpemZx4ijswHwx MYYi0scmegVv+3FidpkIyNTBcG/a/63A90RORynDTjjP42aWy9C3mKShluxKE7d5 DogZAGsBB+7QbftQhsWntVfbfoPsKdt/eZE6/2/XNF4Q/xUcAP/7+rfcfVwU0HNX 4+Xf0xx+hyNfalyw8bXzb8wSOhwQ2qpEBG34rDxUz4qVx1vi1kc2v1F/0zh3T4s= =YDyB -----END PGP SIGNATURE----- --St4nptMJC6fP2CosRGNiDEh2uHOMkk4WK--