Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DLNrH-0003c8-T5 for qemu-devel@nongnu.org; Tue, 12 Apr 2005 12:03:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DLNrC-0003Yz-96 for qemu-devel@nongnu.org; Tue, 12 Apr 2005 12:03:21 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DLNrA-0003Vp-Pq for qemu-devel@nongnu.org; Tue, 12 Apr 2005 12:03:16 -0400 Received: from [217.65.98.56] (helo=shiva.galaktik.hu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DLOIG-0006Np-FF for qemu-devel@nongnu.org; Tue, 12 Apr 2005 12:31:16 -0400 Received: from [10.0.0.201] (helo=caprice.artificis.hu) by shiva.galaktik.hu with esmtp (Exim 3.35 #1 (Debian)) id 1DLPxV-0005Ut-00 for ; Tue, 12 Apr 2005 20:17:57 +0200 Date: Tue, 12 Apr 2005 18:34:08 +0200 From: Alex Beregszaszi Message-Id: <20050412183408.504bcc10@caprice.artificis.hu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Tue__12_Apr_2005_18_34_08_+0200_E+.vo+jY7XfZyYB." Subject: [Qemu-devel] [PATCH] user-friendly boot option Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --Multipart=_Tue__12_Apr_2005_18_34_08_+0200_E+.vo+jY7XfZyYB. Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi, this patch is making the boot option a bit more user friendly, nothing more. Additions: * fd / floppy * hd / disk * cd / cdrom * net Also the old (a, c, d, n) values are working. Btw, are there any plans changing the boot_device variable to using some constants (or enumeration) instead the char type? -- Alex Beregszaszi e-mail: alex@fsn.hu Free Software Network cell: +36 70 3144424 --Multipart=_Tue__12_Apr_2005_18_34_08_+0200_E+.vo+jY7XfZyYB. Content-Type: text/x-diff; name="vl.diff" Content-Disposition: attachment; filename="vl.diff" Content-Transfer-Encoding: 7bit Index: vl.c =================================================================== RCS file: /cvsroot/qemu/qemu/vl.c,v retrieving revision 1.126 diff -u -r1.126 vl.c --- vl.c 7 Apr 2005 22:20:28 -0000 1.126 +++ vl.c 12 Apr 2005 16:28:26 -0000 @@ -3196,7 +3196,16 @@ has_cdrom = 1; break; case QEMU_OPTION_boot: - boot_device = optarg[0]; + if (!strncasecmp(optarg, "fd", 2) || !strcasecmp(optarg, "floppy")) + boot_device = 'a'; + else if (!strncasecmp(optarg, "hd", 2) || !strcasecmp(optarg, "disk")) + boot_device = 'c'; + else if (!strncasecmp(optarg, "cd", 2) || !strcasecmp(optarg, "cdrom")) + boot_device = 'd'; + else if (!strcasecmp(optarg, "net") || !strcasecmp(optarg, "network")) + boot_device = 'n'; + else + boot_device = optarg[0]; if (boot_device != 'a' && #ifdef TARGET_SPARC // Network boot --Multipart=_Tue__12_Apr_2005_18_34_08_+0200_E+.vo+jY7XfZyYB.--