From d2fffa509efe891eef3f2f70e5688c1d6e3a2d87 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Thu, 11 Sep 2014 11:18:32 +0200 Subject: [PATCH] virt-install: add support for OVMF Signed-off-by: Laszlo Ersek --- man/virt-install.pod | 28 ++++++++++++++++++++++++++++ virtinst/cli.py | 4 ++++ virtinst/osxml.py | 10 +++++++--- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/man/virt-install.pod b/man/virt-install.pod index 54c1c5e2..17bd1e7f 100644 --- a/man/virt-install.pod +++ b/man/virt-install.pod @@ -452,6 +452,34 @@ configurations like ARM or PPC Use BIOSPATH as the virtual machine BIOS. Only valid for fully virtualized guests. +=item B<--boot loader=/usr/share/OVMF/OVMF_CODE.fd,loader_ro=yes,loader_type=pflash> + +Specify that the virtual machine use the system-wide installed OVMF binary as +boot firmware, mapped as a virtual flash chip. This form requests that libvirt +instantiate the VM-specific UEFI varstore from the varstore template that is +assigned to "/usr/share/OVMF/OVMF_CODE.fd" in libvirtd's "qemu.conf", in the +"nvram" stanza. + +Only valid for fully virtualized guests. + +=item B<--boot loader=/.../OVMF_CODE.fd,loader_ro=yes,loader_type=pflash,nvram_template=/.../OVMF_VARS.fd> + +Specify that the virtual machine use the custom OVMF binary as boot firmware, +mapped as a virtual flash chip. In addition, request that libvirt instantiate +the VM-specific UEFI varstore from the custom "/.../OVMF_VARS.fd" varstore +template. + +Only valid for fully virtualized guests. + +=item B<--boot loader=/.../OVMF_CODE.fd,loader_ro=yes,loader_type=pflash,nvram=/.../guest_VARS.fd> + +Specify that the virtual machine use the custom OVMF binary as boot firmware, +mapped as a virtual flash chip. In addition, the VM-specific UEFI varstore is +directly the preexistent file "/.../guest_VARS.fd"; it is not instantiated from +any template. + +Only valid for fully virtualized guests. + =item B<--boot menu=on,useserial=on> Enable the bios boot menu, and enable sending bios text output over diff --git a/virtinst/cli.py b/virtinst/cli.py index 897ce23c..4f5a607f 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -1437,6 +1437,10 @@ class ParserBoot(VirtCLIParser): self.set_param("os.initrd", "initrd") self.set_param("os.dtb", "dtb") self.set_param("os.loader", "loader") + self.set_param("os.loader_ro", "loader_ro", is_onoff=True) + self.set_param("os.loader_type", "loader_type") + self.set_param("os.nvram", "nvram") + self.set_param("os.nvram_template", "nvram_template") self.set_param("os.kernel_args", "kernel_args", aliases=["extra_args"]) self.set_param("os.init", "init") self.set_param("os.arch", "arch") diff --git a/virtinst/osxml.py b/virtinst/osxml.py index 113afa6a..4cd78885 100644 --- a/virtinst/osxml.py +++ b/virtinst/osxml.py @@ -60,9 +60,9 @@ class OSXML(XMLBuilder): return self.is_ppc64 and self.machine == "pseries" _XML_ROOT_NAME = "os" - _XML_PROP_ORDER = ["arch", "os_type", "loader", - "kernel", "initrd", "kernel_args", "dtb", - "_bootdevs"] + _XML_PROP_ORDER = ["arch", "os_type", "loader", "loader_ro", "loader_type", + "nvram", "nvram_template", "kernel", "initrd", + "kernel_args", "dtb", "_bootdevs"] def _get_bootorder(self): return [dev.dev for dev in self._bootdevs] @@ -99,6 +99,10 @@ class OSXML(XMLBuilder): init = XMLProperty("./init") loader = XMLProperty("./loader") + loader_ro = XMLProperty("./loader/@readonly", is_yesno=True) + loader_type = XMLProperty("./loader/@type") + nvram = XMLProperty("./nvram") + nvram_template = XMLProperty("./nvram/@template") arch = XMLProperty("./type/@arch", default_cb=lambda s: s.conn.caps.host.cpu.arch) machine = XMLProperty("./type/@machine")