root / docs / bootindex.txt @ f53ec699
History | View | Annotate | Download (2 kB)
1 | 280a66a6 | Stefan Weil | = Bootindex property = |
---|---|---|---|
2 | 466b5864 | Gleb Natapov | |
3 | 466b5864 | Gleb Natapov | Block and net devices have bootindex property. This property is used to |
4 | 466b5864 | Gleb Natapov | determine the order in which firmware will consider devices for booting |
5 | 466b5864 | Gleb Natapov | the guest OS. If the bootindex property is not set for a device, it gets |
6 | 466b5864 | Gleb Natapov | lowest boot priority. There is no particular order in which devices with |
7 | 466b5864 | Gleb Natapov | unset bootindex property will be considered for booting, but they will |
8 | 466b5864 | Gleb Natapov | still be bootable. |
9 | 466b5864 | Gleb Natapov | |
10 | 466b5864 | Gleb Natapov | == Example == |
11 | 466b5864 | Gleb Natapov | |
12 | e03ba136 | Peter Maydell | Let's assume we have a QEMU machine with two NICs (virtio, e1000) and two |
13 | 466b5864 | Gleb Natapov | disks (IDE, virtio): |
14 | 466b5864 | Gleb Natapov | |
15 | 466b5864 | Gleb Natapov | qemu -drive file=disk1.img,if=none,id=disk1 |
16 | 466b5864 | Gleb Natapov | -device ide-drive,drive=disk1,bootindex=4 |
17 | 466b5864 | Gleb Natapov | -drive file=disk2.img,if=none,id=disk2 |
18 | 466b5864 | Gleb Natapov | -device virtio-blk-pci,drive=disk2,bootindex=3 |
19 | 466b5864 | Gleb Natapov | -netdev type=user,id=net0 -device virtio-net-pci,netdev=net0,bootindex=2 |
20 | 466b5864 | Gleb Natapov | -netdev type=user,id=net1 -device e1000,netdev=net1,bootindex=1 |
21 | 466b5864 | Gleb Natapov | |
22 | 466b5864 | Gleb Natapov | Given the command above, firmware should try to boot from the e1000 NIC |
23 | e03ba136 | Peter Maydell | first. If this fails, it should try the virtio NIC next; if this fails |
24 | 466b5864 | Gleb Natapov | too, it should try the virtio disk, and then the IDE disk. |
25 | 466b5864 | Gleb Natapov | |
26 | 466b5864 | Gleb Natapov | == Limitations == |
27 | 466b5864 | Gleb Natapov | |
28 | 466b5864 | Gleb Natapov | 1. Some firmware has limitations on which devices can be considered for |
29 | 466b5864 | Gleb Natapov | booting. For instance, the PC BIOS boot specification allows only one |
30 | 466b5864 | Gleb Natapov | disk to be bootable. If boot from disk fails for some reason, the BIOS |
31 | e03ba136 | Peter Maydell | won't retry booting from other disk. It can still try to boot from |
32 | 466b5864 | Gleb Natapov | floppy or net, though. |
33 | 466b5864 | Gleb Natapov | |
34 | 466b5864 | Gleb Natapov | 2. Sometimes, firmware cannot map the device path QEMU wants firmware to |
35 | 466b5864 | Gleb Natapov | boot from to a boot method. It doesn't happen for devices the firmware |
36 | 466b5864 | Gleb Natapov | can natively boot from, but if firmware relies on an option ROM for |
37 | 466b5864 | Gleb Natapov | booting, and the same option ROM is used for booting from more then one |
38 | 466b5864 | Gleb Natapov | device, the firmware may not be able to ask the option ROM to boot from |
39 | e03ba136 | Peter Maydell | a particular device reliably. For instance with the PC BIOS, if a SCSI HBA |
40 | 466b5864 | Gleb Natapov | has three bootable devices target1, target3, target5 connected to it, |
41 | 466b5864 | Gleb Natapov | the option ROM will have a boot method for each of them, but it is not |
42 | 466b5864 | Gleb Natapov | possible to map from boot method back to a specific target. This is a |
43 | e03ba136 | Peter Maydell | shortcoming of the PC BIOS boot specification. |