* [PATCH] hw/virtio: Also include md stubs in case CONFIG_VIRTIO_PCI is not set
@ 2025-03-13 6:35 Thomas Huth
2025-03-17 15:34 ` Thomas Huth
2025-03-17 16:29 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Huth @ 2025-03-13 6:35 UTC (permalink / raw)
To: qemu-devel, David Hildenbrand; +Cc: Michael S . Tsirkin
For the s390x target, it's possible to build the QEMU binary without
CONFIG_VIRTIO_PCI and only have the virtio-mem device via the ccw
transport. In that case, QEMU currently fails to link correctly:
/usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_pre_plug':
../hw/s390x/s390-virtio-ccw.c:579:(.text+0x1e96): undefined reference to `virtio_md_pci_pre_plug'
/usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_plug':
../hw/s390x/s390-virtio-ccw.c:608:(.text+0x21a4): undefined reference to `virtio_md_pci_plug'
/usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_unplug_request':
../hw/s390x/s390-virtio-ccw.c:622:(.text+0x2334): undefined reference to `virtio_md_pci_unplug_request'
/usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_unplug':
../hw/s390x/s390-virtio-ccw.c:633:(.text+0x2436): undefined reference to `virtio_md_pci_unplug'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
We also need to include the stubs when CONFIG_VIRTIO_PCI is missing.
Fixes: aa910c20ec5 ("s390x: virtio-mem support")
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/virtio/meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
index a5f9f7999dd..cdb1836580d 100644
--- a/hw/virtio/meson.build
+++ b/hw/virtio/meson.build
@@ -89,7 +89,8 @@ specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss)
system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c'))
-system_ss.add(when: 'CONFIG_VIRTIO_MD', if_false: files('virtio-md-stubs.c'))
+system_ss.add(when: ['CONFIG_VIRTIO_MD', 'CONFIG_VIRTIO_PCI'],
+ if_false: files('virtio-md-stubs.c'))
system_ss.add(files('virtio-hmp-cmds.c'))
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/virtio: Also include md stubs in case CONFIG_VIRTIO_PCI is not set
2025-03-13 6:35 [PATCH] hw/virtio: Also include md stubs in case CONFIG_VIRTIO_PCI is not set Thomas Huth
@ 2025-03-17 15:34 ` Thomas Huth
2025-03-17 16:29 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2025-03-17 15:34 UTC (permalink / raw)
To: qemu-devel, David Hildenbrand; +Cc: Michael S . Tsirkin
On 13/03/2025 07.35, Thomas Huth wrote:
> For the s390x target, it's possible to build the QEMU binary without
> CONFIG_VIRTIO_PCI and only have the virtio-mem device via the ccw
> transport. In that case, QEMU currently fails to link correctly:
>
> /usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_pre_plug':
> ../hw/s390x/s390-virtio-ccw.c:579:(.text+0x1e96): undefined reference to `virtio_md_pci_pre_plug'
> /usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_plug':
> ../hw/s390x/s390-virtio-ccw.c:608:(.text+0x21a4): undefined reference to `virtio_md_pci_plug'
> /usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_unplug_request':
> ../hw/s390x/s390-virtio-ccw.c:622:(.text+0x2334): undefined reference to `virtio_md_pci_unplug_request'
> /usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_unplug':
> ../hw/s390x/s390-virtio-ccw.c:633:(.text+0x2436): undefined reference to `virtio_md_pci_unplug'
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>
> We also need to include the stubs when CONFIG_VIRTIO_PCI is missing.
>
> Fixes: aa910c20ec5 ("s390x: virtio-mem support")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/virtio/meson.build | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
> index a5f9f7999dd..cdb1836580d 100644
> --- a/hw/virtio/meson.build
> +++ b/hw/virtio/meson.build
> @@ -89,7 +89,8 @@ specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
> system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss)
> system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
> system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c'))
> -system_ss.add(when: 'CONFIG_VIRTIO_MD', if_false: files('virtio-md-stubs.c'))
> +system_ss.add(when: ['CONFIG_VIRTIO_MD', 'CONFIG_VIRTIO_PCI'],
> + if_false: files('virtio-md-stubs.c'))
If there are no objections, I'll take this for my next pull request to fix
the building on s390x without virtio-pci devices.
Thomas
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/virtio: Also include md stubs in case CONFIG_VIRTIO_PCI is not set
2025-03-13 6:35 [PATCH] hw/virtio: Also include md stubs in case CONFIG_VIRTIO_PCI is not set Thomas Huth
2025-03-17 15:34 ` Thomas Huth
@ 2025-03-17 16:29 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-03-17 16:29 UTC (permalink / raw)
To: Thomas Huth, qemu-devel, David Hildenbrand; +Cc: Michael S . Tsirkin
On 13/3/25 07:35, Thomas Huth wrote:
> For the s390x target, it's possible to build the QEMU binary without
> CONFIG_VIRTIO_PCI and only have the virtio-mem device via the ccw
> transport. In that case, QEMU currently fails to link correctly:
>
> /usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_pre_plug':
> ../hw/s390x/s390-virtio-ccw.c:579:(.text+0x1e96): undefined reference to `virtio_md_pci_pre_plug'
> /usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_plug':
> ../hw/s390x/s390-virtio-ccw.c:608:(.text+0x21a4): undefined reference to `virtio_md_pci_plug'
> /usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_unplug_request':
> ../hw/s390x/s390-virtio-ccw.c:622:(.text+0x2334): undefined reference to `virtio_md_pci_unplug_request'
> /usr/bin/ld: libqemu-s390x-softmmu.a.p/hw_s390x_s390-virtio-ccw.c.o: in function `s390_machine_device_unplug':
> ../hw/s390x/s390-virtio-ccw.c:633:(.text+0x2436): undefined reference to `virtio_md_pci_unplug'
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>
> We also need to include the stubs when CONFIG_VIRTIO_PCI is missing.
>
> Fixes: aa910c20ec5 ("s390x: virtio-mem support")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> hw/virtio/meson.build | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
> index a5f9f7999dd..cdb1836580d 100644
> --- a/hw/virtio/meson.build
> +++ b/hw/virtio/meson.build
> @@ -89,7 +89,8 @@ specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss)
> system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss)
> system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c'))
> system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c'))
> -system_ss.add(when: 'CONFIG_VIRTIO_MD', if_false: files('virtio-md-stubs.c'))
> +system_ss.add(when: ['CONFIG_VIRTIO_MD', 'CONFIG_VIRTIO_PCI'],
> + if_false: files('virtio-md-stubs.c'))
if_false could be tricky.
https://mesonbuild.com/SourceSet-module.html
source_set.add([when: varnames_and_deps],
[if_true: sources_and_deps],
[if_false: list_of_alt_sources])
If all the strings evaluate to true and all dependencies are
found, the rule will evaluate to true; ...
Otherwise, that is if any of the strings in the positional
arguments evaluate to false or any dependency is not found,
use the contents of the if_false keyword argument.
I wanted to confirm true:ALL, false:ANY. Change LGTM then:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-17 16:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-13 6:35 [PATCH] hw/virtio: Also include md stubs in case CONFIG_VIRTIO_PCI is not set Thomas Huth
2025-03-17 15:34 ` Thomas Huth
2025-03-17 16:29 ` Philippe Mathieu-Daudé
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).