From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAI3O-0008Ee-Rt for qemu-devel@nongnu.org; Tue, 07 Jun 2016 10:32:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAI3K-00089w-02 for qemu-devel@nongnu.org; Tue, 07 Jun 2016 10:32:26 -0400 References: <1465307797-28378-1-git-send-email-kwolf@redhat.com> From: Eric Blake Message-ID: <5756DAEA.4030001@redhat.com> Date: Tue, 7 Jun 2016 08:32:10 -0600 MIME-Version: 1.0 In-Reply-To: <1465307797-28378-1-git-send-email-kwolf@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KnNcbUw3MBgnNoHSwRfeXHN4IlbX36g0l" Subject: Re: [Qemu-devel] [PATCH] block: Don't emulate natively supported pwritev flags List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: stefanha@redhat.com, famz@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KnNcbUw3MBgnNoHSwRfeXHN4IlbX36g0l Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/07/2016 07:56 AM, Kevin Wolf wrote: > Drivers that implement .bdrv_co_pwritev() get the flags passed as an > argument to said function, but we also unconditionally emulate the flag= s > anyway. We shouldn't do that. >=20 > Fix this by clearing all flags that the driver supports natively after > it returns from .bdrv_co_pwritev(). >=20 > Fixes: 4df863f3 ('block: Make supported_write_flags a per-bds property'= ) > Signed-off-by: Kevin Wolf > --- > block/io.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > Reviewed-by: Eric Blake > diff --git a/block/io.c b/block/io.c > index 2b10870..dec30e3 100644 > --- a/block/io.c > +++ b/block/io.c > @@ -816,7 +816,9 @@ static int coroutine_fn bdrv_driver_pwritev(BlockDr= iverState *bs, > int ret; > =20 > if (drv->bdrv_co_pwritev) { > - ret =3D drv->bdrv_co_pwritev(bs, offset, bytes, qiov, flags); > + ret =3D drv->bdrv_co_pwritev(bs, offset, bytes, qiov, > + flags & bs->supported_write_flags);= > + flags &=3D ~bs->supported_write_flags; > goto emulate_flags; > } > =20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KnNcbUw3MBgnNoHSwRfeXHN4IlbX36g0l 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/ iQEcBAEBCAAGBQJXVtrqAAoJEKeha0olJ0Nqac8H/1nV0A8gVoig7OyXPikdImHu 4MSO7yFQgbPnq69xEGO8Si8gg1drWy651CQmwbJ4f7rBwHUPCWB8hPik4kBQMHh1 Vbe/q1QEXH195iE+CDEgQIWn795V2/7ttpFFX7Xoc+nlzISO8bY4hcSjTOmTl7dc SIGTpBsV+UvWIuJc1KTW5Qbyw83tTEnUJGxKzqQIShLR3P822QsBqDj69ec8tuHo ti3CyX97k8t2tWtBkhY+a6K5GpkmERQQ68GTAQL97QpBk/6t48hUUNdr+lAnqyMu 9ndKpI9F2qR0I0cpvZ+or2sIBlkYIEE65s+XPthS+qy2B0MqWerN6cXqw0pQY8M= =8xd+ -----END PGP SIGNATURE----- --KnNcbUw3MBgnNoHSwRfeXHN4IlbX36g0l--