qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v7 0/5] Geometry and blocksize detection for backing devices.
@ 2015-02-16 11:47 Ekaterina Tumanova
  2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 1/5] block: add bdrv functions for geometry and blocksize Ekaterina Tumanova
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Ekaterina Tumanova @ 2015-02-16 11:47 UTC (permalink / raw)
  To: Public KVM Mailing List
  Cc: kwolf, thuth, dahi, Ekaterina Tumanova, armbru, mihajlov,
	borntraeger, stefanha, cornelia.huck


Updates v6 -> v7:

Fix  
1. Set default blocksizes via blkconf_blocksizes call in ide_dev_initfn
and scsi_hd_realise before using these values.
2. Remove asserts in bdrv functions, check drv for being NULL instead.
3. Adjust logic in blkconf_blocksizes to use command-line blocksize values
(if they are in place) without any dependency on block backend probing.

p.s. Make check now suceeds.

p.p.s. Stefan, please notify if you need to re-review.

Thanks,
Kate.

---------------------------------------------------------------
   Patchset Description (didn't change):

Proper geometry and blocksize information is vital for support of
DASD/ECKD drives in Linux guests. Otherwise things will fail in
certain cases.

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.

Since Linux uses DASDs as normal block devices, we actually
want to use virtio-blk to pass those to KVM guests.

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.

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).

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.

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 device.
if probing failed bdrv_probe_blocksizes caller will set defaults,
and bdrv_probe_geometry will fail to allow fallback to old detection logic.

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.

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

 block.c                        |  34 +++++++++
 block/block-backend.c          |  10 +++
 block/raw-posix.c              | 154 ++++++++++++++++++++++++++++++++++++-----
 block/raw_bsd.c                |  12 ++++
 hw/block/block.c               |  24 +++++++
 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            |   2 +
 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, 270 insertions(+), 22 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-03-03 14:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-16 11:47 [Qemu-devel] [PATCH v7 0/5] Geometry and blocksize detection for backing devices Ekaterina Tumanova
2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 1/5] block: add bdrv functions for geometry and blocksize Ekaterina Tumanova
2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 2/5] raw-posix: Factor block size detection out of raw_probe_alignment() Ekaterina Tumanova
2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 3/5] block: Add driver methods to probe blocksizes and geometry Ekaterina Tumanova
2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 4/5] block-backend: Add wrappers for blocksizes and geometry probing Ekaterina Tumanova
2015-02-16 11:47 ` [Qemu-devel] [PATCH v7 5/5] BlockConf: Call backend functions to detect geometry and blocksizes Ekaterina Tumanova
2015-02-27 16:22   ` Max Reitz
2015-02-27 18:26     ` [Qemu-devel] [PATCH 0/1] Ekaterina Tumanova
2015-02-27 18:26       ` [Qemu-devel] [PATCH 1/1] scsi-hd: fix property unset case Ekaterina Tumanova
2015-02-27 18:29         ` Max Reitz
2015-02-27 18:58           ` Stefan Hajnoczi
2015-03-02  8:46         ` Markus Armbruster
2015-03-02  9:07           ` Ekaterina Tumanova
2015-03-02 12:04             ` Markus Armbruster
2015-03-02  9:28       ` [Qemu-devel] [PATCH 0/1] Kevin Wolf
2015-03-03  8:15         ` [Qemu-devel] [PATCH] Add testcase for scsi-hd devices without drive property Christian Borntraeger
2015-03-03 14:17           ` Christian Borntraeger
2015-03-03 14:31             ` Max Reitz
2015-02-24  9:13 ` [Qemu-devel] [PATCH v7 0/5] Geometry and blocksize detection for backing devices Christian Borntraeger
2015-02-24 10:44 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).