From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO7nW-0006O2-QK for qemu-devel@nongnu.org; Tue, 26 Jan 2016 12:52:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO7nV-0000SM-RK for qemu-devel@nongnu.org; Tue, 26 Jan 2016 12:52:58 -0500 References: <1453804705-7205-1-git-send-email-famz@redhat.com> <1453804705-7205-3-git-send-email-famz@redhat.com> From: Eric Blake Message-ID: <56A7B273.4030208@redhat.com> Date: Tue, 26 Jan 2016 10:52:51 -0700 MIME-Version: 1.0 In-Reply-To: <1453804705-7205-3-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lMGQ0pVMHOnst1r6psftUINjbNcbWFECW" Subject: Re: [Qemu-devel] [RFC PATCH 02/16] block: Set dirty before doing write List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Markus Armbruster , mreitz@redhat.com, vsementsov@parallels.com, Stefan Hajnoczi , jsnow@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lMGQ0pVMHOnst1r6psftUINjbNcbWFECW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/26/2016 03:38 AM, Fam Zheng wrote: > So that driver can write the dirty bits into persistent dirty bitmaps i= n > the write callback. >=20 > Signed-off-by: Fam Zheng > --- > block/io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake >=20 > diff --git a/block/io.c b/block/io.c > index 343ff1f..b964e7e 100644 > --- a/block/io.c > +++ b/block/io.c > @@ -1164,6 +1164,8 @@ static int coroutine_fn bdrv_aligned_pwritev(Bloc= kDriverState *bs, > } > } > =20 > + bdrv_set_dirty(bs, sector_num, nb_sectors); > + > if (ret < 0) { > /* Do nothing, write notifier decided to fail this request */ This sets the dirty bit even on failure, but I guess that doesn't hurt (it's better to mark too much dirty than it is to not mark enough). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --lMGQ0pVMHOnst1r6psftUINjbNcbWFECW 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/ iQEcBAEBCAAGBQJWp7JzAAoJEKeha0olJ0NqD5gH/2Q/wEJPA3iN0sluq6zWmxjJ 34HLfuHfF5lVgozuTGGM7F+s7Y+s3sIWM+XwFCuwvSinZ9nV7atLppe5Te/8+Euz pp+8OKs/suTwOjezi40hIxEFSORBiVOdJuhLTjXoFOgxTSUyW/xA7pSnTjMio4Za l2fbznWOhfG/7pOP3bHTjdmzUdQtQSoX+l1RAH6VCwC+jjVIZN4mGWeQGdP80wIZ Hws/ytezu8LsxmVMKLm3fS1jeH8gAw54/GkgarW6m1SVQsmN/NHpravP4yDJgjb+ FAk+tBXm4S+oawK4HEa+R9J5/e0GiieHqf7oEWZtzbH0IduASjTy1FmHsM74b+o= =O1Ba -----END PGP SIGNATURE----- --lMGQ0pVMHOnst1r6psftUINjbNcbWFECW--