]> git.proxmox.com Git - qemu-server.git/commit
Add `ssd` property to IDE, SATA, and SCSI drives
authorNick Chevsky <nchevsky@gmail.com>
Sun, 28 Oct 2018 20:41:46 +0000 (16:41 -0400)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Oct 2018 08:22:20 +0000 (09:22 +0100)
commit6c875f9f315f2dc7a0a3a988622c2efdf089b171
treec89ebf3fc6390d97e12a6c1265480be7976b3c19
parent5795e6188cdbf1c25d62f00f5264bff4dba5ecf2
Add `ssd` property to IDE, SATA, and SCSI drives

When enabled, the `ssd` property exposes drives as SSDs (rather than
rotational hard disks) by setting QEMU's `rotation_rate` property [1,
2] on `ide-hd`, `scsi-block`, and `scsi-hd` devices. This is required
to enable support for TRIM and SSD-specific optimizations in certain
guest operating systems that are limited to emulated controller types
(IDE, AHCI, and non-VirtIO SCSI).

This change also unifies the diverging IDE and SATA code paths in
QemuServer::print_drivedevice_full(), which suffered from:
* Code duplication: The only differences between IDE and SATA were in
bus-unit specification and maximum device counts.
* Inconsistent implementation: The IDE code used the new `ide-hd`
and `ide-cd` device types, whereas SATA still relied on the deprecated
`ide-drive` [3, 4] (which doesn't support `rotation_rate`).
* Different feature sets: The IDE code exposed a `model` property that
the SATA code didn't, even though QEMU supports it for both.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1498042
[2] https://lists.gnu.org/archive/html/qemu-devel/2017-10/msg00698.html
[3] https://www.redhat.com/archives/libvir-list/2012-March/msg00684.html
[4] https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg02024.html

Signed-off-by: Nick Chevsky <nchevsky@gmail.com>
PVE/QemuServer.pm