summary refs log tree commit diff stats
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/ide.c5
-rw-r--r--hw/scsi-disk.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/hw/ide.c b/hw/ide.c
index ffe0230d8a..debbc0f418 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -1656,6 +1656,11 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
             break;
         case WIN_FLUSH_CACHE:
         case WIN_FLUSH_CACHE_EXT:
+            if (s->bs)
+                bdrv_flush(s->bs);
+	    s->status = READY_STAT;
+            ide_set_irq(s);
+            break;
 	case WIN_STANDBYNOW1:
         case WIN_IDLEIMMEDIATE:
 	    s->status = READY_STAT;
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 7390805d24..decab1f42b 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -373,7 +373,7 @@ int32_t scsi_send_command(SCSIDevice *s, uint32_t tag, uint8_t *buf, int lun)
         break;
     case 0x35:
         DPRINTF("Syncronise cache (sector %d, count %d)\n", lba, len);
-        /* ??? Extend block layer and use fsync to implement this.  */
+        bdrv_flush(s->bdrv);
         break;
     case 0x43:
         {