From d353fb72f59cd0e1f67baf773e74719cda761a89 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 19 May 2011 10:58:19 +0200 Subject: 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 Signed-off-by: Kevin Wolf --- hw/ide/qdev.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/ide/qdev.c') diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 3f9dc89c6d..d9b8f24bb5 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -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=... */ -- cgit 1.4.1