From: Riku Voipio <riku.voi...@nokia.com> N900 and other devices can have more than one sd/mmc card, and thus the -sd command line option needs to be read multiple times.
Signed-Off-By: Riku Voipio <riku.voi...@nokia.com> --- vl.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vl.c b/vl.c index d69250c..b4dfb2e 100644 --- a/vl.c +++ b/vl.c @@ -752,7 +752,7 @@ static int bt_parse(const char *opt) #define FD_ALIAS "index=%d,if=floppy" #define PFLASH_ALIAS "if=pflash" #define MTD_ALIAS "if=mtd" -#define SD_ALIAS "index=0,if=sd" +#define SD_ALIAS "index=%d,if=sd" QemuOpts *drive_add(const char *file, const char *fmt, ...) { @@ -3738,6 +3738,7 @@ int main(int argc, char **argv, char **envp) CPUState *env; int show_vnc_port = 0; int defconfig = 1; + int sd_device_index = 0; error_set_progname(argv[0]); @@ -3920,7 +3921,7 @@ int main(int argc, char **argv, char **envp) drive_add(optarg, MTD_ALIAS); break; case QEMU_OPTION_sd: - drive_add(optarg, SD_ALIAS); + drive_add(optarg, SD_ALIAS, sd_device_index++); break; case QEMU_OPTION_pflash: drive_add(optarg, PFLASH_ALIAS); @@ -4762,7 +4763,7 @@ int main(int argc, char **argv, char **envp) if (default_sdcard) { /* we always create one sd slot, even if no card is in it */ - drive_add(NULL, SD_ALIAS); + drive_add(NULL, SD_ALIAS, 0); } /* open the virtual block devices */ -- 1.6.5