Skip to content

RFC block: Inquire images’ rotational info

Max Reitz qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3block: Add ImageRotationalInfoblock.c block/qapi.c include/block/block.h +1 more+47 -210 replies
2/3file-posix: Inquire rotational statusblock/file-posix.c+73 -00 replies
3/3qcow2: Evaluate rotational infoblock/qcow2.c block/qcow2.h+33 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [RFC 0/3] block: Inquire images’ rotational info

Hi,

http://lists.nongnu.org/archive/html/qemu-block/2019-05/msg00569.html
shows that optimizations affect HDDs and SSDs differently. It would be nice if we could differentiate between the two and then choose to adjust our behavior depending on whether a given image is stored on an HDD or not.

Or maybe it isn’t so nice. That’s one reason this is an RFC.

The other is that I implemented recognition of the rotational status by querying sysfs. That looks stupid, but I didn’t find a better way (there is a BLKROTATIONAL ioctl, but that only works on device files).

But, hey, if you look through block/file-posix.c, you’ll find that I’m not the first to query sysfs. hdev_get_max_segments() does so, too. So maybe it isn’t that bad of an idea.

What do you think? Is the whole idea stupid? Just the implementation? Or does it make sense?

Max Reitz (3):
block: Add ImageRotationalInfo
file-posix: Inquire rotational status
qcow2: Evaluate rotational info

 qapi/block-core.json  | 19 ++++++++++-
 block/qcow2.h         |  3 ++
 include/block/block.h |  7 +++++
 block.c               | 20 +++++++++++-
 block/file-posix.c    | 73 +++++++++++++++++++++++++++++++++++++++++++
 block/qapi.c          |  3 ++
 block/qcow2.c         | 34 +++++++++++++++++---
 7 files changed, 153 insertions(+), 6 deletions(-)
Signature · 1 line
2.21.0