From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW3us-00031g-GJ for qemu-devel@nongnu.org; Wed, 17 Feb 2016 10:21:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aW3ur-0006R1-Ey for qemu-devel@nongnu.org; Wed, 17 Feb 2016 10:21:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW3ur-0006Qx-97 for qemu-devel@nongnu.org; Wed, 17 Feb 2016 10:21:21 -0500 References: <1455721691-14802-1-git-send-email-den@openvz.org> From: Max Reitz Message-ID: <56C48FEC.7010901@redhat.com> Date: Wed, 17 Feb 2016 16:21:16 +0100 MIME-Version: 1.0 In-Reply-To: <1455721691-14802-1-git-send-email-den@openvz.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="e8p2N7gm1sai9TPwCgBMmceKGesFCIWdV" Subject: Re: [Qemu-devel] [PATCH 1/1] nbd: fix block-mirror NBD target List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Denis V. Lunev" Cc: Paolo Bonzini , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --e8p2N7gm1sai9TPwCgBMmceKGesFCIWdV Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 17.02.2016 16:08, Denis V. Lunev wrote: > There is VM with 8 GB QCOW2 storage. Real size of the image file is 2 G= B. > 'drive-mirror' redirected to NBD target creates 8 GB image at destinati= on. > The situation is even worse as zeroes are sent through the channel. >=20 > The patch simply adds .bdrv_co_write_zeroes callback to NBD block drive= r > which works though NBD_TRIM to avoid transfer of zeroes. The specification[1] says the following about TRIM: > After issuing this command, a client MUST NOT make any assumptions > about the contents of the export affected by this command, until > overwriting it again with NBD_CMD_WRITE. So I don't think this is correct. The correct solution would probably to introduce a specific command to write zeroes, or at least to use detect-zeroes on the NBD server side (but this will still lead to the zeroes being sent over the line). Max [1] https://github.com/yoe/nbd/blob/master/doc/proto.md > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini > --- > block/nbd-client.c | 10 ++++++++++ > block/nbd-client.h | 2 ++ > block/nbd.c | 9 +++++++++ > 3 files changed, 21 insertions(+) --e8p2N7gm1sai9TPwCgBMmceKGesFCIWdV 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 iQEcBAEBCAAGBQJWxI/tAAoJEDuxQgLoOKyt3ZIH/2hx+svxGsnFzmzy+zoTvEuA y1RBYTrYVvGJOI40cYmhsxmd8AmMdRSOnkTopa+leB8zsxx9qQhFEDBR9g9Ze+EU fs40G11mnYE2rc0i0yh27sSXrJD5eqZQZsvL/j31uo0IHRQx+GVJOTE3JwT7g7sw 8Bxy/NKIkcY/XVVHbS/TyX3XO3LEPFVv4nSjKe4iRh2zEo4fWCIK4INi6lMbqQhl 0diU+dKZShEVtFd5RKvE+6NSMSRT1vHRoWBUYm2vgLgI3o1sgsatcG2USZ9vPswX Dj7qQviwzEUgFhoteZgMfRtQPBEk6yekyfJHksxUoyGIwD7LKS8w2T0yWGXZjwM= =FcUS -----END PGP SIGNATURE----- --e8p2N7gm1sai9TPwCgBMmceKGesFCIWdV--