diff mbox series

[2/4] qemu-storage-daemon: avoid compiling blockdev_ss twice

Message ID 20200925134229.246169-3-stefanha@redhat.com
State Accepted
Commit 4fb9071f65aa871bb46d665899ee328a94d9f781
Headers show
Series block/export: add BlockExportOptions->iothread member | expand

Commit Message

Stefan Hajnoczi Sept. 25, 2020, 1:42 p.m. UTC
Introduce libblkdev.fa to avoid recompiling blockdev_ss twice.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 meson.build                | 12 ++++++++++--
 storage-daemon/meson.build |  3 +--
 2 files changed, 11 insertions(+), 4 deletions(-)

Comments

Paolo Bonzini Sept. 25, 2020, 2:08 p.m. UTC | #1
On 25/09/20 15:42, Stefan Hajnoczi wrote:
> Introduce libblkdev.fa to avoid recompiling blockdev_ss twice.

> 

> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>

> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

> ---

>  meson.build                | 12 ++++++++++--

>  storage-daemon/meson.build |  3 +--

>  2 files changed, 11 insertions(+), 4 deletions(-)

> 

> diff --git a/meson.build b/meson.build

> index eb84b97ebb..18d689b423 100644

> --- a/meson.build

> +++ b/meson.build

> @@ -857,7 +857,6 @@ blockdev_ss.add(files(

>  blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))

>  softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])

>  

> -softmmu_ss.add_all(blockdev_ss)

>  softmmu_ss.add(files(

>    'bootdevice.c',

>    'dma-helpers.c',

> @@ -952,6 +951,15 @@ block = declare_dependency(link_whole: [libblock],

>                             link_args: '@block.syms',

>                             dependencies: [crypto, io])

>  

> +blockdev_ss = blockdev_ss.apply(config_host, strict: false)

> +libblockdev = static_library('blockdev', blockdev_ss.sources() + genh,

> +                             dependencies: blockdev_ss.dependencies(),

> +                             name_suffix: 'fa',

> +                             build_by_default: false)

> +

> +blockdev = declare_dependency(link_whole: [libblockdev],

> +                              dependencies: [block])

> +

>  qmp_ss = qmp_ss.apply(config_host, strict: false)

>  libqmp = static_library('qmp', qmp_ss.sources() + genh,

>                          dependencies: qmp_ss.dependencies(),

> @@ -968,7 +976,7 @@ foreach m : block_mods + softmmu_mods

>                  install_dir: config_host['qemu_moddir'])

>  endforeach

>  

> -softmmu_ss.add(authz, block, chardev, crypto, io, qmp)

> +softmmu_ss.add(authz, blockdev, chardev, crypto, io, qmp)

>  common_ss.add(qom, qemuutil)

>  

>  common_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: [softmmu_ss])

> diff --git a/storage-daemon/meson.build b/storage-daemon/meson.build

> index 0409acc3f5..c5adce81c3 100644

> --- a/storage-daemon/meson.build

> +++ b/storage-daemon/meson.build

> @@ -1,7 +1,6 @@

>  qsd_ss = ss.source_set()

>  qsd_ss.add(files('qemu-storage-daemon.c'))

> -qsd_ss.add(block, chardev, qmp, qom, qemuutil)

> -qsd_ss.add_all(blockdev_ss)

> +qsd_ss.add(blockdev, chardev, qmp, qom, qemuutil)

>  

>  subdir('qapi')

>  

> 


Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
diff mbox series

Patch

diff --git a/meson.build b/meson.build
index eb84b97ebb..18d689b423 100644
--- a/meson.build
+++ b/meson.build
@@ -857,7 +857,6 @@  blockdev_ss.add(files(
 blockdev_ss.add(when: 'CONFIG_POSIX', if_true: files('os-posix.c'))
 softmmu_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
 
-softmmu_ss.add_all(blockdev_ss)
 softmmu_ss.add(files(
   'bootdevice.c',
   'dma-helpers.c',
@@ -952,6 +951,15 @@  block = declare_dependency(link_whole: [libblock],
                            link_args: '@block.syms',
                            dependencies: [crypto, io])
 
+blockdev_ss = blockdev_ss.apply(config_host, strict: false)
+libblockdev = static_library('blockdev', blockdev_ss.sources() + genh,
+                             dependencies: blockdev_ss.dependencies(),
+                             name_suffix: 'fa',
+                             build_by_default: false)
+
+blockdev = declare_dependency(link_whole: [libblockdev],
+                              dependencies: [block])
+
 qmp_ss = qmp_ss.apply(config_host, strict: false)
 libqmp = static_library('qmp', qmp_ss.sources() + genh,
                         dependencies: qmp_ss.dependencies(),
@@ -968,7 +976,7 @@  foreach m : block_mods + softmmu_mods
                 install_dir: config_host['qemu_moddir'])
 endforeach
 
-softmmu_ss.add(authz, block, chardev, crypto, io, qmp)
+softmmu_ss.add(authz, blockdev, chardev, crypto, io, qmp)
 common_ss.add(qom, qemuutil)
 
 common_ss.add_all(when: 'CONFIG_SOFTMMU', if_true: [softmmu_ss])
diff --git a/storage-daemon/meson.build b/storage-daemon/meson.build
index 0409acc3f5..c5adce81c3 100644
--- a/storage-daemon/meson.build
+++ b/storage-daemon/meson.build
@@ -1,7 +1,6 @@ 
 qsd_ss = ss.source_set()
 qsd_ss.add(files('qemu-storage-daemon.c'))
-qsd_ss.add(block, chardev, qmp, qom, qemuutil)
-qsd_ss.add_all(blockdev_ss)
+qsd_ss.add(blockdev, chardev, qmp, qom, qemuutil)
 
 subdir('qapi')