[Libguestfs] [PATCH 0/4] Use libvirt firmware autoselection

Daniel P. Berrangé berrange at redhat.com
Thu Jan 16 12:53:50 UTC 2020


On Thu, Jan 16, 2020 at 01:49:09PM +0100, Michal Privoznik wrote:
> On 1/16/20 1:27 PM, Pino Toscano wrote:
> > Starting with 5.2.0, libvirt has a way to select the firmware by
> > specifying its type, provided configuration files for the firmware are
> > shipped. Currently we start the appliance as UEFI if any of the firmware
> > are found, so instead we can try to just set the firmware type iff:
> > - the libvirt autoselection works
> > - the 'efi' firmware is available
> > 
> > The only behaviour change is that the default firmware may be a
> > non-debug version, so we get no debug messages even when running in
> > verbose mode. This most probably will need an addition in libvirt to
> > select this feature among the available firmwares.
> 
> Firmware autoselection parses JSON files at well defined locations giving
> each file precedence over others based on the path it's found under and it's
> name.
> 
> The file name precedence is based on alphabetical ordering. That is why file
> names usually consists of two leading numbers, e.g. 40-bios.json,
> 50-ovmf-sb.json, 60-ovmf.json and so on. Now, the default, distro wide path
> where these files live is /usr/share/qemu/firmware/ and has the least
> precedence. If a sysadmin wants to alter config of some FW blob, instead of
> fighting with package manager and overwriting files under /usr/.. they can
> put changed versions under /etc/qemu/firmware which takes precedence over
> the former path. For instance, if 40-bios.json is found under both paths,
> only the one from /etc is considered and the other is not even parsed. If
> you would apply this logic one more time, you will get
> $HOME/.config/qemu/firmware which allows non-root users to override their
> sysadmin's config and have their private FW blobs with the highest priority.
> 
> So if libguestfs wants libvirt to select certain FW image it can install its
> own JSON descriptor somewhere into a suitable path and if the file has the
> correct content it will direct libvirt into using FW blob with debug
> messages enabled.

I not sure we should encourage applications / libraries to do this.
Installing a JSON descriptor into any of the directories mentioned above
will affect *all* applications on the host using libvirt, which is not
appropriate IMHO.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the Libguestfs mailing list