s390-ccw: parse and set boot menu options

Set boot menu options for an s390 guest and store them in
the iplb. These options are set via the QEMU command line
option:

    -boot menu=on|off[,splash-time=X]

or via the libvirt domain xml:

    <os>
      <bootmenu enable='yes|no' timeout='X'/>
    </os>

Where X represents some positive integer representing
milliseconds.

Any value set for loadparm will override all boot menu options.
If loadparm=PROMPT, then the menu will be enabled without a
timeout.

Signed-off-by: Collin L. Walling <walling@linux.vnet.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Collin L. Walling 2018-02-23 10:43:12 -05:00 committed by Thomas Huth
parent 118ee80f79
commit 26b2a2a491
3 changed files with 66 additions and 4 deletions

View file

@ -91,6 +91,9 @@ void s390_reipl_request(void);
#define QIPL_ADDRESS 0xcc
/* Boot Menu flags */
#define QIPL_FLAG_BM_OPTS_CMD 0x80
/*
* The QEMU IPL Parameters will be stored at absolute address
* 204 (0xcc) which means it is 32-bit word aligned but not
@ -104,9 +107,11 @@ void s390_reipl_request(void);
* in pc-bios/s390-ccw/iplb.h.
*/
struct QemuIplParameters {
uint8_t reserved1[4];
uint8_t qipl_flags;
uint8_t reserved1[3];
uint64_t netboot_start_addr;
uint8_t reserved2[16];
uint32_t boot_menu_timeout;
uint8_t reserved2[12];
} QEMU_PACKED;
typedef struct QemuIplParameters QemuIplParameters;