23.04.2024 18:08, Paolo Bonzini wrote:
Since the virtio memory device stubs are needed exactly when the
Kconfig symbol is not enabled, they can be placed in hw/virtio/ and
conditionalized on CONFIG_VIRTIO_MD.
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
Message-ID: <20240408155330.522792-12-pbonz...@redhat.com>
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
stubs/virtio-md-pci.c => hw/virtio/virtio-md-stubs.c | 0
hw/virtio/meson.build | 2 ++
stubs/meson.build | 1 -
3 files changed, 2 insertions(+), 1 deletion(-)
rename stubs/virtio-md-pci.c => hw/virtio/virtio-md-stubs.c (100%)
FWIW, this broke a minimal microvm build for debian:
/usr/bin/ld: libqemu-x86_64-softmmu.a.p/hw_i386_pc.c.o: in function
`pc_machine_device_pre_plug_cb':
./b/microvm/hw/i386/pc.c:1377: undefined reference to `virtio_md_pci_pre_plug'
/usr/bin/ld: libqemu-x86_64-softmmu.a.p/hw_i386_pc.c.o: in function
`pc_machine_device_unplug_request_cb':
./b/microvm/hw/i386/pc.c:1427: undefined reference to
`virtio_md_pci_unplug_request'
/usr/bin/ld: libqemu-x86_64-softmmu.a.p/hw_i386_pc.c.o: in function
`pc_machine_device_unplug_cb':
./b/microvm/hw/i386/pc.c:1443: undefined reference to `virtio_md_pci_unplug'
/usr/bin/ld: libqemu-x86_64-softmmu.a.p/hw_i386_pc.c.o: in function
`pc_machine_device_plug_cb':
./b/microvm/hw/i386/pc.c:1413: undefined reference to `virtio_md_pci_plug'
collect2: error: ld returned 1 exit status
../configure --disable-install-blobs \
--without-default-features \
--target-list=x86_64-softmmu --enable-kvm --disable-tcg \
--enable-pixman --enable-vnc \
--enable-virtfs \
--enable-linux-aio --enable-linux-io-uring \
--enable-numa \
--enable-attr \
--enable-coroutine-pool \
--audio-drv-list="" \
--without-default-devices \
--with-devices-x86_64=microvm \
--enable-vhost-kernel --enable-vhost-net \
--enable-vhost-vdpa \
--enable-vhost-user --enable-vhost-user-blk-server \
--enable-vhost-crypto \
--enable-seccomp \
with the following contents of microvm-devices.mak:
# see configs/devices/i386-softmmu/default.mak
# for additional devices which can be disabled
#
CONFIG_PCI_DEVICES=n
# we can't disable all machine types (boards) as of 6.1
# since the resulting binary fails to link
#CONFIG_ISAPC=y
#CONFIG_I440FX=y
CONFIG_Q35=y
CONFIG_MICROVM=y
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_SERIAL=y
CONFIG_VIRTIO_INPUT=y
CONFIG_VIRTIO_INPUT_HOST=y
CONFIG_VHOST_USER_INPUT=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_SCSI=y
CONFIG_VIRTIO_RNG=y
CONFIG_VIRTIO_CRYPTO=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_VIRTIO_MEM=y
CONFIG_VIRTIO_PMEM=y
CONFIG_VIRTIO_GPU=y
CONFIG_VHOST_USER_GPU=y
diff --git a/stubs/virtio-md-pci.c b/hw/virtio/virtio-md-stubs.c
similarity index 100%
rename from stubs/virtio-md-pci.c
rename to hw/virtio/virtio-md-stubs.c
diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
index d7f18c96e60..621fc65454c 100644
--- a/hw/virtio/meson.build
+++ b/hw/virtio/meson.build
@@ -87,6 +87,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(files('virtio-hmp-cmds.c'))
specific_ss.add_all(when: 'CONFIG_VIRTIO', if_true: specific_virtio_ss)
diff --git a/stubs/meson.build b/stubs/meson.build
index 45616afbfaa..60e32d363fa 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -57,7 +57,6 @@ if have_system
stub_ss.add(files('fw_cfg.c'))
stub_ss.add(files('semihost.c'))
stub_ss.add(files('xen-hw-stub.c'))
- stub_ss.add(files('virtio-md-pci.c'))
else
stub_ss.add(files('qdev.c'))
endif
--
GPG Key transition (from rsa2048 to rsa4096) since 2024-04-24.
New key: rsa4096/61AD3D98ECDF2C8E 9D8B E14E 3F2A 9DD7 9199 28F1 61AD 3D98
ECDF 2C8E
Old key: rsa2048/457CE0A0804465C5 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0
8044 65C5
Transition statement: http://www.corpit.ru/mjt/gpg-transition-2024.txt