From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
qemu-riscv@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Laszlo Ersek" <lersek@redhat.com>
Subject: [PATCH 7/7] hw/nvram: Do not build FW_CFG if not required
Date: Mon, 26 Apr 2021 21:35:20 +0200 [thread overview]
Message-ID: <20210426193520.4115528-8-philmd@redhat.com> (raw)
In-Reply-To: <20210426193520.4115528-1-philmd@redhat.com>
If the Kconfig 'FW_CFG' symbol is not selected, it is pointless
to build the fw_cfg device. Update the stubs.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
stubs/fw_cfg.c | 49 ++++++++++++++++++++++++++++++++++++++++++--
hw/nvram/meson.build | 2 +-
2 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/stubs/fw_cfg.c b/stubs/fw_cfg.c
index bb1e3c8aa95..ac1e539c93f 100644
--- a/stubs/fw_cfg.c
+++ b/stubs/fw_cfg.c
@@ -1,7 +1,7 @@
/*
* fw_cfg stubs
*
- * Copyright (c) 2019 Red Hat, Inc.
+ * Copyright (c) 2019,2021 Red Hat, Inc.
*
* Author:
* Philippe Mathieu-Daudé <philmd@redhat.com>
@@ -13,9 +13,54 @@
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "hw/nvram/fw_cfg.h"
-const char *fw_cfg_arch_key_name(uint16_t key)
+FWCfgState *fw_cfg_find(void)
{
return NULL;
}
+
+bool fw_cfg_add_from_generator(FWCfgState *s, const char *filename,
+ const char *gen_id, Error **errp)
+{
+ error_setg(errp, "fw-cfg device not built in");
+
+ return true;
+}
+
+void fw_cfg_add_file(FWCfgState *s, const char *filename,
+ void *data, size_t len)
+{
+ g_assert_not_reached();
+}
+
+void fw_cfg_add_file_callback(FWCfgState *s, const char *filename,
+ FWCfgCallback select_cb,
+ FWCfgWriteCallback write_cb,
+ void *callback_opaque,
+ void *data, size_t len, bool read_only)
+{
+ g_assert_not_reached();
+}
+
+void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
+ void *data, size_t len)
+{
+ g_assert_not_reached();
+}
+
+void fw_cfg_set_order_override(FWCfgState *s, int order)
+{
+ g_assert_not_reached();
+}
+
+void fw_cfg_reset_order_override(FWCfgState *s)
+{
+ g_assert_not_reached();
+}
+
+bool fw_cfg_dma_enabled(void *opaque)
+{
+ g_assert_not_reached();
+}
diff --git a/hw/nvram/meson.build b/hw/nvram/meson.build
index fd2951a860f..99e12224483 100644
--- a/hw/nvram/meson.build
+++ b/hw/nvram/meson.build
@@ -1,7 +1,7 @@
# QOM interfaces must be available anytime QOM is used.
qom_ss.add(files('fw_cfg-interface.c'))
-softmmu_ss.add(files('fw_cfg.c'))
+softmmu_ss.add(when: 'CONFIG_FW_CFG', if_true: files('fw_cfg.c'))
softmmu_ss.add(when: 'CONFIG_CHRP_NVRAM', if_true: files('chrp_nvram.c'))
softmmu_ss.add(when: 'CONFIG_DS1225Y', if_true: files('ds1225y.c'))
softmmu_ss.add(when: 'CONFIG_NMC93XX_EEPROM', if_true: files('eeprom93xx.c'))
--
2.26.3
next prev parent reply other threads:[~2021-04-26 19:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-26 19:35 [PATCH 0/7] hw/nvram/fw_cfg: Do not build device if not needed (Spring cleanup) Philippe Mathieu-Daudé
2021-04-26 19:35 ` [PATCH 1/7] stubs: Restrict fw_cfg stubs to sysemu Philippe Mathieu-Daudé
2021-04-28 16:23 ` Laszlo Ersek
2021-04-26 19:35 ` [PATCH 2/7] hw/nvram: Rename FW_CFG_MIPS as generic FW_CFG Kconfig symbol Philippe Mathieu-Daudé
2021-04-26 19:35 ` [PATCH 3/7] hw/nvram: Declare FW_CFG_DMA Kconfig symbol in hw/nvram/ Philippe Mathieu-Daudé
2021-04-26 19:35 ` [PATCH 4/7] hw/acpi/vmgenid: Make ACPI_VMGENID depends on FW_CFG Kconfig Philippe Mathieu-Daudé
2021-04-28 16:25 ` Laszlo Ersek
2021-04-26 19:35 ` [PATCH 5/7] hw: Have machines Kconfig-select FW_CFG Philippe Mathieu-Daudé
2021-04-26 22:03 ` BALATON Zoltan
2021-04-27 1:56 ` David Gibson
2021-04-27 1:54 ` David Gibson
2021-04-28 16:33 ` Laszlo Ersek
2021-04-28 18:50 ` Eduardo Habkost
2021-04-26 19:35 ` [PATCH 6/7] hw/{arm,hppa,riscv}: Add fw_cfg arch-specific stub Philippe Mathieu-Daudé
2021-04-28 16:44 ` Laszlo Ersek
2021-04-28 17:23 ` Philippe Mathieu-Daudé
2021-04-26 19:35 ` Philippe Mathieu-Daudé [this message]
2021-04-28 17:29 ` [PATCH 7/7] hw/nvram: Do not build FW_CFG if not required Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210426193520.4115528-8-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=kraxel@redhat.com \
--cc=lersek@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).