From 4f8a066b5fc254eeaabbbde56ba4f5b29cc68fdf Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 13 Sep 2013 15:51:47 +0200 Subject: 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 Reviewed-by: Eric Blake --- hw/sd/pxa2xx_mmci.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hw/sd/pxa2xx_mmci.c') diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 90c955fe62..b9d8b1a3e1 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -539,6 +539,9 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, /* Instantiate the actual storage */ s->card = sd_init(bd, false); + if (s->card == NULL) { + exit(1); + } register_savevm(NULL, "pxa2xx_mmci", 0, 0, pxa2xx_mmci_save, pxa2xx_mmci_load, s); -- cgit v1.2.3