Introduce per-device boot element

Currently, boot order can be specified per device class but there is no
way to specify exact disk/NIC device to boot from.

This patch adds <boot order='N'/> element which can be used inside
<disk/> and <interface/>. This is incompatible with the older os/boot
element. Since not all hypervisors support per-device boot
specification, new deviceboot flag is included in capabilities XML for
hypervisors which understand the new boot element. Presence of the flag
allows (but doesn't require) users to use the new style boot order
specification.
This commit is contained in:
Jiri Denemark
2011-01-12 15:19:34 +01:00
parent f5456ffd9d
commit 94234fa2f8
6 changed files with 160 additions and 14 deletions

View File

@@ -55,6 +55,7 @@ BIOS you will see</p>
&lt;/arch&gt;
&lt;features&gt;
&lt;cpuselection/&gt;
&lt;deviceboot/&gt;
&lt;/features&gt;
&lt;/guest&gt;</span>
...

View File

@@ -103,8 +103,11 @@
<dd>The <code>dev</code> attribute takes one of the values "fd", "hd",
"cdrom" or "network" and is used to specify the next boot device
to consider. The <code>boot</code> element can be repeated multiple
times to setup a priority list of boot devices to try in turn.
<span class="since">Since 0.1.3</span>
times to setup a priority list of boot devices to try in turn. The
<code>boot</code> element cannot be used if per-device boot elements
are used (see <a href="#elementsDisks">disks</a> and
<a href="#elementsNICS">network interfaces</a> sections below.
<span class="since">Since 0.1.3, per-device boot since 0.8.8</span>
</dd>
<dt><code>bootmenu</code></dt>
<dd> Whether or not to enable an interactive boot menu prompt on guest
@@ -625,6 +628,7 @@
&lt;driver name="tap" type="aio" cache="default"/&gt;
&lt;source file='/var/lib/xen/images/fv0'/&gt;
&lt;target dev='hda' bus='ide'/&gt;
&lt;boot order='2'/&gt;
&lt;encryption type='...'&gt;
...
&lt;/encryption&gt;
@@ -640,6 +644,7 @@
&lt;host name="hostname" port="7000"/&gt;
&lt;/source&gt;
&lt;target dev="hdb" bus="ide"/&gt;
&lt;boot order='1'/&gt;
&lt;/disk&gt;
&lt;/devices&gt;
...</pre>
@@ -692,6 +697,14 @@
controls the cache mechanism, possible values are "default", "none",
"writethrough" and "writeback". <span class="since">Since 0.1.8</span>
</dd>
<dt><code>boot</code></dt>
<dd>Specifies that the disk is bootable. The <code>order</code>
attribute determines the order in which devices will be tried during
boot sequence. The per-device <code>boot</code> elements cannot be
used together with general boot elements in
<a href="#elementsOSBIOS">BIOS bootloader</a> section.
<span class="since">Since 0.8.8</span>
</dd>
<dt><code>encryption</code></dt>
<dd>If present, specifies how the volume is encrypted. See
the <a href="formatstorageencryption.html">Storage Encryption</a> page
@@ -813,6 +826,7 @@
&lt;source bridge='xenbr0'/&gt;
&lt;mac address='00:16:3e:5d:c7:9e'/&gt;
&lt;script path='vif-bridge'/&gt;
&lt;boot order='1'/&gt;
&lt;/interface&gt;
&lt;/devices&gt;
...</pre>
@@ -1090,6 +1104,29 @@ qemu-kvm -net nic,model=? /dev/null
ignored.
</p>
<h5><a name="elementsNICSBoot">Specifying boot order</a></h5>
<pre>
...
&lt;devices&gt;
&lt;interface type='network'&gt;
&lt;source network='default'/&gt;
&lt;target dev='vnet1'/&gt;
<b>&lt;boot order='1'/&gt;</b>
&lt;/interface&gt;
&lt;/devices&gt;
...</pre>
<p>
For hypervisors which support this, you can set exact NIC which should
be used for network boot. The <code>order</code> attribute determines
the order in which devices will be tried during boot sequence. The
per-device <code>boot</code> elements cannot be used together with
general boot elements in
<a href="#elementsOSBIOS">BIOS bootloader</a> section.
<span class="since">Since 0.8.8</span>
</p>
<h4><a name="elementsInput">Input devices</a></h4>
<p>

View File

@@ -121,9 +121,9 @@
</optional>
<choice>
<ref name="osbootkernel"/>
<oneOrMore>
<zeroOrMore>
<ref name="osbootdev"/>
</oneOrMore>
</zeroOrMore>
</choice>
<optional>
<element name="bootmenu">
@@ -525,6 +525,9 @@
<ref name="driver"/>
</optional>
<ref name="target"/>
<optional>
<ref name="deviceBoot"/>
</optional>
<optional>
<element name="readonly">
<empty/>
@@ -963,6 +966,7 @@
- the IP address bound to the interface
- the name of the script used to set up the binding
- the target device used
- boot order
-->
<define name="interface-options">
<interleave>
@@ -1035,6 +1039,9 @@
</optional>
</element>
</optional>
<optional>
<ref name="deviceBoot"/>
</optional>
</interleave>
</define>
<define name="virtualPortProfile">
@@ -2008,6 +2015,15 @@
</optional>
</define>
<define name="deviceBoot">
<element name="boot">
<attribute name="order">
<ref name="positiveInteger"/>
</attribute>
<empty/>
</element>
</define>
<!--
Optional hypervisor extensions in their own namespace:
QEmu