Received: from eggs.gnu.org ([2001:4830:134:3::10]:52388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7W61-0007eJ-KC for qemu-devel@nongnu.org; Thu, 17 Nov 2016 18:27:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7W60-0004O5-LB for qemu-devel@nongnu.org; Thu, 17 Nov 2016 18:27:57 -0500 References: <1479413642-22463-1-git-send-email-eblake@redhat.com> <1479413642-22463-8-git-send-email-eblake@redhat.com> From: Max Reitz Message-ID: Date: Fri, 18 Nov 2016 00:27:47 +0100 MIME-Version: 1.0 In-Reply-To: <1479413642-22463-8-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sgvbb5k8S9xbBDqSbA79REPJU7pIaifqw" Subject: Re: [Qemu-devel] [PATCH v2 7/9] blkdebug: Add pass-through write_zero and discard support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --sgvbb5k8S9xbBDqSbA79REPJU7pIaifqw From: Max Reitz To: Eric Blake , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, kwolf@redhat.com, pbonzini@redhat.com Message-ID: Subject: Re: [PATCH v2 7/9] blkdebug: Add pass-through write_zero and discard support References: <1479413642-22463-1-git-send-email-eblake@redhat.com> <1479413642-22463-8-git-send-email-eblake@redhat.com> In-Reply-To: <1479413642-22463-8-git-send-email-eblake@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 17.11.2016 21:14, Eric Blake wrote: > In order to test the effects of artificial geometry constraints > on operations like write zero or discard, we first need blkdebug > to manage these actions. Ideally, it would be nice to let these > operations also react to injected errors like read/write/flush, > but it is not trivial to turn bdrv_aio error injection (where > we return BlockAIOCB*) into bdrv_co (where we return int), not > to mention the fact that I don't want to conflict with Kevin's > concurrent work on refactoring away from bdrv_aio. So for now, > the operations merely have a TODO comment for adding error > injection. >=20 > However, one thing we CAN test is the contract promised by the > block layer; namely, if a device has specified limits on > alignment or maximum size, then those limits must be obeyed (for > now, the blkdebug driver merely inherits limits from whatever it > is wrapping, but the next patch will further enhance it to allow > specific limit overrides). >=20 > Tested by setting up an NBD server with export 'foo', then invoking: > $ ./qemu-io > qemu-io> open -o driver=3Dblkdebug blkdebug::nbd://localhost:10809/foo > qemu-io> d 0 15M > qemu-io> w -z 0 15M >=20 > Pre-patch, the server never sees the discard (it was silently > eaten by the block layer); post-patch it is passed across the > wire. Likewise, pre-patch the write is always passed with > NBD_WRITE (with 15M of zeroes on the wire), while post-patch > it can utilize NBD_WRITE_ZEROES (for less traffic). >=20 > Signed-off-by: Eric Blake > --- > block/blkdebug.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 1 file changed, 61 insertions(+) I probably have to take my R-b back, since this patch breaks iotest 98. Max --sgvbb5k8S9xbBDqSbA79REPJU7pIaifqw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJYLjzzEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQIpq B/kBIpm2kwGREAxckIIJbvV2snRi1E/5mHrTMxvlfsvPem3fWXBoYenofYciX9rB rQJV2Q7aHI4otKL6xKCe02JA1hYWWWk81Q9FPleHNZGpSCLI/lIWi/sjL0WDKSBm Esm+D6OqAKNa+yNNOCYQFNPuynjZxyxwm4CHXLfPfnNancBQwxGLKDuuD5xUM5On jQwaFqKchNjRDc1oF14PUjCu5tfSU5cLET5TzSfZK4gZEACKOFLDjJ7NhjsA76bO FcRttylbBoU4DAP1zb7ZyrqdZ2BK/EbjvHYIumrtxesnW3zPN3sp0Ah1hJZZZGJL 8YsFLZsOnrcfxl76y01OyoXg =BVaL -----END PGP SIGNATURE----- --sgvbb5k8S9xbBDqSbA79REPJU7pIaifqw--