@@ -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 */