summary refs log tree commit diff stats
path: root/hw/ide/macio.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-05-19 10:58:19 +0200
committerKevin Wolf <kwolf@redhat.com>2011-06-15 14:36:16 +0200
commitd353fb72f59cd0e1f67baf773e74719cda761a89 (patch)
tree994311cabf1fd896af097c7165fa4176b991c09c /hw/ide/macio.c
parent4e1e00515e2522bbae98a0653ea2692ec20851ac (diff)
downloadfocaccia-qemu-d353fb72f59cd0e1f67baf773e74719cda761a89.tar.gz
focaccia-qemu-d353fb72f59cd0e1f67baf773e74719cda761a89.zip
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>
Diffstat (limited to 'hw/ide/macio.c')
-rw-r--r--hw/ide/macio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 099b8cbfe9..7daeb31ec3 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -154,6 +154,10 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
         m->aiocb = dma_bdrv_write(s->bs, &s->sg, sector_num,
 		                  pmac_ide_transfer_cb, io);
         break;
+    case IDE_DMA_TRIM:
+        m->aiocb = dma_bdrv_io(s->bs, &s->sg, sector_num,
+                               ide_issue_trim, pmac_ide_transfer_cb, s, 1);
+        break;
     }
 
     if (!m->aiocb)