[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/4] ide: wire up setfeatures cache control
From: |
Christoph Hellwig |
Subject: |
[Qemu-devel] [PATCH 3/4] ide: wire up setfeatures cache control |
Date: |
Tue, 15 Mar 2011 15:11:42 +0100 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
Wire up the ATA SETFEATURES subcalls that control the volatile write cache
to the new bdrv_change_cache helper.
Signed-off-by: Christoph Hellwig <address@hidden>
Index: qemu/hw/ide/core.c
===================================================================
--- qemu.orig/hw/ide/core.c 2011-03-15 11:47:18.569636140 +0100
+++ qemu/hw/ide/core.c 2011-03-15 13:07:21.464634347 +0100
@@ -1700,6 +1700,19 @@ void ide_ioport_write(void *opaque, uint
}
}
+static void ide_setcache(IDEState *s, bool enable)
+{
+ if (bdrv_change_cache(s->bs, enable)) {
+ ide_abort_command(s);
+ ide_set_irq(s->bus);
+ return;
+ }
+
+ s->identify_set = 0;
+
+ s->status = READY_STAT | SEEK_STAT;
+ ide_set_irq(s->bus);
+}
void ide_exec_cmd(IDEBus *bus, uint32_t val)
{
@@ -1855,7 +1868,11 @@ void ide_exec_cmd(IDEBus *bus, uint32_t
case 0xcc: /* reverting to power-on defaults enable */
case 0x66: /* reverting to power-on defaults disable */
case 0x02: /* write cache enable */
+ ide_setcache(s, true);
+ break;
case 0x82: /* write cache disable */
+ ide_setcache(s, false);
+ break;
case 0xaa: /* read look-ahead enable */
case 0x55: /* read look-ahead disable */
case 0x05: /* set advanced power management mode */
- [Qemu-devel] [PATCH, RFC 0/4] allow guest control of the volatile write cache, Christoph Hellwig, 2011/03/15
- [Qemu-devel] [PATCH 1/4] block: clarify the meaning of BDRV_O_NOCACHE, Christoph Hellwig, 2011/03/15
- [Qemu-devel] Re: [PATCH 1/4] block: clarify the meaning of BDRV_O_NOCACHE, Stefan Hajnoczi, 2011/03/16
- [Qemu-devel] Re: [PATCH 1/4] block: clarify the meaning of BDRV_O_NOCACHE, Kevin Wolf, 2011/03/16
- [Qemu-devel] Re: [PATCH 1/4] block: clarify the meaning of BDRV_O_NOCACHE, Christoph Hellwig, 2011/03/16
- [Qemu-devel] Re: [PATCH 1/4] block: clarify the meaning of BDRV_O_NOCACHE, Stefan Hajnoczi, 2011/03/16
- [Qemu-devel] Re: [PATCH 1/4] block: clarify the meaning of BDRV_O_NOCACHE, Kevin Wolf, 2011/03/17
- [Qemu-devel] Re: [PATCH 1/4] block: clarify the meaning of BDRV_O_NOCACHE, Stefan Hajnoczi, 2011/03/17
[Qemu-devel] [PATCH 2/4] block: add a helper to change writeback mode on the fly, Christoph Hellwig, 2011/03/15
[Qemu-devel] [PATCH, RFC] virtio_blk: add cache control support, Christoph Hellwig, 2011/03/15