Reviewed-by: Manos Pitsidianakis <manos.pitsidiana...@linaro.org>
On Tue, Jul 8, 2025 at 1:17 PM Philippe Mathieu-Daudé <phi...@linaro.org> wrote:
>
> (Forgot to Cc Manos)
>
> On 7/7/25 19:20, Philippe Mathieu-Daudé wrote:
> > Now than various VirtIO files don't use target specific
> > API anymore, we can move them to the system_ss[] source
> > set to build them once.
> >
> > Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
> > ---
> > hw/virtio/virtio-config-io.c | 1 -
> > hw/block/meson.build | 6 ++++--
> > hw/virtio/meson.build | 20 +++++++++++---------
> > 3 files changed, 15 insertions(+), 12 deletions(-)
> >
> > diff --git a/hw/virtio/virtio-config-io.c b/hw/virtio/virtio-config-io.c
> > index ad78e0b9bc5..f58d90b6e31 100644
> > --- a/hw/virtio/virtio-config-io.c
> > +++ b/hw/virtio/virtio-config-io.c
> > @@ -11,7 +11,6 @@
> >
> > #include "qemu/osdep.h"
> > #include "hw/virtio/virtio.h"
> > -#include "cpu.h"
> >
> > uint32_t virtio_config_readb(VirtIODevice *vdev, uint32_t addr)
> > {
> > diff --git a/hw/block/meson.build b/hw/block/meson.build
> > index 655704471a5..43ed296cf47 100644
> > --- a/hw/block/meson.build
> > +++ b/hw/block/meson.build
> > @@ -13,7 +13,9 @@ system_ss.add(when: 'CONFIG_SSI_M25P80', if_true:
> > files('m25p80_sfdp.c'))
> > system_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c'))
> > system_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-block.c'))
> >
> > -specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c',
> > 'virtio-blk-common.c'))
> > -specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true:
> > files('vhost-user-blk.c', 'virtio-blk-common.c'))
> > +specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c'))
> > +system_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true:
> > files('virtio-blk-common.c'))
> > +specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true:
> > files('vhost-user-blk.c'))
> > +system_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true:
> > files('virtio-blk-common.c'))
> >
> > subdir('dataplane')
> > diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build
> > index 164f6fd995a..3ea7b3cec83 100644
> > --- a/hw/virtio/meson.build
> > +++ b/hw/virtio/meson.build
> > @@ -1,6 +1,7 @@
> > system_virtio_ss = ss.source_set()
> > system_virtio_ss.add(files('virtio-bus.c'))
> > system_virtio_ss.add(files('iothread-vq-mapping.c'))
> > +system_virtio_ss.add(files('virtio-config-io.c'))
> > system_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true:
> > files('virtio-pci.c'))
> > system_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true:
> > files('virtio-mmio.c'))
> > system_virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true:
> > files('virtio-crypto.c'))
> > @@ -10,11 +11,11 @@ system_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV',
> > if_true: files('vdpa-dev.c')
> >
> > specific_virtio_ss = ss.source_set()
> > specific_virtio_ss.add(files('virtio.c'))
> > -specific_virtio_ss.add(files('virtio-config-io.c', 'virtio-qmp.c'))
> > +specific_virtio_ss.add(files('virtio-qmp.c'))
> >
> > if have_vhost
> > system_virtio_ss.add(files('vhost.c'))
> > - specific_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c'))
> > + system_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c'))
> > if have_vhost_user
> > # fixme - this really should be generic
> > specific_virtio_ss.add(files('vhost-user.c'))
> > @@ -43,22 +44,22 @@ if have_vhost
> > endif
> > if have_vhost_vdpa
> > system_virtio_ss.add(files('vhost-vdpa.c'))
> > - specific_virtio_ss.add(files('vhost-shadow-virtqueue.c'))
> > + system_virtio_ss.add(files('vhost-shadow-virtqueue.c'))
> > endif
> > else
> > system_virtio_ss.add(files('vhost-stub.c'))
> > endif
> > +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true:
> > files('vhost-user-vsock.c'))
> > +system_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true:
> > files('virtio-rng.c'))
> >
> > specific_virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true:
> > files('virtio-balloon.c'))
> > specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true:
> > files('vhost-user-fs.c'))
> > specific_virtio_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true:
> > files('virtio-pmem.c'))
> > specific_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true:
> > files('vhost-vsock.c'))
> > -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true:
> > files('vhost-user-vsock.c'))
> > -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true:
> > files('virtio-rng.c'))
> > -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true:
> > [files('virtio-nsm.c', 'cbor-helpers.c'), libcbor])
> > specific_virtio_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true:
> > files('virtio-mem.c'))
> > -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true:
> > files('vhost-user-scmi.c'))
> > -specific_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI',
> > 'CONFIG_VHOST_USER_SCMI'], if_true: files('vhost-user-scmi-pci.c'))
> > +system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true:
> > files('virtio-nsm.c'))
> > +system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true:
> > [files('cbor-helpers.c'), libcbor])
> > +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true:
> > files('vhost-user-scmi.c'))
> >
> > virtio_pci_ss = ss.source_set()
> > virtio_pci_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true:
> > files('vhost-vsock-pci.c'))
> > @@ -67,6 +68,7 @@ virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true:
> > files('vhost-user-blk-
> > virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCSI', if_true:
> > files('vhost-user-scsi-pci.c'))
> > virtio_pci_ss.add(when: 'CONFIG_VHOST_SCSI', if_true:
> > files('vhost-scsi-pci.c'))
> > virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true:
> > files('vhost-user-fs-pci.c'))
> > +virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true:
> > files('vhost-user-scmi-pci.c'))
> >
> > virtio_pci_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true:
> > files('virtio-crypto-pci.c'))
> > virtio_pci_ss.add(when: 'CONFIG_VIRTIO_INPUT_HOST', if_true:
> > files('virtio-input-host-pci.c'))
> > @@ -85,7 +87,7 @@ virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true:
> > files('virtio-mem-pci.c'))
> > virtio_pci_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true:
> > files('vdpa-dev-pci.c'))
> > virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MD', if_true:
> > files('virtio-md-pci.c'))
> >
> > -specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true:
> > virtio_pci_ss)
> > +system_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'))
>