From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35491) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bADvs-0006jp-2G for qemu-devel@nongnu.org; Tue, 07 Jun 2016 06:08:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bADvp-0004Pa-Op for qemu-devel@nongnu.org; Tue, 07 Jun 2016 06:08:22 -0400 Date: Tue, 7 Jun 2016 12:08:10 +0200 From: Kevin Wolf Message-ID: <20160607100810.GB4684@noname.str.redhat.com> References: <1464973388-15821-1-git-send-email-eblake@redhat.com> <1464973388-15821-6-git-send-email-eblake@redhat.com> <5751C32F.3040806@redhat.com> <5751F9E8.6090900@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="neYutvxvOLaeuPCA" Content-Disposition: inline In-Reply-To: <5751F9E8.6090900@redhat.com> Subject: Re: [Qemu-devel] [PATCH 5/5] block: Move request_alignment into BlockLimit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, Fam Zheng , Ronnie Sahlberg , qemu-block@nongnu.org, Peter Lieven , mreitz@redhat.com, Stefan Hajnoczi , Paolo Bonzini --neYutvxvOLaeuPCA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 03.06.2016 um 23:43 hat Eric Blake geschrieben: > On 06/03/2016 11:49 AM, Eric Blake wrote: > > On 06/03/2016 11:03 AM, Eric Blake wrote: > >> It makes more sense to have ALL block size limit constraints > >> in the same struct. Improve the documentation while at it. > >> > >> Note that bdrv_refresh_limits() has to keep things alive across > >> a memset() of BlockLimits. > >> > >> Signed-off-by: Eric Blake > >> --- > >> include/block/block_int.h | 12 ++++++++---- > >> block.c | 4 ++-- > >> block/blkdebug.c | 4 ++-- > >> block/bochs.c | 2 +- > >> block/cloop.c | 2 +- > >> block/dmg.c | 2 +- > >> block/io.c | 12 +++++++----- > >> block/iscsi.c | 2 +- > >> block/raw-posix.c | 16 ++++++++-------- > >> block/raw-win32.c | 6 +++--- > >> block/vvfat.c | 2 +- > >> 11 files changed, 35 insertions(+), 29 deletions(-) > >=20 > > Something in this patch is causing qemu-iotests 77 to infloop; we may > > decide it is just easier to drop this patch rather than find all the > > places where the request_alignment must be preserved across what > > otherwise zeroes out limits. >=20 > Found it; squash this in (or use it as an argument why we don't want > request_alignment in bs->bl after all): This hunk doesn't make sense to me. For the correctness of the code it shouldn't make a difference whether the alignment happens before passing the request to file/raw-posix or already in the raw format layer. The cause for the hang you're seeing is probably that the request is already aligned before the blkdebug layer and therefore the blkdebug events aren't generated any more. That's a problem with the test (I'm considering the blkdebug events part of the test infrastructure), however, and not with the code. Kevin > diff --git i/block/raw_bsd.c w/block/raw_bsd.c > index b1d5237..c3c2246 100644 > --- i/block/raw_bsd.c > +++ w/block/raw_bsd.c > @@ -152,7 +152,11 @@ static int raw_get_info(BlockDriverState *bs, > BlockDriverInfo *bdi) >=20 > static void raw_refresh_limits(BlockDriverState *bs, Error **errp) > { > + /* Inherit all limits except for request_alignment */ > + int request_alignment =3D bs->bl.request_alignment; > + > bs->bl =3D bs->file->bs->bl; > + bs->bl.request_alignment =3D request_alignment; > } >=20 > static int raw_truncate(BlockDriverState *bs, int64_t offset) --neYutvxvOLaeuPCA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXVp0KAAoJEH8JsnLIjy/WapIP/3ir2/Ubz85j2cJuMDZaB3Qd 9l2Puy3AreJF6xRc0lVVbxu5uym/Ur8NK8zgnsHOYD/hY7j5EkGuD9yg4uc1HMkm +x+Idv6VFg1KJmPgqWMoqW1VVvFRX/8YfevHq3+np8G9NHNH6Mp1MBEsu45NsYmh 92xuP6OtmRZ36FK4w1kEuwFkXAIIdIIM5obJYUP5qtGTuioGdthDre1nXLYe7ydI wL51pWK6esJxWaxhYXV4CYToZSdHNNlwhPPFGUFF9id2FqrmsOgJ2Tmk8BHPwauw kzS6hO15ET6eGlWvx+qpfsBBrYWzm8/vkYpMSgeKeGjU4W1V3NC1FW8oJQWHrDHJ vRVN5IT4I9SXWFg8F55poMz/Sk+fSHpN0FxPv4zTs/iX3T5ngSF1mmn0ESmpNtEB 4/fnwT5MYHY0usNP/rkaA/w3IlICqEG5zmYtLS+EDPzMjQ6rsy+6m4n0NlJC82qa Dh+YzTZHi1Rci+BvA1YLJ8kaeMDV2mN2JfAjgAXBFqRkeqK0XlcxXQq9UWTA3Ryp K8s51RFZaB+0+X3MVeDj8a1M7GO3It3E9ZL2DNcC/JMpEhHWaXLPiXONXAhAjUon bdRdhCYYYJRFYtvHcrq3si5rO130amr8G5RgkkZUP8OwVylXmIPFAr3TCxicI3me OI5YNcygQPrcqqzHagGa =Lo3N -----END PGP SIGNATURE----- --neYutvxvOLaeuPCA--