Skip to contentSkip to conversation

user-friendly boot option

PATCH New Alex Beregszaszi 1 participant 1 message Apr 12, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 user-friendly boot option

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?

Signature · 2 lines
Alex Beregszaszi 			e-mail: [email protected]
Free Software Network			cell: +36 70 3144424

Index: vl.c
===================================================================
RCS file: /cvsroot/qemu/qemu/vl.c,v
retrieving revision 1.126

vl.c +10 -1
diff -u -r1.126 vl.c
@@ -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