From: Aurelien Jarno Date: Sun, 19 May 2013 11:22:11 +0000 (+0200) Subject: ide/macio: fix wrong opaque with TRIM support X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b9b5df6f0cee6b09ef3b2e5228761dd3c2cdcad7;p=qemu.git ide/macio: fix wrong opaque with TRIM support Commit 215e47b9 enabled TRIM by default, which revealed a bug in TRIM support for the IDE macio emulation driver, introduced in d353fb72. The call to dma_bdrv_io() is using a wrong opaque of type IDEState instead of DBDMA_io. This patch fixes that. Fixes LP#1179104 Reported-by: Michael Tokarev Tested-off-by: Michael Tokarev Reviewed-by: Paolo Bonzini Signed-off-by: Aurelien Jarno --- diff --git a/hw/ide/macio.c b/hw/ide/macio.c index bf12a100d4..e1e4f41597 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -144,7 +144,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret) break; case IDE_DMA_TRIM: m->aiocb = dma_bdrv_io(s->bs, &s->sg, sector_num, - ide_issue_trim, pmac_ide_transfer_cb, s, + ide_issue_trim, pmac_ide_transfer_cb, io, DMA_DIRECTION_TO_DEVICE); break; }