From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avQXI-0002T2-AP for qemu-devel@nongnu.org; Wed, 27 Apr 2016 10:33:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avQXH-0006WS-BE for qemu-devel@nongnu.org; Wed, 27 Apr 2016 10:33:52 -0400 Date: Wed, 27 Apr 2016 16:33:41 +0200 From: Kevin Wolf Message-ID: <20160427143341.GC4756@noname.str.redhat.com> References: <1461750767-23273-1-git-send-email-kwolf@redhat.com> <1461750767-23273-7-git-send-email-kwolf@redhat.com> <20160427140647.GF1985@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <20160427140647.GF1985@stefanha-x1.localdomain> Subject: Re: [Qemu-devel] [PATCH 06/17] bochs: Implement .bdrv_co_preadv() interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-block@nongnu.org, mreitz@redhat.com, famz@redhat.com, sw@weilnetz.de, qemu-devel@nongnu.org --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Am 27.04.2016 um 16:06 hat Stefan Hajnoczi geschrieben: > On Wed, Apr 27, 2016 at 11:52:36AM +0200, Kevin Wolf wrote: > > Signed-off-by: Kevin Wolf > > --- > > block/bochs.c | 46 +++++++++++++++++++++++++++++----------------- > > 1 file changed, 29 insertions(+), 17 deletions(-) > >=20 > > diff --git a/block/bochs.c b/block/bochs.c > > index af8b7ab..d148454 100644 > > --- a/block/bochs.c > > +++ b/block/bochs.c > > @@ -104,6 +104,7 @@ static int bochs_open(BlockDriverState *bs, QDict *= options, int flags, > > int ret; > > =20 > > bs->read_only =3D 1; // no write support yet > > + bs->request_alignment =3D BDRV_SECTOR_SIZE; /* No sub-sector I/O s= upported */ >=20 > Can this be the default in block.c? Drivers that have other alignment > characteristics can set it explicitly but most drivers will want > BDRV_SECTOR_SIZE so it's nice to make it common code. I absolutely don't expect BDRV_SECTOR_SIZE to be what most drivers will want. It's basically a sign that a driver is either a protocol that imposes restrictions (like O_DIRECT on raw-posix) or it is broken and we don't care enough about the emulation overhead to fix it (like this one). The expected value for most block drivers is 1. > > while (nb_sectors > 0) { > > int64_t block_offset =3D seek_to_sector(bs, sector_num); > > if (block_offset < 0) { > > return block_offset; >=20 > s->lock must be unlocked. I can't believe I messed this up in so many places. Thanks for catching this, I'll have to go through all patches and check the locking. Kevin --oyUTqETQ0mS9luUI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJXIM3FAAoJEH8JsnLIjy/WgSIQALooPXqajLvso09wKvfaVtMl xnxdvmPdC3yAg6/qz8L+2VvB/ePw9+/EpAOtDUPtknPtiwscejie66wltYAPmrYx YRtHakpwTs03nLN3EeuKbS+N/QmQ3S4Ajl0ceAb9k2e31u0OpegaKinl8V/i1MMh ghYJ6utzfJyOM//zPusZtmCBP0674O+DeV7/wyzmvKyb7rLyKz4UaYlSkvdUownh SxXP7gGctEMZebUyA4y5qo+8qxLqlKWp4UUycAf33X6WvUCPMxESpCEgoejJ47XY EbikeYr+5zAl33L5Hf91XipTFMLShrOTIZp6CP+p8DF+mwJ5E5maI94vkRXBgn7+ ewr3YE/fdGm707tudGt0IpZNMQmhZ3Wrr/CLUTfigwfZEoaaj5SVaugIw7lZeHBD /+yPtsEHH2Mdfrum59sSXKnjQHVxttrf9pW3Fh2MWbbGJy1OWJKTa7tCD3/Tlj8V 86aX0SZQvw3ffgOIkpM+bNMqiYAhXrtsz1GuNnsDeBnUWgrYca4sCBl4qZHsoAjc 5BWqEboK8GKBW3bAS+Xcp/885yPurEGuOkR7Qj4ZY1ODEu5uiY+8U32LZlv5Tijp IjNhAfRXT5yGMfIP2CUZUx+CgENyCsYNBSAGlMzYAefBMyy93Aw3PMgO15mIOZSW kJ4QIcvK75bLjEHGNUvt =xwS0 -----END PGP SIGNATURE----- --oyUTqETQ0mS9luUI--