diff mbox series

[v2,1/9] hw/nvram: Restrict stub to sysemu and tools

Message ID 20220104085431.2122999-2-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series hw/dma: Use dma_addr_t type definition when relevant | expand

Commit Message

Philippe Mathieu-Daudé Jan. 4, 2022, 8:54 a.m. UTC
From: Philippe Mathieu-Daudé <philmd@redhat.com>

User-mode emulation doesn't need the fw_cfg stub.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/nvram/meson.build | 6 ++++--
 stubs/meson.build    | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

Comments

Richard Henderson Jan. 7, 2022, 12:17 a.m. UTC | #1
On 1/4/22 12:54 AM, Philippe Mathieu-Daudé wrote:
> +if have_system or have_tools
...
>   if have_system
> +  stub_ss.add(files('fw_cfg.c'))

Disconnect in tests?


r~
Philippe Mathieu-Daudé Jan. 11, 2022, 10:43 a.m. UTC | #2
On 1/7/22 01:17, Richard Henderson wrote:
> On 1/4/22 12:54 AM, Philippe Mathieu-Daudé wrote:
>> +if have_system or have_tools
> ...
>>   if have_system
>> +  stub_ss.add(files('fw_cfg.c'))
> 
> Disconnect in tests?

(I assume s/tests/stubs/).

fw_cfg-interface.c exposes the fw_cfg QOM interface, which is not
used by tools, but since interfaces are checked when QOM object is
created, we must include it to be able to use qemu-storage-daemon.

fw_cfg.c add a fw_cfg_arch_key_name() stub which is only required
for sysemu.

So no, there is no disconnect. I will however split this patch in
2 and better describe each change.

Thanks,

Phil.
diff mbox series

Patch

diff --git a/hw/nvram/meson.build b/hw/nvram/meson.build
index 202a5466e63..f5ee9f6b88c 100644
--- a/hw/nvram/meson.build
+++ b/hw/nvram/meson.build
@@ -1,5 +1,7 @@ 
-# QOM interfaces must be available anytime QOM is used.
-qom_ss.add(files('fw_cfg-interface.c'))
+if have_system or have_tools
+  # QOM interfaces must be available anytime QOM is used.
+  qom_ss.add(files('fw_cfg-interface.c'))
+endif
 
 softmmu_ss.add(files('fw_cfg.c'))
 softmmu_ss.add(when: 'CONFIG_CHRP_NVRAM', if_true: files('chrp_nvram.c'))
diff --git a/stubs/meson.build b/stubs/meson.build
index 71469c1d50a..363f6fa785d 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -11,7 +11,6 @@ 
 stub_ss.add(files('dump.c'))
 stub_ss.add(files('error-printf.c'))
 stub_ss.add(files('fdset.c'))
-stub_ss.add(files('fw_cfg.c'))
 stub_ss.add(files('gdbstub.c'))
 stub_ss.add(files('get-vm-name.c'))
 if linux_io_uring.found()
@@ -51,6 +50,7 @@ 
   stub_ss.add(files('replay-tools.c'))
 endif
 if have_system
+  stub_ss.add(files('fw_cfg.c'))
   stub_ss.add(files('semihost.c'))
   stub_ss.add(files('usb-dev-stub.c'))
   stub_ss.add(files('xen-hw-stub.c'))