mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemu: Warn verbosely if using old loader:nvram pairs
There are two ways for specifying loader:nvram pairs: 1) --with-loader-nvram configure option 2) nvram variable in qemu.conf Since we have FW descriptors, using this old style is discouraged, but not as strong as one would expect. Produce more warnings: 1) produce a warning if somebody tries the configure option 2) produce a warning if somebody sets nvram variable and at least on FW descriptor was found The reason for producing warning in case 1) is that package maintainers, who set the configure option in the first place should start moving towards FW descriptors and abandon the configure option. After all, the warning is printed into config output only in this case. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1763477 Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
e39d3424e3
commit
75597f022a
@ -30,6 +30,8 @@ AC_DEFUN([LIBVIRT_CHECK_LOADER_NVRAM], [
|
||||
l=$(echo $with_loader_nvram | tr ':' '\n' | wc -l)
|
||||
if test $(expr $l % 2) -ne 0 ; then
|
||||
AC_MSG_ERROR([Malformed --with-loader-nvram argument])
|
||||
elif test $l -gt 0 ; then
|
||||
AC_MSG_WARN([Note that --with-loader-nvram is obsolete and will be removed soon])
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([DEFAULT_LOADER_NVRAM], ["$with_loader_nvram"],
|
||||
[List of loader:nvram pairs])
|
||||
@ -37,5 +39,11 @@ AC_DEFUN([LIBVIRT_CHECK_LOADER_NVRAM], [
|
||||
])
|
||||
|
||||
AC_DEFUN([LIBVIRT_RESULT_LOADER_NVRAM], [
|
||||
if test "x$with_loader_nvram" != "xno" && \
|
||||
test "x$with_loader_nvram" != "x" ; then
|
||||
LIBVIRT_RESULT([Loader/NVRAM], [$with_loader_nvram],
|
||||
[!!! Using this configure option is strongly discouraged !!!])
|
||||
else
|
||||
LIBVIRT_RESULT([Loader/NVRAM], [$with_loader_nvram])
|
||||
fi
|
||||
])
|
||||
|
@ -761,6 +761,9 @@
|
||||
# source tree. These metadata files are distributed alongside any
|
||||
# firmware images intended for use with QEMU.
|
||||
#
|
||||
# NOTE: if ANY firmware metadata files are detected, this setting
|
||||
# will be COMPLETELY IGNORED.
|
||||
#
|
||||
# ------------------------------------------
|
||||
#
|
||||
# When a domain is configured to use UEFI instead of standard
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "qemu_conf.h"
|
||||
#include "qemu_capabilities.h"
|
||||
#include "qemu_domain.h"
|
||||
#include "qemu_firmware.h"
|
||||
#include "qemu_security.h"
|
||||
#include "viruuid.h"
|
||||
#include "virbuffer.h"
|
||||
@ -799,7 +800,8 @@ virQEMUDriverConfigLoadLogEntry(virQEMUDriverConfigPtr cfg,
|
||||
|
||||
static int
|
||||
virQEMUDriverConfigLoadNVRAMEntry(virQEMUDriverConfigPtr cfg,
|
||||
virConfPtr conf)
|
||||
virConfPtr conf,
|
||||
bool privileged)
|
||||
{
|
||||
VIR_AUTOSTRINGLIST nvram = NULL;
|
||||
size_t i;
|
||||
@ -807,8 +809,21 @@ virQEMUDriverConfigLoadNVRAMEntry(virQEMUDriverConfigPtr cfg,
|
||||
if (virConfGetValueStringList(conf, "nvram", false, &nvram) < 0)
|
||||
return -1;
|
||||
if (nvram) {
|
||||
VIR_AUTOSTRINGLIST fwList = NULL;
|
||||
|
||||
virFirmwareFreeList(cfg->firmwares, cfg->nfirmwares);
|
||||
|
||||
if (qemuFirmwareFetchConfigs(&fwList, privileged) < 0)
|
||||
return -1;
|
||||
|
||||
if (fwList) {
|
||||
VIR_WARN("Obsolete nvram variable is set while firmware metadata "
|
||||
"files found. Note that the nvram config file variable is "
|
||||
"going to be ignored.");
|
||||
cfg->nfirmwares = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
cfg->nfirmwares = virStringListLength((const char *const *)nvram);
|
||||
if (nvram[0] && VIR_ALLOC_N(cfg->firmwares, cfg->nfirmwares) < 0)
|
||||
return -1;
|
||||
@ -1041,7 +1056,7 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
|
||||
if (virQEMUDriverConfigLoadLogEntry(cfg, conf) < 0)
|
||||
return -1;
|
||||
|
||||
if (virQEMUDriverConfigLoadNVRAMEntry(cfg, conf) < 0)
|
||||
if (virQEMUDriverConfigLoadNVRAMEntry(cfg, conf, privileged) < 0)
|
||||
return -1;
|
||||
|
||||
if (virQEMUDriverConfigLoadGlusterDebugEntry(cfg, conf) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user