Received: from eggs.gnu.org ([2001:4830:134:3::10]:33926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJNjw-0006Jq-Ir for qemu-devel@nongnu.org; Thu, 05 Feb 2015 09:49:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJNjo-0002Ma-K2 for qemu-devel@nongnu.org; Thu, 05 Feb 2015 09:49:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJNjo-0002MC-Ci for qemu-devel@nongnu.org; Thu, 05 Feb 2015 09:49:00 -0500 Date: Thu, 5 Feb 2015 14:48:51 +0000 From: Stefan Hajnoczi Message-ID: <20150205144851.GJ19277@stefanha-thinkpad.redhat.com> References: <1421678101-44779-1-git-send-email-tumanova@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0FRtVia6Q6lt+M0P" Content-Disposition: inline In-Reply-To: <1421678101-44779-1-git-send-email-tumanova@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v6 0/5] Geometry and blocksize detection for backing devices. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ekaterina Tumanova Cc: kwolf@redhat.com, thuth@linux.vnet.ibm.com, dahi@linux.vnet.ibm.com, Public KVM Mailing List , armbru@redhat.com, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, mihajlov@linux.vnet.ibm.com --0FRtVia6Q6lt+M0P Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 19, 2015 at 03:34:56PM +0100, Ekaterina Tumanova wrote: > Updates v5 -> v6: >=20 > Minor Updates according the last review from Stefan Hajnoczi: > 1. Do not change the flow of code, factored out of raw_probe_alignment. > 2. added #ifdef __linux__ in 2 places of raw-posix.c, mentioned by review= er. > 3. adjusted the comment hdev_probe_geometry according suggestment. > 4. use bdrv_nb_sectors(bs) instead of bs->total_sectors. > 5. do not discard error blk_probe_blocksizes(). now has rc. > 6. put the 512-byte default blocksize value in blkconf_blocksizes. > 7. drop the default parameter from the DEFINE_PROP_BLOCKSIZE() macro. >=20 > Thanks, > Kate. >=20 > --------------------------------------------------------------- > Patchset Description (didn't change): >=20 > Proper geometry and blocksize information is vital for support of > DASD/ECKD drives in Linux guests. Otherwise things will fail in > certain cases. >=20 > The existing geometry and blocksize qemu defaults have no sense > for DASD drives (hd_geometry_guess detection and 512 for sizes). > Setting this information manually in XML file is far from user-friendly, > as the admin has to manually look up the properties of the > host disks and then modify the guest definition accordingly. >=20 > Since Linux uses DASDs as normal block devices, we actually > want to use virtio-blk to pass those to KVM guests. >=20 > In order to avoid any change in behavior of other drives, the DASD > special casing was advised. We call ioctl BIODASDINFO2 on the block > device, which will only succeed if the device is really a DASD. >=20 > In order to retrieve the underlying device geometry and blocksizes > a new block-backend functions and underlying driver functions were > introduced (blk_probe_blocksizes anf blk_probe_geometry wrappers > and corresponding bdrv_xxxxxx functions). >=20 > As for now only "host_device" driver received new detection methods. > For "raw" we call childs method as usual. In future one may update > other drivers to add some other detection heuristics. >=20 > If the host_device appears to be a DASD, the driver functions > (hdev_probe_blocksizes and hdev_probe_geometry) will call certain > ioctls in order to detect geometry and blocksizes of the underlying devic= e. > if probing failed bdrv_probe_blocksizes caller will set defaults, > and bdrv_probe_geometry will fail to allow fallback to old detection logi= c. >=20 > The front-end (BlockConf API) was updated: > 1. a new blkconf_blocksizes function was added. It doesn't > change user-defined blocksize values. If properties are unset, it will > set values, returned by blk_probe_backend. In order to allow this logic, > blocksize properties were initialized with 0. (driver will return 512 if > backing device probing didn't succeed or if driver method is not defined). > 2. hd_geometry guess was changed to firstly try to retrieve values via > blk_probe_geometry and if it fails, fallback to the old logic. >=20 > Ekaterina Tumanova (5): > block: add bdrv functions for geometry and blocksize > raw-posix: Factor block size detection out of raw_probe_alignment() > block: Add driver methods to probe blocksizes and geometry > block-backend: Add wrappers for blocksizes and geometry probing > BlockConf: Call backend functions to detect geometry and blocksizes >=20 > block.c | 36 ++++++++++ > block/block-backend.c | 10 +++ > block/raw-posix.c | 154 +++++++++++++++++++++++++++++++++++= +----- > block/raw_bsd.c | 12 ++++ > hw/block/block.c | 20 ++++++ > hw/block/hd-geometry.c | 10 ++- > hw/block/nvme.c | 1 + > hw/block/virtio-blk.c | 1 + > hw/core/qdev-properties.c | 3 +- > hw/ide/qdev.c | 1 + > hw/scsi/scsi-disk.c | 1 + > hw/usb/dev-storage.c | 1 + > include/block/block.h | 13 ++++ > include/block/block_int.h | 15 ++++ > include/hw/block/block.h | 5 +- > include/hw/qdev-properties.h | 4 +- > include/sysemu/block-backend.h | 2 + > 17 files changed, 267 insertions(+), 22 deletions(-) >=20 > --=20 > 2.1.4 >=20 Reviewed-by: Stefan Hajnoczi --0FRtVia6Q6lt+M0P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU04LTAAoJEJykq7OBq3PIBjcH/2TR/9pMaIBAONFlQyRFnnFD X176CQANLf6NMyaoUgy5hjcnjZTvy8jzU+bR2Ci8786p0mwJ6RIYwJ/29AVxB3yV xm7UIZ1Yagn8esZp5LMXqPLxykSPqBySM64LITqJ+1OPg72vNVG6c5hHwpvt+w00 CU/K3b5TMmJd++NAKiSQNFmnQzgouU5FRG8pom50rYXcYOMkczyy8KMJN8u8xoOg 97UCCokTQ6PWXvPfLFGLUjKFosRtCs0/1megeO1sm1jZ8hS4Es1wLdywkFKmPKKl WovcclN3Zp6gQWGpDFNQd5nBa3WZnGA9lWkQAWjRT3r3GZ5wXbaYhP0tSYfm34Y= =wIyN -----END PGP SIGNATURE----- --0FRtVia6Q6lt+M0P--