qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 0/5] Geometry and blocksize detection for bac


From: Ekaterina Tumanova
Subject: Re: [Qemu-devel] [PATCH v3 0/5] Geometry and blocksize detection for backing devices.
Date: Fri, 12 Dec 2014 16:10:12 +0300
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 12/05/2014 08:56 PM, Ekaterina Tumanova wrote:
This 3rd revision of the patch set.

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.

updates from v2:
- avoid passing structs as a function result in backend part
- fix patch desctiptions
- add the blkconf_blocksizes call to all the users of BlockConf
- do not change geometry and blocksize values set via command-line, to do that:
remove hardcoding 512 in DEFINE_BLOCK_PROPERTIES. set defaults in
blk_probe_blocksizes (now always succeeds) and call it only if property is 0.
- fix cylinders calculation.
- document blk_probe_geometry call as "currently only for DASD".
- anything I forgot :)

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                        |  35 +++++++++++
  block/block-backend.c          |  10 +++
  block/raw-posix.c              | 135 +++++++++++++++++++++++++++++++++++------
  block/raw_bsd.c                |  14 +++++
  hw/block/block.c               |  18 ++++++
  hw/block/hd-geometry.c         |  12 ++++
  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      |   5 ++
  include/hw/block/block.h       |   5 +-
  include/sysemu/block-backend.h |   2 +
  16 files changed, 237 insertions(+), 20 deletions(-)


friendly *ping* to maintainers of block layer :) I would rather not send next version without getting your feedback first.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]