From nobody Mon Feb 9 06:00:38 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1607459268; cv=none; d=zohomail.com; s=zohoarc; b=QXTgEU0cw6MMlRjG7L6aqiGeaEFTXlKYxswpPHgN7ZvtbWQtt9MY8mTO2fTLWHKWXrvIf3Llehi+jM3ldq5/ZFQ5LNSgjubDqMGYIbPBeFYcg99WbBeiIR2/wXx+yQxY2uWag3bGJTtODXh35jbSFrOFPImJ4PZfrwVl35mBhvQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607459268; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dV+7BzXez4+ny3udEAvAWmvm0532zQlUP4+qQ+UHZ0k=; b=IQND/QNdY7h9uwlZNC8OIE7mqYGlDk2FL/p/GGfGfHuMYeIw/FOCKODTrPiac+cot6H5lCkfXOMgyHq1P99JDQhWppXmNtSkNhiQD+YrRgTbJJTXl7+ELCTlRCmKi04bgUXU6HE7fjyqnQCypf/xC04swQel69NXgS3wGjCCK+A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1607459268493226.1407972700182; Tue, 8 Dec 2020 12:27:48 -0800 (PST) Received: from localhost ([::1]:34846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kmjKP-0000td-IA for importer@patchew.org; Tue, 08 Dec 2020 15:11:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmin5-0007FZ-25 for qemu-devel@nongnu.org; Tue, 08 Dec 2020 14:36:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kmin1-0005iz-BB for qemu-devel@nongnu.org; Tue, 08 Dec 2020 14:36:50 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-437-DDOik0TfNYerFJkb1YblAg-1; Tue, 08 Dec 2020 14:36:42 -0500 Received: by mail-wr1-f70.google.com with SMTP id o4so2932992wrw.19 for ; Tue, 08 Dec 2020 11:36:42 -0800 (PST) Received: from redhat.com (bzq-79-176-44-197.red.bezeqint.net. [79.176.44.197]) by smtp.gmail.com with ESMTPSA id v64sm5212201wme.25.2020.12.08.11.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Dec 2020 11:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607456204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dV+7BzXez4+ny3udEAvAWmvm0532zQlUP4+qQ+UHZ0k=; b=YUn35DRZGXJU+m3dIh2Lea4OF5H7PDZuJ+TAVsHCjz+d07soTHh5p8Fq71m7ZEiCcNMHoo luumKlQjCld62vZWp3pczMr3HNQDUW9Pe0+6qdoIOOBoiNAzLNeVtirfb5C7erHppwN+hk uRgD9osOq6GJmLCNTlu/bvFWpVL72SI= X-MC-Unique: DDOik0TfNYerFJkb1YblAg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=dV+7BzXez4+ny3udEAvAWmvm0532zQlUP4+qQ+UHZ0k=; b=o0T1DQsjxtJYCfqRWM0ijr+0ItWbBB1AQOuVwCEYX+37paMHULj1vr39dAiGpq8Ocb izRwmbTtGgkJ3y7WRonL/KciedcJ5zVT7QkkbIVO95NiZa7X4nfYyM+7WrZ31klDwGkA K7ymGCYjpP+sVHqZe0R5Ki5MIVzmDOVLJjdQyvJhfksEIk/I4qSud4tLE0LPHrusbG+6 pibnrp2BDzNB2w6FsYCd6tFt83/uQvpd4h18fk/1R/LER5uNNCn1weFFLn2leNitmKoZ n+LXqV/g4sTpBbQmfnbDITbnaREIzgtTMcLQUX0nXMHwL/7AuCtl3DyqGZxKhtMbI5Dm zqHg== X-Gm-Message-State: AOAM530MYgLlHCCTlfI920Dka8/IhTvPaGfUYt/+jZAAfjToOu11gmRi 6hppfe6Uf7exOyGlg5FeIrHSDLtD3+2pBkh5Zb0AEPn1N3pORr5MiD/KUH3kJDcji1SdAtlqmd7 UlVHBaXOkgARtxa+aXis1N4oYu6BO9mr7bMIT9VEqHDNjW1PA5CHFnJ+hV6fs X-Received: by 2002:a1c:730c:: with SMTP id d12mr5170823wmb.3.1607456200955; Tue, 08 Dec 2020 11:36:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiJ8Vhb1wMFyibGbW268tqo7Dz/i5n7shy8UvIIzk3rjZBg7rR0ffrcs+eRIOwj2qTunqjQw== X-Received: by 2002:a1c:730c:: with SMTP id d12mr5170789wmb.3.1607456200640; Tue, 08 Dec 2020 11:36:40 -0800 (PST) Date: Tue, 8 Dec 2020 14:36:36 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 48/66] libvhost-user: make it a meson subproject Message-ID: <20201208193307.646726-49-mst@redhat.com> References: <20201208193307.646726-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20201208193307.646726-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , qemu-block@nongnu.org, "Dr. David Alan Gilbert" , Coiby Xu , Raphael Norwitz , Gerd Hoffmann , Stefan Hajnoczi , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Marc-Andr=C3=A9 Lureau By making libvhost-user a subproject, check it builds standalone (without the global QEMU cflags etc). Note that the library still relies on QEMU include/qemu/atomic.h and linux_headers/. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20201125100640.366523-6-marcandre.lureau@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- contrib/vhost-user-gpu/vugpu.h | 2 +- include/qemu/vhost-user-server.h | 2 +- .../libvhost-user/libvhost-user-glib.h | 0 .../libvhost-user/libvhost-user.h | 0 block/export/vhost-user-blk-server.c | 2 +- contrib/vhost-user-blk/vhost-user-blk.c | 3 +-- contrib/vhost-user-input/main.c | 3 +-- contrib/vhost-user-scsi/vhost-user-scsi.c | 2 +- .../libvhost-user/libvhost-user-glib.c | 0 .../libvhost-user/libvhost-user.c | 0 tests/vhost-user-bridge.c | 2 +- tools/virtiofsd/fuse_virtio.c | 2 +- contrib/libvhost-user/meson.build | 4 ---- contrib/vhost-user-blk/meson.build | 3 +-- contrib/vhost-user-gpu/meson.build | 3 +-- contrib/vhost-user-input/meson.build | 3 +-- contrib/vhost-user-scsi/meson.build | 3 +-- meson.build | 7 ++++++- subprojects/libvhost-user/meson.build | 20 +++++++++++++++++++ tests/meson.build | 3 +-- tools/virtiofsd/meson.build | 3 +-- 21 files changed, 40 insertions(+), 27 deletions(-) rename {contrib =3D> subprojects}/libvhost-user/libvhost-user-glib.h (100%) rename {contrib =3D> subprojects}/libvhost-user/libvhost-user.h (100%) rename {contrib =3D> subprojects}/libvhost-user/libvhost-user-glib.c (100%) rename {contrib =3D> subprojects}/libvhost-user/libvhost-user.c (100%) delete mode 100644 contrib/libvhost-user/meson.build create mode 100644 subprojects/libvhost-user/meson.build diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h index 3153c9a6de..bdf9a74b46 100644 --- a/contrib/vhost-user-gpu/vugpu.h +++ b/contrib/vhost-user-gpu/vugpu.h @@ -17,7 +17,7 @@ =20 #include "qemu/osdep.h" =20 -#include "contrib/libvhost-user/libvhost-user-glib.h" +#include "libvhost-user-glib.h" #include "standard-headers/linux/virtio_gpu.h" =20 #include "qemu/queue.h" diff --git a/include/qemu/vhost-user-server.h b/include/qemu/vhost-user-ser= ver.h index 0da4c2cc4c..121ea1dedf 100644 --- a/include/qemu/vhost-user-server.h +++ b/include/qemu/vhost-user-server.h @@ -11,7 +11,7 @@ #ifndef VHOST_USER_SERVER_H #define VHOST_USER_SERVER_H =20 -#include "contrib/libvhost-user/libvhost-user.h" +#include "subprojects/libvhost-user/libvhost-user.h" /* only for the type = definitions */ #include "io/channel-socket.h" #include "io/channel-file.h" #include "io/net-listener.h" diff --git a/contrib/libvhost-user/libvhost-user-glib.h b/subprojects/libvh= ost-user/libvhost-user-glib.h similarity index 100% rename from contrib/libvhost-user/libvhost-user-glib.h rename to subprojects/libvhost-user/libvhost-user-glib.h diff --git a/contrib/libvhost-user/libvhost-user.h b/subprojects/libvhost-u= ser/libvhost-user.h similarity index 100% rename from contrib/libvhost-user/libvhost-user.h rename to subprojects/libvhost-user/libvhost-user.h diff --git a/block/export/vhost-user-blk-server.c b/block/export/vhost-user= -blk-server.c index 62672d1cb9..a3d95ca012 100644 --- a/block/export/vhost-user-blk-server.c +++ b/block/export/vhost-user-blk-server.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" #include "block/block.h" -#include "contrib/libvhost-user/libvhost-user.h" +#include "subprojects/libvhost-user/libvhost-user.h" /* only for the type = definitions */ #include "standard-headers/linux/virtio_blk.h" #include "qemu/vhost-user-server.h" #include "vhost-user-blk-server.h" diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-b= lk/vhost-user-blk.c index dc981bf945..6abd7835a8 100644 --- a/contrib/vhost-user-blk/vhost-user-blk.c +++ b/contrib/vhost-user-blk/vhost-user-blk.c @@ -17,8 +17,7 @@ =20 #include "qemu/osdep.h" #include "standard-headers/linux/virtio_blk.h" -#include "contrib/libvhost-user/libvhost-user-glib.h" -#include "contrib/libvhost-user/libvhost-user.h" +#include "libvhost-user-glib.h" =20 #if defined(__linux__) #include diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/mai= n.c index 6020c6f33a..3ea840cf44 100644 --- a/contrib/vhost-user-input/main.c +++ b/contrib/vhost-user-input/main.c @@ -12,8 +12,7 @@ #include "qemu/iov.h" #include "qemu/bswap.h" #include "qemu/sockets.h" -#include "contrib/libvhost-user/libvhost-user.h" -#include "contrib/libvhost-user/libvhost-user-glib.h" +#include "libvhost-user-glib.h" #include "standard-headers/linux/virtio_input.h" #include "qapi/error.h" =20 diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user= -scsi/vhost-user-scsi.c index 4639440a70..4f6e3e2a24 100644 --- a/contrib/vhost-user-scsi/vhost-user-scsi.c +++ b/contrib/vhost-user-scsi/vhost-user-scsi.c @@ -15,7 +15,7 @@ #define inline __attribute__((gnu_inline)) /* required for libiscsi v1.9.= 0 */ #include #undef inline -#include "contrib/libvhost-user/libvhost-user-glib.h" +#include "libvhost-user-glib.h" #include "standard-headers/linux/virtio_scsi.h" =20 =20 diff --git a/contrib/libvhost-user/libvhost-user-glib.c b/subprojects/libvh= ost-user/libvhost-user-glib.c similarity index 100% rename from contrib/libvhost-user/libvhost-user-glib.c rename to subprojects/libvhost-user/libvhost-user-glib.c diff --git a/contrib/libvhost-user/libvhost-user.c b/subprojects/libvhost-u= ser/libvhost-user.c similarity index 100% rename from contrib/libvhost-user/libvhost-user.c rename to subprojects/libvhost-user/libvhost-user.c diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index bd43607a4d..24815920b2 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -34,7 +34,7 @@ #include "qemu/ctype.h" #include "qemu/iov.h" #include "standard-headers/linux/virtio_net.h" -#include "contrib/libvhost-user/libvhost-user.h" +#include "libvhost-user.h" =20 #define VHOST_USER_BRIDGE_DEBUG 1 =20 diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c index 83ba07c6cd..623812c432 100644 --- a/tools/virtiofsd/fuse_virtio.c +++ b/tools/virtiofsd/fuse_virtio.c @@ -35,7 +35,7 @@ #include #include =20 -#include "contrib/libvhost-user/libvhost-user.h" +#include "libvhost-user.h" =20 struct fv_VuDev; struct fv_QueueInfo { diff --git a/contrib/libvhost-user/meson.build b/contrib/libvhost-user/meso= n.build deleted file mode 100644 index a261e7665f..0000000000 --- a/contrib/libvhost-user/meson.build +++ /dev/null @@ -1,4 +0,0 @@ -libvhost_user =3D static_library('vhost-user', - files('libvhost-user.c', 'libvhost-user-gli= b.c'), - build_by_default: false) -vhost_user =3D declare_dependency(link_with: libvhost_user) diff --git a/contrib/vhost-user-blk/meson.build b/contrib/vhost-user-blk/me= son.build index 5db8cc3fe2..601ea15ef5 100644 --- a/contrib/vhost-user-blk/meson.build +++ b/contrib/vhost-user-blk/meson.build @@ -1,6 +1,5 @@ # FIXME: broken on 32-bit architectures executable('vhost-user-blk', files('vhost-user-blk.c'), - link_with: libvhost_user, - dependencies: qemuutil, + dependencies: [qemuutil, vhost_user], build_by_default: false, install: false) diff --git a/contrib/vhost-user-gpu/meson.build b/contrib/vhost-user-gpu/me= son.build index c487ca72c1..2fc2320b52 100644 --- a/contrib/vhost-user-gpu/meson.build +++ b/contrib/vhost-user-gpu/meson.build @@ -2,8 +2,7 @@ if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in conf= ig_host \ and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host \ and pixman.found() executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm= .c'), - link_with: libvhost_user, - dependencies: [qemuutil, pixman, gbm, virgl], + dependencies: [qemuutil, pixman, gbm, virgl, vhost_user], install: true, install_dir: get_option('libexecdir')) =20 diff --git a/contrib/vhost-user-input/meson.build b/contrib/vhost-user-inpu= t/meson.build index 1eeb1329d9..21a9ed4f15 100644 --- a/contrib/vhost-user-input/meson.build +++ b/contrib/vhost-user-input/meson.build @@ -1,5 +1,4 @@ executable('vhost-user-input', files('main.c'), - link_with: libvhost_user, - dependencies: qemuutil, + dependencies: [qemuutil, vhost_user], build_by_default: targetos =3D=3D 'linux', install: false) diff --git a/contrib/vhost-user-scsi/meson.build b/contrib/vhost-user-scsi/= meson.build index 257cbffc8e..044c50bf43 100644 --- a/contrib/vhost-user-scsi/meson.build +++ b/contrib/vhost-user-scsi/meson.build @@ -1,7 +1,6 @@ if 'CONFIG_LIBISCSI' in config_host executable('vhost-user-scsi', files('vhost-user-scsi.c'), - link_with: libvhost_user, - dependencies: [qemuutil, libiscsi], + dependencies: [qemuutil, libiscsi, vhost_user], build_by_default: targetos =3D=3D 'linux', install: false) endif diff --git a/meson.build b/meson.build index e3386196ba..732b29a1f3 100644 --- a/meson.build +++ b/meson.build @@ -1475,7 +1475,12 @@ trace_events_subdirs +=3D [ 'util', ] =20 -subdir('contrib/libvhost-user') +vhost_user =3D not_found +if 'CONFIG_VHOST_USER' in config_host + libvhost_user =3D subproject('libvhost-user') + vhost_user =3D libvhost_user.get_variable('vhost_user_dep') +endif + subdir('qapi') subdir('qobject') subdir('stubs') diff --git a/subprojects/libvhost-user/meson.build b/subprojects/libvhost-u= ser/meson.build new file mode 100644 index 0000000000..f9ecc534cf --- /dev/null +++ b/subprojects/libvhost-user/meson.build @@ -0,0 +1,20 @@ +project('libvhost-user', 'c', + license: 'GPL-2.0-or-later', + default_options: ['c_std=3Dgnu99']) + +glib =3D dependency('glib-2.0') +inc =3D include_directories('../../include', '../../linux-headers') + +vhost_user =3D static_library('vhost-user', + files('libvhost-user.c'), + include_directories: inc, + c_args: '-D_GNU_SOURCE') + +vhost_user_glib =3D static_library('vhost-user-glib', + files('libvhost-user-glib.c'), + include_directories: inc, + link_with: vhost_user, + dependencies: glib) + +vhost_user_dep =3D declare_dependency(link_with: vhost_user_glib, + include_directories: include_directori= es('.')) diff --git a/tests/meson.build b/tests/meson.build index afeb6be689..1fa068f27b 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -264,8 +264,7 @@ endforeach if have_tools and 'CONFIG_VHOST_USER' in config_host and 'CONFIG_LINUX' in= config_host executable('vhost-user-bridge', sources: files('vhost-user-bridge.c'), - link_with: [libvhost_user], - dependencies: [qemuutil]) + dependencies: [qemuutil, vhost_user]) endif =20 if have_system and 'CONFIG_POSIX' in config_host diff --git a/tools/virtiofsd/meson.build b/tools/virtiofsd/meson.build index 17edecf55c..c134ba633f 100644 --- a/tools/virtiofsd/meson.build +++ b/tools/virtiofsd/meson.build @@ -8,8 +8,7 @@ executable('virtiofsd', files( 'helper.c', 'passthrough_ll.c', 'passthrough_seccomp.c'), - link_with: libvhost_user, - dependencies: [seccomp, qemuutil, libcap_ng], + dependencies: [seccomp, qemuutil, libcap_ng, vhost_user], install: true, install_dir: get_option('libexecdir')) =20 --=20 MST