From patchwork Fri Mar 26 16:06:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 48670 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 806DCB7CEE for ; Sat, 27 Mar 2010 04:04:28 +1100 (EST) Received: from localhost ([127.0.0.1]:36455 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvCxM-0002Bj-PN for incoming@patchwork.ozlabs.org; Fri, 26 Mar 2010 13:04:24 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvC5M-00043V-Qa for qemu-devel@nongnu.org; Fri, 26 Mar 2010 12:08:37 -0400 Received: from [140.186.70.92] (port=41681 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvC4T-0003fg-5f for qemu-devel@nongnu.org; Fri, 26 Mar 2010 12:08:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvC4A-0006tu-Tx for qemu-devel@nongnu.org; Fri, 26 Mar 2010 12:07:37 -0400 Received: from afflict.kos.to ([92.243.29.197]:33631) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvC4A-0006tO-OD for qemu-devel@nongnu.org; Fri, 26 Mar 2010 12:07:22 -0400 Received: by afflict.kos.to (Postfix, from userid 1000) id 0832A265B4; Fri, 26 Mar 2010 16:07:22 +0000 (UTC) From: Riku Voipio To: qemu-devel@nongnu.org Date: Fri, 26 Mar 2010 16:06:37 +0000 Message-Id: X-Mailer: git-send-email 1.6.5 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Riku Voipio Subject: [Qemu-devel] [PATCH 17/48] add multi-sd support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Riku Voipio 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 --- 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 */