From cdbb21bc590fc687b1eb58ab9f3d0c9a9ec14e8f Mon Sep 17 00:00:00 2001
From: Conrad Meyer
Date: Wed, 12 Nov 2014 17:31:53 -0500
Subject: [PATCH] drvbhyve: Use boot-order for grub-bhyve boot device
Rather than just picking the first CD (or failing that, HDD) we come
across, if the user has picked a boot device ordering with , respect that (and just try to boot the lowest-index device).
Adds two sets of tests to bhyve2xmlargv; 'grub-bootorder' shows that we
pick a user-specified device over the first device in the domain;
'grub-bootorder2' shows that we pick the first (lowest index) device.
---
docs/drvbhyve.html.in | 9 +--
src/bhyve/bhyve_command.c | 64 ++++++++++++++-----
.../bhyvexml2argv-grub-bootorder.args | 6 ++
.../bhyvexml2argv-grub-bootorder.devmap | 1 +
.../bhyvexml2argv-grub-bootorder.ldargs | 2 +
.../bhyvexml2argv-grub-bootorder.xml | 36 +++++++++++
.../bhyvexml2argv-grub-bootorder2.args | 6 ++
.../bhyvexml2argv-grub-bootorder2.devmap | 1 +
.../bhyvexml2argv-grub-bootorder2.ldargs | 2 +
.../bhyvexml2argv-grub-bootorder2.xml | 38 +++++++++++
tests/bhyvexml2argvtest.c | 2 +
11 files changed, 146 insertions(+), 21 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.devmap
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.devmap
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-bootorder2.xml
diff --git a/docs/drvbhyve.html.in b/docs/drvbhyve.html.in
index bd4b35eb1e..5479511e4b 100644
--- a/docs/drvbhyve.html.in
+++ b/docs/drvbhyve.html.in
@@ -234,10 +234,11 @@ management.
It's possible to boot non-FreeBSD guests by specifying an explicit
bootloader, e.g. grub-bhyve(1). Arguments to the bootloader may be
specified as well. If the bootloader is grub-bhyve and arguments
-are omitted, libvirt will try and boot the first disk in the domain (either
-cdrom- or disk-type devices). If the disk type is
-disk, it will attempt to boot from the first partition in the disk
-image.
+are omitted, libvirt will try and infer boot ordering from user-supplied
+<boot order='N'> configuration in the domain. Failing that, it will boot
+the first disk in the domain (either cdrom- or
+disk-type devices). If the disk type is disk, it will
+attempt to boot from the first partition in the disk image.