mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
ide: add TRIM support
Add support for TRIM sub function of the data set management command, and wire it up to the qemu discard infrastructure. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
4e1e00515e
commit
d353fb72f5
5 changed files with 124 additions and 5 deletions
|
@ -125,6 +125,11 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind)
|
|||
const char *serial;
|
||||
DriveInfo *dinfo;
|
||||
|
||||
if (dev->conf.discard_granularity && dev->conf.discard_granularity != 512) {
|
||||
error_report("discard_granularity must be 512 for ide");
|
||||
return -1;
|
||||
}
|
||||
|
||||
serial = dev->serial;
|
||||
if (!serial) {
|
||||
/* try to fall back to value set with legacy -drive serial=... */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue