diff options
author | Kevin Wolf <kwolf@redhat.com> | 2013-09-13 15:51:47 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-10-11 16:50:01 +0200 |
commit | 4f8a066b5fc254eeaabbbde56ba4f5b29cc68fdf (patch) | |
tree | caca58e5bd84ca7eaf74ed97b128ca966c29ba98 /hw/sd/omap_mmc.c | |
parent | 394c7d4d6bd06386308e2fef0cf1c613a10e0d23 (diff) |
blockdev: Remove IF_* check for read-only blockdev_init
IF_NONE allows read-only, which makes forbidding it in this place
for other types pretty much pointless.
Instead, make sure that all devices for which the check would have
errored out check in their init function that they don't get a read-only
BlockDriverState. This catches even cases where IF_NONE and -device is
used.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'hw/sd/omap_mmc.c')
-rw-r--r-- | hw/sd/omap_mmc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index bf5d1fbf6d..937a47869a 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -593,6 +593,9 @@ struct omap_mmc_s *omap_mmc_init(hwaddr base, /* Instantiate the storage */ s->card = sd_init(bd, false); + if (s->card == NULL) { + exit(1); + } return s; } @@ -618,6 +621,9 @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta, /* Instantiate the storage */ s->card = sd_init(bd, false); + if (s->card == NULL) { + exit(1); + } s->cdet = qemu_allocate_irqs(omap_mmc_cover_cb, s, 1)[0]; sd_set_cb(s->card, NULL, s->cdet); |