]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/Library/PlatformBdsLib/QemuBootOrder.h
OvmfPkg: get boot order from QEMU
[mirror_edk2.git] / OvmfPkg / Library / PlatformBdsLib / QemuBootOrder.h
CommitLineData
2cd086a6 1/** @file\r
2 Rewrite the BootOrder NvVar based on QEMU's "bootorder" fw_cfg file --\r
3 include file.\r
4\r
5 Copyright (C) 2012, Red Hat, Inc.\r
6\r
7 This program and the accompanying materials are licensed and made available\r
8 under the terms and conditions of the BSD License which accompanies this\r
9 distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT\r
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14**/\r
15\r
16\r
17#include <Uefi/UefiBaseType.h>\r
18#include <Base.h>\r
19\r
20\r
21/**\r
22\r
23 Set the boot order based on configuration retrieved from QEMU.\r
24\r
25 Attempt to retrieve the "bootorder" fw_cfg file from QEMU. Translate the\r
26 OpenFirmware device paths therein to UEFI device path fragments. Match the\r
27 translated fragments against BootOptionList, and rewrite the BootOrder NvVar\r
28 so that it corresponds to the order described in fw_cfg.\r
29\r
30 @param[in] BootOptionList A boot option list, created with\r
31 BdsLibEnumerateAllBootOption ().\r
32\r
33\r
34 @retval RETURN_SUCCESS BootOrder NvVar rewritten.\r
35\r
36 @retval RETURN_UNSUPPORTED QEMU's fw_cfg is not supported.\r
37\r
38 @retval RETURN_NOT_FOUND Empty or nonexistent "bootorder" fw_cfg\r
39 file, or no match found between the\r
40 "bootorder" fw_cfg file and BootOptionList.\r
41\r
42 @retval RETURN_INVALID_PARAMETER Parse error in the "bootorder" fw_cfg file.\r
43\r
44 @retval RETURN_OUT_OF_RESOURCES Memory allocation failed.\r
45\r
46 @return Values returned by gBS->LocateProtocol ()\r
47 or gRT->SetVariable ().\r
48\r
49**/\r
50RETURN_STATUS\r
51SetBootOrderFromQemu (\r
52 IN CONST LIST_ENTRY *BootOptionList\r
53 );\r