[PATCH 037/143] meson: add qemu-bridge-helper

Paolo Bonzini posted 143 patches 5 years, 6 months ago
Maintainers: Anthony Perard <anthony.perard@citrix.com>, David Gibson <david@gibson.dropbear.id.au>, Keith Busch <kbusch@kernel.org>, Christian Borntraeger <borntraeger@de.ibm.com>, Helge Deller <deller@gmx.de>, Peter Maydell <peter.maydell@linaro.org>, Christian Schoenebeck <qemu_oss@crudebyte.com>, Laurent Vivier <laurent@vivier.eu>, Joel Stanley <joel@jms.id.au>, Raphael Norwitz <raphael.norwitz@nutanix.com>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Michael Rolnik <mrolnik@gmail.com>, Jason Wang <jasowang@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Alex Williamson <alex.williamson@redhat.com>, Juan Quintela <quintela@redhat.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Markus Armbruster <armbru@redhat.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Alexander Bulekov <alxndr@bu.edu>, Artyom Tarasenko <atar4qemu@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Sarah Harris <S.E.Harris@kent.ac.uk>, "Alex Bennée" <alex.bennee@linaro.org>, Stefan Weil <sw@weilnetz.de>, Riku Voipio <riku.voipio@iki.fi>, Stefan Berger <stefanb@linux.ibm.com>, Eduardo Habkost <ehabkost@redhat.com>, Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>, Eric Blake <eblake@redhat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Yoshinori Sato <ysato@users.sourceforge.jp>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Max Reitz <mreitz@redhat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Richard Henderson <rth@twiddle.net>, Max Filippov <jcmvbkbc@gmail.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Huacai Chen <chenhc@lemote.com>, Aurelien Jarno <aurelien@aurel32.net>, Hannes Reinecke <hare@suse.com>, Stafford Horne <shorne@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Alistair Francis <Alistair.Francis@wdc.com>, Laszlo Ersek <lersek@redhat.com>, Bandan Das <bsd@redhat.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Sagar Karandikar <sagark@eecs.berkeley.edu>, Andrzej Zaborowski <balrogg@gmail.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Su Hang <suhang16@mails.ucas.ac.cn>, Gerd Hoffmann <kraxel@redhat.com>, Amit Shah <amit@kernel.org>, Ben Warren <ben@skyportsystems.com>, "Cédric Le Goater" <clg@kaod.org>, Yuval Shaia <yuval.shaia.ml@gmail.com>, Fam Zheng <fam@euphon.net>, David Hildenbrand <david@redhat.com>, Greg Kurz <groug@kaod.org>, Thomas Huth <thuth@redhat.com>, Michael Roth <mdroth@linux.vnet.ibm.com>, Laurent Vivier <lvivier@redhat.com>, Paul Durrant <paul@xen.org>
There is a newer version of this series
[PATCH 037/143] meson: add qemu-bridge-helper
Posted by Paolo Bonzini 5 years, 6 months ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile    | 4 ----
 meson.build | 8 +++++++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 5df772b..0a2bbd5 100644
--- a/Makefile
+++ b/Makefile
@@ -181,8 +181,6 @@ LIBS+=-lz $(LIBS_TOOLS)
 
 HELPERS-y = $(HELPERS)
 
-HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += qemu-bridge-helper$(EXESUF)
-
 # Sphinx does not allow building manuals into the same directory as
 # the source files, so if we're doing an in-tree QEMU build we must
 # build the manuals into a subdirectory (and then install them from
@@ -415,8 +413,6 @@ qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io
 qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
 qemu-storage-daemon$(EXESUF): qemu-storage-daemon.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(chardev-obj-y) $(io-obj-y) $(qom-obj-y) $(storage-daemon-obj-y) $(COMMON_LDADDS)
 
-qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS)
-
 qemu-keymap$(EXESUF): qemu-keymap.o ui/input-keymap.o $(COMMON_LDADDS)
 
 qemu-edid$(EXESUF): qemu-edid.o hw/display/edid-generate.o $(COMMON_LDADDS)
diff --git a/meson.build b/meson.build
index a68c7b4..9eb1204 100644
--- a/meson.build
+++ b/meson.build
@@ -270,7 +270,6 @@ qemuutil = declare_dependency(link_with: libqemuutil,
                               sources: genh + version_res)
 
 # Other build targets
-
 if 'CONFIG_GUEST_AGENT' in config_host
   subdir('qga')
 endif
@@ -289,6 +288,13 @@ if have_tools
     subdir('contrib/vhost-user-scsi')
   endif
 
+  if host_machine.system() == 'linux'
+    executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
+               dependencies: [qemuutil, libcap_ng],
+               install: true,
+               install_dir: get_option('libexecdir'))
+  endif
+
   if 'CONFIG_IVSHMEM' in config_host
     subdir('contrib/ivshmem-client')
     subdir('contrib/ivshmem-server')
-- 
1.8.3.1



Re: [PATCH 037/143] meson: add qemu-bridge-helper
Posted by Philippe Mathieu-Daudé 5 years, 6 months ago
Hi Paolo,

On 8/6/20 9:14 PM, Paolo Bonzini wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  Makefile    | 4 ----
>  meson.build | 8 +++++++-
>  2 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 5df772b..0a2bbd5 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -181,8 +181,6 @@ LIBS+=-lz $(LIBS_TOOLS)
>  
>  HELPERS-y = $(HELPERS)
>  
> -HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += qemu-bridge-helper$(EXESUF)
> -
>  # Sphinx does not allow building manuals into the same directory as
>  # the source files, so if we're doing an in-tree QEMU build we must
>  # build the manuals into a subdirectory (and then install them from
> @@ -415,8 +413,6 @@ qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io
>  qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
>  qemu-storage-daemon$(EXESUF): qemu-storage-daemon.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(chardev-obj-y) $(io-obj-y) $(qom-obj-y) $(storage-daemon-obj-y) $(COMMON_LDADDS)
>  
> -qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o $(COMMON_LDADDS)
> -
>  qemu-keymap$(EXESUF): qemu-keymap.o ui/input-keymap.o $(COMMON_LDADDS)
>  
>  qemu-edid$(EXESUF): qemu-edid.o hw/display/edid-generate.o $(COMMON_LDADDS)
> diff --git a/meson.build b/meson.build
> index a68c7b4..9eb1204 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -270,7 +270,6 @@ qemuutil = declare_dependency(link_with: libqemuutil,
>                                sources: genh + version_res)
>  
>  # Other build targets
> -
>  if 'CONFIG_GUEST_AGENT' in config_host
>    subdir('qga')
>  endif
> @@ -289,6 +288,13 @@ if have_tools
>      subdir('contrib/vhost-user-scsi')
>    endif
>  
> +  if host_machine.system() == 'linux'
> +    executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
> +               dependencies: [qemuutil, libcap_ng],

Is libcap_ng still optional?

> +               install: true,
> +               install_dir: get_option('libexecdir'))
> +  endif
> +
>    if 'CONFIG_IVSHMEM' in config_host
>      subdir('contrib/ivshmem-client')
>      subdir('contrib/ivshmem-server')
> 


Re: [PATCH 037/143] meson: add qemu-bridge-helper
Posted by Paolo Bonzini 5 years, 6 months ago
On 07/08/20 15:20, Philippe Mathieu-Daudé wrote:
>>    endif
>>  
>> +  if host_machine.system() == 'linux'
>> +    executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
>> +               dependencies: [qemuutil, libcap_ng],
> Is libcap_ng still optional?
> 

Yes, if a dependency is absent it is simply left out.  See
contrib/vhost-user-scsi for an example where the executable is disabled.

Instead, if you want a dependency to be mandatory you have two choices:

- to break the build you use "required: true", see the SDL conversion
for an example

- to disable executables there is a thing called disabler but we're not
using it because it's confusing.  I was thinking of adding an
"or_disable()" method to dependency objects, but I have never
contributed it.

Paolo


Re: [PATCH 037/143] meson: add qemu-bridge-helper
Posted by Philippe Mathieu-Daudé 5 years, 6 months ago
On 8/7/20 4:26 PM, Paolo Bonzini wrote:
> On 07/08/20 15:20, Philippe Mathieu-Daudé wrote:
>>>    endif
>>>  
>>> +  if host_machine.system() == 'linux'
>>> +    executable('qemu-bridge-helper', files('qemu-bridge-helper.c'),
>>> +               dependencies: [qemuutil, libcap_ng],
>> Is libcap_ng still optional?
>>
> 
> Yes, if a dependency is absent it is simply left out.  See
> contrib/vhost-user-scsi for an example where the executable is disabled.
> 
> Instead, if you want a dependency to be mandatory you have two choices:
> 
> - to break the build you use "required: true", see the SDL conversion
> for an example

OK, good :)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> 
> - to disable executables there is a thing called disabler but we're not
> using it because it's confusing.  I was thinking of adding an
> "or_disable()" method to dependency objects, but I have never
> contributed it.
> 
> Paolo
>