summary refs log tree commit diff stats
path: root/hw/ide/core.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-08-28 15:47:03 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-04 09:37:27 -0500
commitf455e98cf437c7bb8f2b23888bbd302fef3a3b28 (patch)
tree453978b84f1054ecbfd4c0c18ebc05f8d89474d0 /hw/ide/core.c
parentddd9bbd93bb2c12ade72dff1790d6d292aac073f (diff)
downloadfocaccia-qemu-f455e98cf437c7bb8f2b23888bbd302fef3a3b28.tar.gz
focaccia-qemu-f455e98cf437c7bb8f2b23888bbd302fef3a3b28.zip
ide: pass down DriveInfo instead of BlockDriverState
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ide/core.c')
-rw-r--r--hw/ide/core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 79a3a9c7ad..572a19dab4 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2506,7 +2506,7 @@ void ide_reset(IDEState *s)
     s->media_changed = 0;
 }
 
-void ide_init2(IDEBus *bus, BlockDriverState *hd0, BlockDriverState *hd1,
+void ide_init2(IDEBus *bus, DriveInfo *hd0, DriveInfo *hd1,
                qemu_irq irq)
 {
     IDEState *s;
@@ -2518,7 +2518,10 @@ void ide_init2(IDEBus *bus, BlockDriverState *hd0, BlockDriverState *hd1,
         s = bus->ifs + i;
         s->bus = bus;
         s->unit = i;
-        s->bs = (i == 0) ? hd0 : hd1;
+        if (i == 0 && hd0)
+            s->bs = hd0->bdrv;
+        if (i == 1 && hd1)
+            s->bs = hd1->bdrv;
         s->io_buffer = qemu_blockalign(s->bs, IDE_DMA_BUF_SECTORS*512 + 4);
         if (s->bs) {
             bdrv_get_geometry(s->bs, &nb_sectors);