[virt-manager PATCH 2/2] virtinst: bhyve: properly configure loader
Roman Bogorodskiy
bogorodskiy at gmail.com
Thu Feb 11 16:05:46 UTC 2021
Cole Robinson wrote:
> On 2/6/21 8:18 AM, Roman Bogorodskiy wrote:
> > Bhyve requires explicit loader configuration. So query
> > domain capabilities, try to find the "official"
> > firmware and configure all the necessary loader options.
> >
> > Signed-off-by: Roman Bogorodskiy <bogorodskiy at gmail.com>
> > ---
> > virtinst/domain/os.py | 16 ++++++++++++++++
> > 1 file changed, 16 insertions(+)
> >
> > diff --git a/virtinst/domain/os.py b/virtinst/domain/os.py
> > index 59fbc43e..4a9fbc81 100644
> > --- a/virtinst/domain/os.py
> > +++ b/virtinst/domain/os.py
> > @@ -127,3 +127,19 @@ class DomainOs(XMLBuilder):
> > self.init = "/sbin/init"
> > else:
> > self.init = "/bin/sh"
> > + if self.conn.is_bhyve():
> > + dom_caps = guest.lookup_domcaps()
> > + firmware_files = [f.value for f in dom_caps.os.loader.values]
> > + if not firmware_files:
> > + return
> > + # Prefer the known BHYVE_UEFI.fd firmware
> > + # from the sysutils/bhyve-firmware port. If not found,
> > + # just pick the first one
> > + firmware_file = None
> > + for f in firmware_files:
> > + if 'BHYVE_UEFI.fd' in f:
> > + firmware_file = f
> > + break
> > + self.loader = firmware_file or firmware_files[0]
> > + self.loader_type = "pflash"
> > + self.loader_ro = True
> >
>
> Following on from my cover letter response. I don't think anything needs
> to be changed here in os.py. I think this should be two patches:
Oh, I've just re-read it before responding and noticed you suggested to
do that in two patches, and I've already sent v2. Change #2 appears to
be a one line change though, I'll look, maybe I've missed some tests
that need to be updated.
> 1) teaching guest.py:get_uefi_path() and
> domcaps.find_uefi_path_for_arch() about the preferred bhyve path. You
> can test this in test_cli.py first by `--boot uefi` generating correct XML.
>
> 2) extending guest.py:prefers_uefi() to handle bhyve too. That should
> change the virt-install/virt-manager default automatically.
>
> question: does bhyve libvirt driver support <os firmware='efi'/> ? It
> would be nice if virt-install didn't need to add more of this firmware
> filename scraping
IIUC, <os firmware='efi'/> instructs libvirt to find a proper firmware
automatically, similarly to what I'm trying to implement here in
virt-manager. I'll see if I can implement that for the bhyve driver.
> Thanks,
> Cole
>
Roman Bogorodskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20210211/a6c9859f/attachment.sig>
More information about the virt-tools-list
mailing list