summary refs log tree commit diff stats
path: root/hw/sd/sd.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2015-08-17 15:20:33 -0400
committerStefan Hajnoczi <stefanha@redhat.com>2015-10-12 09:21:10 +0100
commit5ec911c30ff4337d4185e29e82a254349f5a22da (patch)
tree6ae39c5bf456eb94da8ab33786d98059f8cc632a /hw/sd/sd.c
parentb37686f7e84b22cfaf7fd01ac5133f2617cc3027 (diff)
downloadfocaccia-qemu-5ec911c30ff4337d4185e29e82a254349f5a22da.tar.gz
focaccia-qemu-5ec911c30ff4337d4185e29e82a254349f5a22da.zip
sdhci: Pass drive parameter to sdhci-pci via qdev property
Commit 19109131 disabled the sdhci-pci support because it used
drive_get_next().  This patch reenables sdhci-pci and changes it to
pass the drive via a qdev property - for example:
 -device sdhci-pci,drive=drive0 -drive id=drive0,if=sd,file=myimage

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/sd/sd.c')
-rw-r--r--hw/sd/sd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 3e2a451154..393a75c0bc 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -492,7 +492,9 @@ SDState *sd_init(BlockBackend *blk, bool is_spi)
     sd->blk = blk;
     sd_reset(sd);
     if (sd->blk) {
-        blk_attach_dev_nofail(sd->blk, sd);
+        /* Attach dev if not already attached.  (This call ignores an
+         * error return code if sd->blk is already attached.) */
+        blk_attach_dev(sd->blk, sd);
         blk_set_dev_ops(sd->blk, &sd_block_ops, sd);
     }
     vmstate_register(NULL, -1, &sd_vmstate, sd);