Add boot menu control via command line switch

Disable the lengthy BIOS prompt for selecting a boot device by default,
but let the user reenable it via '-boot menu=on'.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/vl.c b/vl.c
index 7360d4f..2fbea37 100644
--- a/vl.c
+++ b/vl.c
@@ -254,6 +254,7 @@
 #endif
 int nb_drives_opt;
 struct drive_opt drives_opt[MAX_DRIVES];
+int boot_menu;
 
 int nb_numa_nodes;
 uint64_t node_mem[MAX_NODES];
@@ -5121,7 +5122,7 @@
             case QEMU_OPTION_boot:
                 {
                     static const char * const params[] = {
-                        "order", "once", NULL
+                        "order", "once", "menu", NULL
                     };
                     char buf[sizeof(boot_devices)];
                     char *standard_boot_devices;
@@ -5151,6 +5152,19 @@
                             qemu_register_reset(restore_boot_devices,
                                                 standard_boot_devices);
                         }
+                        if (get_param_value(buf, sizeof(buf),
+                                            "menu", optarg)) {
+                            if (!strcmp(buf, "on")) {
+                                boot_menu = 1;
+                            } else if (!strcmp(buf, "off")) {
+                                boot_menu = 0;
+                            } else {
+                                fprintf(stderr,
+                                        "qemu: invalid option value '%s'\n",
+                                        buf);
+                                exit(1);
+                            }
+                        }
                     }
                 }
                 break;