From 94234fa2f84e496344a81b9f8a3d5089149efc6a Mon Sep 17 00:00:00 2001
From: Jiri Denemark
Date: Wed, 12 Jan 2011 15:19:34 +0100
Subject: [PATCH] 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 element which can be used inside
and . 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.
---
docs/formatcaps.html.in | 1 +
docs/formatdomain.html.in | 41 ++++++++++++++-
docs/schemas/domain.rng | 20 ++++++-
src/conf/capabilities.c | 3 +-
src/conf/domain_conf.c | 107 ++++++++++++++++++++++++++++++++++----
src/conf/domain_conf.h | 2 +
6 files changed, 160 insertions(+), 14 deletions(-)
diff --git a/docs/formatcaps.html.in b/docs/formatcaps.html.in
index dcbf35a9dc..a4297cefa1 100644
--- a/docs/formatcaps.html.in
+++ b/docs/formatcaps.html.in
@@ -55,6 +55,7 @@ BIOS you will see
</arch>
<features>
<cpuselection/>
+ <deviceboot/>
</features>
</guest>
...
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index dad268d0b3..3afea8deae 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -103,8 +103,11 @@
The dev
attribute takes one of the values "fd", "hd",
"cdrom" or "network" and is used to specify the next boot device
to consider. The boot
element can be repeated multiple
- times to setup a priority list of boot devices to try in turn.
- Since 0.1.3
+ times to setup a priority list of boot devices to try in turn. The
+ boot
element cannot be used if per-device boot elements
+ are used (see disks and
+ network interfaces sections below.
+ Since 0.1.3, per-device boot since 0.8.8
bootmenu
Whether or not to enable an interactive boot menu prompt on guest
@@ -625,6 +628,7 @@
<driver name="tap" type="aio" cache="default"/>
<source file='/var/lib/xen/images/fv0'/>
<target dev='hda' bus='ide'/>
+ <boot order='2'/>
<encryption type='...'>
...
</encryption>
@@ -640,6 +644,7 @@
<host name="hostname" port="7000"/>
</source>
<target dev="hdb" bus="ide"/>
+ <boot order='1'/>
</disk>
</devices>
...
@@ -692,6 +697,14 @@
controls the cache mechanism, possible values are "default", "none",
"writethrough" and "writeback". Since 0.1.8
+ boot
+ Specifies that the disk is bootable. The order
+ attribute determines the order in which devices will be tried during
+ boot sequence. The per-device boot
elements cannot be
+ used together with general boot elements in
+ BIOS bootloader section.
+ Since 0.8.8
+
encryption
If present, specifies how the volume is encrypted. See
the Storage Encryption page
@@ -813,6 +826,7 @@
<source bridge='xenbr0'/>
<mac address='00:16:3e:5d:c7:9e'/>
<script path='vif-bridge'/>
+ <boot order='1'/>
</interface>
</devices>
...
@@ -1090,6 +1104,29 @@ qemu-kvm -net nic,model=? /dev/null
ignored.
+
+
+
+ ...
+ <devices>
+ <interface type='network'>
+ <source network='default'/>
+ <target dev='vnet1'/>
+ <boot order='1'/>
+ </interface>
+ </devices>
+ ...
+
+
+ For hypervisors which support this, you can set exact NIC which should
+ be used for network boot. The order
attribute determines
+ the order in which devices will be tried during boot sequence. The
+ per-device boot
elements cannot be used together with
+ general boot elements in
+ BIOS bootloader section.
+ Since 0.8.8
+
+
diff --git a/docs/schemas/domain.rng b/docs/schemas/domain.rng
index a79ca6a015..9b977b5d8c 100644
--- a/docs/schemas/domain.rng
+++ b/docs/schemas/domain.rng
@@ -121,9 +121,9 @@
-
+
-
+
@@ -525,6 +525,9 @@
+
+
+
@@ -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
-->
@@ -1035,6 +1039,9 @@
+
+
+
@@ -2008,6 +2015,15 @@
+
+
+
+
+
+
+
+
+