From e4bcb14c79fb63a35aef3eb39e02c16c19b8b28d Mon Sep 17 00:00:00 2001 From: ths Date: Sun, 2 Dec 2007 04:51:10 +0000 Subject: Add -drive parameter, by Laurent Vivier. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3759 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/spitz.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'hw/spitz.c') diff --git a/hw/spitz.c b/hw/spitz.c index 461a60dd83..159c633789 100644 --- a/hw/spitz.c +++ b/hw/spitz.c @@ -940,9 +940,14 @@ static void spitz_ssp_attach(struct pxa2xx_state_s *cpu) static void spitz_microdrive_attach(struct pxa2xx_state_s *cpu) { struct pcmcia_card_s *md; - BlockDriverState *bs = bs_table[0]; + int index; + BlockDriverState *bs; - if (bs && bdrv_is_inserted(bs) && !bdrv_is_removable(bs)) { + index = drive_get_index(IF_IDE, 0, 0); + if (index == -1) + return; + bs = drives_table[index].bdrv; + if (bdrv_is_inserted(bs) && !bdrv_is_removable(bs)) { md = dscm1xxxx_init(bs); pxa2xx_pcmcia_attach(cpu->pcmcia[1], md); } -- cgit v1.2.3-55-g7522