qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build
@ 2024-03-25 13:09 Michael Tokarev
  2024-03-25 13:40 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Michael Tokarev @ 2024-03-25 13:09 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Igor Mammedov, Michael S . Tsirkin, Ani Sinha,
	Michael Tokarev

When building qemu with smbios but not legacy mode (eg minimal microvm build),
link fails with:

  hw/i386/fw_cfg.c:74: undefined reference to `smbios_get_table_legacy'

This is because fw_cfg interface can call this function if CONFIG_SMBIOS
is defined.  Made this code block to depend on CONFIG_SMBIOS_LEGACY.

Fixes: b42b0e4daaa5 "smbios: build legacy mode code only for 'pc' machine"
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 hw/i386/fw_cfg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
index d802d2787f..d5e78a9183 100644
--- a/hw/i386/fw_cfg.c
+++ b/hw/i386/fw_cfg.c
@@ -70,6 +70,7 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg,
     /* tell smbios about cpuid version and features */
     smbios_set_cpuid(cpu->env.cpuid_version, cpu->env.features[FEAT_1_EDX]);
 
+#ifdef CONFIG_SMBIOS_LEGACY
     if (pcmc->smbios_legacy_mode) {
         smbios_tables = smbios_get_table_legacy(&smbios_tables_len,
                                                 &error_fatal);
@@ -77,6 +78,7 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg,
                          smbios_tables, smbios_tables_len);
         return;
     }
+#endif
 
     /* build the array of physical mem area from e820 table */
     mem_array = g_malloc0(sizeof(*mem_array) * e820_get_num_entries());
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-26 12:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-25 13:09 [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build Michael Tokarev
2024-03-25 13:40 ` Philippe Mathieu-Daudé
2024-03-25 15:03   ` Michael Tokarev
2024-03-25 16:00   ` Igor Mammedov
2024-03-25 15:20 ` Igor Mammedov
2024-03-25 18:01   ` Michael Tokarev
2024-03-26 12:32     ` Igor Mammedov
2024-03-25 15:29 ` Igor Mammedov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).