From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxgzg-0007tQ-WD for qemu-devel@nongnu.org; Fri, 21 Oct 2016 17:04:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxgzg-0005px-0n for qemu-devel@nongnu.org; Fri, 21 Oct 2016 17:04:48 -0400 References: <1475232808-4852-1-git-send-email-vsementsov@virtuozzo.com> <1475232808-4852-12-git-send-email-vsementsov@virtuozzo.com> <8092a3b9-1290-5566-f29e-8f894559f927@redhat.com> <58050837.4050907@virtuozzo.com> <733b2c04-919c-e778-13a1-3b101a456e44@redhat.com> From: Eric Blake Message-ID: <34ea353d-ea79-02e8-3f17-b0c93012b7a4@redhat.com> Date: Fri, 21 Oct 2016 16:04:40 -0500 MIME-Version: 1.0 In-Reply-To: <733b2c04-919c-e778-13a1-3b101a456e44@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MgjiTTPHq6GmBrKSNqf4vvd7Xt9re16PF" Subject: Re: [Qemu-devel] [PATCH 11/22] qcow2-bitmap: add qcow2_store_persistent_bitmaps() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, jsnow@redhat.com, famz@redhat.com, den@openvz.org, stefanha@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MgjiTTPHq6GmBrKSNqf4vvd7Xt9re16PF From: Eric Blake To: Max Reitz , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, jsnow@redhat.com, famz@redhat.com, den@openvz.org, stefanha@redhat.com, pbonzini@redhat.com Message-ID: <34ea353d-ea79-02e8-3f17-b0c93012b7a4@redhat.com> Subject: Re: [PATCH 11/22] qcow2-bitmap: add qcow2_store_persistent_bitmaps() References: <1475232808-4852-1-git-send-email-vsementsov@virtuozzo.com> <1475232808-4852-12-git-send-email-vsementsov@virtuozzo.com> <8092a3b9-1290-5566-f29e-8f894559f927@redhat.com> <58050837.4050907@virtuozzo.com> <733b2c04-919c-e778-13a1-3b101a456e44@redhat.com> In-Reply-To: <733b2c04-919c-e778-13a1-3b101a456e44@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/21/2016 02:44 PM, Max Reitz wrote: >> Now I think I can drop this assignment, as bdrv_aligned_preadv have >> 'return ret < 0 ? ret : 0;' in the end... Am I right? Can bdrv_pwrite= >> and friends return positive value on success? >=20 > I think so, but if they do return positive value they're supposed to be= > equal to the number of bytes written. In practice, though, any > non-negative return value is treated the same (as success). At one point in my conversion to byte access, I ran into test failures when trying to return number of bytes written; so commit 1a62d0a hard-codes a return of 0 on success instead. It will be a long and painful audit to find which callers expect which semantics, which I did not want to do. >=20 > I was just wondering about the comment, though, not about the assignmen= t > itself. >=20 > Max >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --MgjiTTPHq6GmBrKSNqf4vvd7Xt9re16PF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJYCoLoAAoJEKeha0olJ0NqgxkIAJRAkZ1r9RtfUa3M891gsI9e YhEZubEPu4O7ho9WkWgc0YVAf+KVzmN4JWCr/+Nic/FwVPSi5Of80d++RFDJNnQp gQPQ908GrG6lF3UHGcHeMV4/e0FCx//P/xLYeeI9FsTvlIdBUuyBIJojuOB9BbE9 uLvyjytn2Q7TGm7NU4eLghqlFbThvEivIL1/czvgpwOsthP3foE607ooyFxI6CrS TQmN2ZBcjqKVQ4XzJtAYb62oU8KTFXuVdaZP8xzY98Dptuygs1yqsH0M1ZIc4rLX yirO8/zT6v5m9332xKFMmiY3ravaqfrcAKVULfQJ3eHjNZpkWe4bp51kqdcVuGM= =fWUW -----END PGP SIGNATURE----- --MgjiTTPHq6GmBrKSNqf4vvd7Xt9re16PF--