qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 18/21] docs: Move bootindex.txt into system section and rstify
Date: Mon,  2 Aug 2021 12:58:09 +0100	[thread overview]
Message-ID: <20210802115812.10731-19-peter.maydell@linaro.org> (raw)
In-Reply-To: <20210802115812.10731-1-peter.maydell@linaro.org>

Move bootindex.txt into the system section of the manual and turn it
into rST format.  To make the document make more sense in the context
of the system manual, expand the title and introductory paragraphs to
give more context.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 20210727194955.7764-1-peter.maydell@linaro.org
---
 docs/bootindex.txt        | 52 ---------------------------
 docs/system/bootindex.rst | 76 +++++++++++++++++++++++++++++++++++++++
 docs/system/index.rst     |  1 +
 3 files changed, 77 insertions(+), 52 deletions(-)
 delete mode 100644 docs/bootindex.txt
 create mode 100644 docs/system/bootindex.rst

diff --git a/docs/bootindex.txt b/docs/bootindex.txt
deleted file mode 100644
index 6937862ba0d..00000000000
--- a/docs/bootindex.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-= Bootindex property =
-
-Block and net devices have bootindex property. This property is used to
-determine the order in which firmware will consider devices for booting
-the guest OS. If the bootindex property is not set for a device, it gets
-lowest boot priority. There is no particular order in which devices with
-unset bootindex property will be considered for booting, but they will
-still be bootable.
-
-== Example ==
-
-Let's assume we have a QEMU machine with two NICs (virtio, e1000) and two
-disks (IDE, virtio):
-
-qemu -drive file=disk1.img,if=none,id=disk1
-     -device ide-hd,drive=disk1,bootindex=4
-     -drive file=disk2.img,if=none,id=disk2
-     -device virtio-blk-pci,drive=disk2,bootindex=3
-     -netdev type=user,id=net0 -device virtio-net-pci,netdev=net0,bootindex=2
-     -netdev type=user,id=net1 -device e1000,netdev=net1,bootindex=1
-
-Given the command above, firmware should try to boot from the e1000 NIC
-first.  If this fails, it should try the virtio NIC next; if this fails
-too, it should try the virtio disk, and then the IDE disk.
-
-== Limitations ==
-
-1. Some firmware has limitations on which devices can be considered for
-booting.  For instance, the PC BIOS boot specification allows only one
-disk to be bootable.  If boot from disk fails for some reason, the BIOS
-won't retry booting from other disk.  It can still try to boot from
-floppy or net, though.
-
-2. Sometimes, firmware cannot map the device path QEMU wants firmware to
-boot from to a boot method.  It doesn't happen for devices the firmware
-can natively boot from, but if firmware relies on an option ROM for
-booting, and the same option ROM is used for booting from more then one
-device, the firmware may not be able to ask the option ROM to boot from
-a particular device reliably.  For instance with the PC BIOS, if a SCSI HBA
-has three bootable devices target1, target3, target5 connected to it,
-the option ROM will have a boot method for each of them, but it is not
-possible to map from boot method back to a specific target.  This is a
-shortcoming of the PC BIOS boot specification.
-
-== Mixing bootindex and boot order parameters ==
-
-Note that it does not make sense to use the bootindex property together
-with the "-boot order=..." (or "-boot once=...") parameter. The guest
-firmware implementations normally either support the one or the other,
-but not both parameters at the same time. Mixing them will result in
-undefined behavior, and thus the guest firmware will likely not boot
-from the expected devices.
diff --git a/docs/system/bootindex.rst b/docs/system/bootindex.rst
new file mode 100644
index 00000000000..8b057f812f2
--- /dev/null
+++ b/docs/system/bootindex.rst
@@ -0,0 +1,76 @@
+Managing device boot order with bootindex properties
+====================================================
+
+QEMU can tell QEMU-aware guest firmware (like the x86 PC BIOS)
+which order it should look for a bootable OS on which devices.
+A simple way to set this order is to use the ``-boot order=`` option,
+but you can also do this more flexibly, by setting a ``bootindex``
+property on the individual block or net devices you specify
+on the QEMU command line.
+
+The ``bootindex`` properties are used to determine the order in which
+firmware will consider devices for booting the guest OS. If the
+``bootindex`` property is not set for a device, it gets the lowest
+boot priority. There is no particular order in which devices with no
+``bootindex`` property set will be considered for booting, but they
+will still be bootable.
+
+Some guest machine types (for instance the s390x machines) do
+not support ``-boot order=``; on those machines you must always
+use ``bootindex`` properties.
+
+There is no way to set a ``bootindex`` property if you are using
+a short-form option like ``-hda`` or ``-cdrom``, so to use
+``bootindex`` properties you will need to expand out those options
+into long-form ``-drive`` and ``-device`` option pairs.
+
+Example
+-------
+
+Let's assume we have a QEMU machine with two NICs (virtio, e1000) and two
+disks (IDE, virtio):
+
+.. parsed-literal::
+
+  |qemu_system| -drive file=disk1.img,if=none,id=disk1 \\
+                -device ide-hd,drive=disk1,bootindex=4 \\
+                -drive file=disk2.img,if=none,id=disk2 \\
+                -device virtio-blk-pci,drive=disk2,bootindex=3 \\
+                -netdev type=user,id=net0 \\
+                -device virtio-net-pci,netdev=net0,bootindex=2 \\
+                -netdev type=user,id=net1 \\
+                -device e1000,netdev=net1,bootindex=1
+
+Given the command above, firmware should try to boot from the e1000 NIC
+first.  If this fails, it should try the virtio NIC next; if this fails
+too, it should try the virtio disk, and then the IDE disk.
+
+Limitations
+-----------
+
+Some firmware has limitations on which devices can be considered for
+booting.  For instance, the PC BIOS boot specification allows only one
+disk to be bootable.  If boot from disk fails for some reason, the BIOS
+won't retry booting from other disk.  It can still try to boot from
+floppy or net, though.
+
+Sometimes, firmware cannot map the device path QEMU wants firmware to
+boot from to a boot method.  It doesn't happen for devices the firmware
+can natively boot from, but if firmware relies on an option ROM for
+booting, and the same option ROM is used for booting from more then one
+device, the firmware may not be able to ask the option ROM to boot from
+a particular device reliably.  For instance with the PC BIOS, if a SCSI HBA
+has three bootable devices target1, target3, target5 connected to it,
+the option ROM will have a boot method for each of them, but it is not
+possible to map from boot method back to a specific target.  This is a
+shortcoming of the PC BIOS boot specification.
+
+Mixing bootindex and boot order parameters
+------------------------------------------
+
+Note that it does not make sense to use the bootindex property together
+with the ``-boot order=...`` (or ``-boot once=...``) parameter. The guest
+firmware implementations normally either support the one or the other,
+but not both parameters at the same time. Mixing them will result in
+undefined behavior, and thus the guest firmware will likely not boot
+from the expected devices.
diff --git a/docs/system/index.rst b/docs/system/index.rst
index 64a424ae99b..650409d1566 100644
--- a/docs/system/index.rst
+++ b/docs/system/index.rst
@@ -26,6 +26,7 @@ or Hypervisor.Framework.
    authz
    gdb
    managed-startup
+   bootindex
    cpu-hotplug
    pr-manager
    targets
-- 
2.20.1



  parent reply	other threads:[~2021-08-02 12:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 11:57 [PULL 00/21] target-arm queue Peter Maydell
2021-08-02 11:57 ` [PULL 01/21] docs: Add documentation of Arm 'mainstone' board Peter Maydell
2021-08-02 11:57 ` [PULL 02/21] docs: Add documentation of Arm 'kzm' board Peter Maydell
2021-08-02 11:57 ` [PULL 03/21] docs: Add documentation of Arm 'imx25-pdk' board Peter Maydell
2021-08-02 11:57 ` [PULL 04/21] MAINTAINERS: Don't list Andrzej Zaborowski for various components Peter Maydell
2021-08-02 11:57 ` [PULL 05/21] docs: Remove stale TODO comments about license and version Peter Maydell
2021-08-02 11:57 ` [PULL 06/21] docs: Move licence/copyright from HTML output to rST comments Peter Maydell
2021-08-02 11:57 ` [PULL 07/21] docs/devel/build-system.rst: Format literals correctly Peter Maydell
2021-08-02 11:57 ` [PULL 08/21] docs/devel/build-system.rst: Correct typo in example code Peter Maydell
2021-08-02 11:58 ` [PULL 09/21] docs/devel/ebpf_rss.rst: Format literals correctly Peter Maydell
2021-08-02 11:58 ` [PULL 10/21] docs/devel/migration.rst: " Peter Maydell
2021-08-02 11:58 ` [PULL 11/21] docs/devel: " Peter Maydell
2021-08-02 11:58 ` [PULL 12/21] docs/system/s390x/protvirt.rst: " Peter Maydell
2021-08-02 11:58 ` [PULL 13/21] docs/system/arm/cpu-features.rst: " Peter Maydell
2021-08-02 11:58 ` [PULL 14/21] docs: " Peter Maydell
2021-08-02 11:58 ` [PULL 15/21] docs/about/removed-features: Fix markup error Peter Maydell
2021-08-02 11:58 ` [PULL 16/21] docs/tools/virtiofsd.rst: Delete stray backtick Peter Maydell
2021-08-02 11:58 ` [PULL 17/21] hw/arm/boot: Report error if there is no fw_cfg device in the machine Peter Maydell
2021-08-02 11:58 ` Peter Maydell [this message]
2021-08-02 11:58 ` [PULL 19/21] docs: Move the protocol part of barrier.txt into interop Peter Maydell
2021-08-02 11:58 ` [PULL 20/21] ui/input-barrier: Move TODOs from barrier.txt to a comment Peter Maydell
2021-08-02 11:58 ` [PULL 21/21] docs: Move user-facing barrier docs into system manual Peter Maydell
2021-08-02 13:51 ` [PULL 00/21] target-arm queue Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210802115812.10731-19-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).