From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxfkF-000786-TT for qemu-devel@nongnu.org; Fri, 21 Oct 2016 15:44:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxfkF-0008JG-8W for qemu-devel@nongnu.org; Fri, 21 Oct 2016 15:44:47 -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> From: Max Reitz Message-ID: <733b2c04-919c-e778-13a1-3b101a456e44@redhat.com> Date: Fri, 21 Oct 2016 21:44:40 +0200 MIME-Version: 1.0 In-Reply-To: <58050837.4050907@virtuozzo.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LiqpCl2eeAA69Gl4Wq3I375hw7B1d2sGD" 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: Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, eblake@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) --LiqpCl2eeAA69Gl4Wq3I375hw7B1d2sGD From: Max Reitz To: Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, qemu-devel@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, eblake@redhat.com, jsnow@redhat.com, famz@redhat.com, den@openvz.org, stefanha@redhat.com, pbonzini@redhat.com Message-ID: <733b2c04-919c-e778-13a1-3b101a456e44@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> In-Reply-To: <58050837.4050907@virtuozzo.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 17.10.2016 19:19, Vladimir Sementsov-Ogievskiy wrote: > On 07.10.2016 22:24, Max Reitz wrote: >> On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote: >>> Realize block bitmap stroing interface, to allow qcow2 images store >>> persistent bitmaps. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy >>> --- >>> block/qcow2-bitmap.c | 241 >>> +++++++++++++++++++++++++++++++++++++++++++++++++++ >=20 > [...] >=20 >>> >>> + ret =3D bdrv_pwrite(bs->file, off, buf, cl_size); >>> + if (ret < 0) { >>> + goto finish; >>> + } >>> + >>> + if (end >=3D bm_size) { >>> + break; >>> + } >>> + >>> + bdrv_set_dirty_iter(dbi, end); >>> + } >>> + ret =3D 0; /* writes */ >> What is that comment supposed to mean? >> >> >=20 > 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? 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). I was just wondering about the comment, though, not about the assignment itself. Max --LiqpCl2eeAA69Gl4Wq3I375hw7B1d2sGD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJYCnAoEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQOq0 B/9FOvbI63DELrOg2J0T3k5Y8BhbnXQSAjikv+O2mSlRLKBft46TDNIur/uAlrhV rXvGdiCo+hfg5Hfy10e2Xua3KuRbdpgavlZM7RuPzI1rYZ6qF5BICTHdDXYPBNvu IY0O0vqOrEghxeHD9azam/0ut+IsgeFkhO+CiE2hQyiksng28Kd0sbeurxbrB59o AdrAyFibXlfSne6rztyJU2fIrje6ubmzD0M429tVMAZqT89MHve9Z9ldK7fAwoaZ UTldPl3N5tlfh2ZK7gld4G+b1Q5PdiMZxVBRP2kVfsYV04UmuMdUe+ePqgbXZBgU hhLbIEJKAuD5s3Ac2uzuJMsc =aXcV -----END PGP SIGNATURE----- --LiqpCl2eeAA69Gl4Wq3I375hw7B1d2sGD--