qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v1 0/2] Reporting of rotation rate for disks
@ 2017-10-04 11:40 Daniel P. Berrange
  2017-10-04 11:40 ` [Qemu-devel] [PATCH v1 1/2] scsi-disk: support reporting of rotation rate Daniel P. Berrange
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Daniel P. Berrange @ 2017-10-04 11:40 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, John Snow, Daniel P. Berrange

While looking at libvirt tagged questions on serverfault I saw
someone ask how to indicate that a virtual disk is an SSD rather
than rotating rust.

https://serverfault.com/questions/876467/how-to-add-virtual-storage-as-ssd-in-kvm

IIUC, IDE / SCSI don't really have an explicit concept of a
disk being SSD vs HDD, but they do have a means of reporting
the disk rotation rate and both specify that SSDs should
report RPM==1.

Linux uses this to determine whether to set the 'rotational'
property to 0 for the I/O queue, and also whether to allow
the disk to contribute random entropy (only HDDs contribute).

This felt like something QEMU ought to allow the mgmt application
to set based on the storage it is using to back the virtual block
devices. So this series adds a 'rotation_rate' property to the
SCSI and IDE disks, taking an RPM value per their respective
specifications.

There is no mechanism to report this information to virtio-blk.
We could perhaps argue that people should use virtio-scsi instead,
because fixing virtio-blk would require enhancement to both QEMU
and Linux virtio-blk drivers (and other guest OS drivers too)

I'm unclear if there is anything I should have done wrt the
device migration vmstate when adding this extra field, or if it
is safe to just expect the mgmt app to set the property correctly
on src+dst ?

Daniel P. Berrange (2):
  scsi-disk: support reporting of rotation rate
  ide: support reporting of rotation rate

 hw/ide/core.c             |  1 +
 hw/ide/qdev.c             |  1 +
 hw/scsi/scsi-disk.c       | 20 ++++++++++++++++++++
 include/hw/ide/internal.h |  8 ++++++++
 4 files changed, 30 insertions(+)

-- 
2.13.5

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

end of thread, other threads:[~2017-10-23 17:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-04 11:40 [Qemu-devel] [PATCH v1 0/2] Reporting of rotation rate for disks Daniel P. Berrange
2017-10-04 11:40 ` [Qemu-devel] [PATCH v1 1/2] scsi-disk: support reporting of rotation rate Daniel P. Berrange
2017-10-04 15:44   ` Eric Blake
2017-10-04 16:49   ` Dr. David Alan Gilbert
2017-10-04 16:56     ` Daniel P. Berrange
2017-10-04 11:40 ` [Qemu-devel] [PATCH v1 2/2] ide: " Daniel P. Berrange
2017-10-04 15:45   ` Eric Blake
2017-10-04 15:57   ` John Snow
2017-10-20  8:42   ` Kevin Wolf
2017-10-20  9:02     ` Daniel P. Berrange
2017-10-23 17:17       ` John Snow
2017-10-04 12:19 ` [Qemu-devel] [PATCH v1 0/2] Reporting of rotation rate for disks Daniel P. Berrange
2017-10-10 10:18 ` Paolo Bonzini

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