From: Jagannathan Raman <jag.raman@oracle.com>
To: qemu-devel@nongnu.org
Cc: elena.ufimtseva@oracle.com, john.g.johnson@oracle.com,
thuth@redhat.com, jag.raman@oracle.com,
swapnil.ingle@nutanix.com, john.levon@nutanix.com,
philmd@redhat.com, alex.williamson@redhat.com,
marcandre.lureau@gmail.com, stefanha@redhat.com,
thanos.makatos@nutanix.com, pbonzini@redhat.com,
alex.bennee@linaro.org
Subject: [PATCH v3 02/12] vfio-user: build library
Date: Mon, 11 Oct 2021 01:31:07 -0400 [thread overview]
Message-ID: <48b1ca2b5070f3655075e02966c40786028dbfd9.1633929457.git.jag.raman@oracle.com> (raw)
In-Reply-To: <cover.1633929457.git.jag.raman@oracle.com>
add the libvfio-user library as a submodule. build it as a cmake
subproject.
Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Signed-off-by: John G Johnson <john.g.johnson@oracle.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
---
configure | 13 +++++++-
meson.build | 39 ++++++++++++++++++++++
.gitlab-ci.d/buildtest.yml | 2 ++
.gitmodules | 3 ++
MAINTAINERS | 1 +
hw/remote/Kconfig | 5 +++
hw/remote/meson.build | 2 ++
subprojects/libvfio-user | 1 +
tests/acceptance/multiprocess.py | 2 ++
tests/docker/dockerfiles/centos8.docker | 2 ++
tests/docker/dockerfiles/ubuntu2004.docker | 2 ++
11 files changed, 71 insertions(+), 1 deletion(-)
create mode 160000 subprojects/libvfio-user
diff --git a/configure b/configure
index e804dfba2f..88fb44f15a 100755
--- a/configure
+++ b/configure
@@ -443,7 +443,7 @@ skip_meson=no
gettext="auto"
fuse="auto"
fuse_lseek="auto"
-multiprocess="auto"
+multiprocess="disabled"
slirp_smbd="$default_feature"
malloc_trim="auto"
@@ -4284,6 +4284,17 @@ but not implemented on your system"
fi
fi
+##########################################
+# check for multiprocess
+
+case "$multiprocess" in
+ auto | enabled )
+ if test "$git_submodules_action" != "ignore"; then
+ git_submodules="${git_submodules} subprojects/libvfio-user"
+ fi
+ ;;
+esac
+
##########################################
# End of CC checks
# After here, no more $cc or $ld runs
diff --git a/meson.build b/meson.build
index 99a0a3e689..5c91305f2d 100644
--- a/meson.build
+++ b/meson.build
@@ -172,6 +172,10 @@ if targetos != 'linux' and get_option('multiprocess').enabled()
endif
multiprocess_allowed = targetos == 'linux' and not get_option('multiprocess').disabled()
+# libvfiouser is enabled with multiprocess. Presently, libvfiouser depends on
+# multiprocess code, as such it can't be enabled independently
+libvfiouser_allowed = multiprocess_allowed
+
libm = cc.find_library('m', required: false)
threads = dependency('threads')
util = cc.find_library('util', required: false)
@@ -1903,6 +1907,41 @@ if get_option('cfi') and slirp_opt == 'system'
+ ' Please configure with --enable-slirp=git')
endif
+vfiouser = not_found
+if have_system and libvfiouser_allowed
+ have_internal = fs.exists(meson.current_source_dir() / 'subprojects/libvfio-user/Makefile')
+
+ if not have_internal
+ error('libvfio-user source not found - please pull git submodule')
+ endif
+
+ json_c = dependency('json-c', required: false)
+ if not json_c.found()
+ json_c = dependency('libjson-c', required: false)
+ endif
+ if not json_c.found()
+ json_c = dependency('libjson-c-dev', required: false)
+ endif
+
+ if not json_c.found()
+ error('Unable to find json-c package')
+ endif
+
+ cmake = import('cmake')
+
+ vfiouser_subproj = cmake.subproject('libvfio-user')
+
+ vfiouser_sl = vfiouser_subproj.dependency('vfio-user-static')
+
+ # Although cmake links the json-c library with vfio-user-static
+ # target, that info is not available to meson via cmake.subproject.
+ # As such, we have to separately declare the json-c dependency here.
+ # This appears to be a current limitation of using cmake inside meson.
+ # libvfio-user is planning a switch to meson in the future, which
+ # would address this item automatically.
+ vfiouser = declare_dependency(dependencies: [vfiouser_sl, json_c])
+endif
+
fdt = not_found
fdt_opt = get_option('fdt')
if have_system
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 5c378e35f9..515ae40d1f 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -42,6 +42,7 @@ build-system-ubuntu:
variables:
IMAGE: ubuntu2004
CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-slirp=system
+ --enable-multiprocess
TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
microblazeel-softmmu mips64el-softmmu
MAKE_CHECK_ARGS: check-build
@@ -142,6 +143,7 @@ build-system-centos:
IMAGE: centos8
CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
--enable-modules --enable-trace-backends=dtrace
+ --enable-multiprocess
TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
MAKE_CHECK_ARGS: check-build
diff --git a/.gitmodules b/.gitmodules
index 08b1b48a09..cfeea7cf20 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -64,3 +64,6 @@
[submodule "roms/vbootrom"]
path = roms/vbootrom
url = https://gitlab.com/qemu-project/vbootrom.git
+[submodule "subprojects/libvfio-user"]
+ path = subprojects/libvfio-user
+ url = https://github.com/nutanix/libvfio-user.git
diff --git a/MAINTAINERS b/MAINTAINERS
index 50435b8d2f..661f91a160 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3420,6 +3420,7 @@ F: hw/remote/proxy-memory-listener.c
F: include/hw/remote/proxy-memory-listener.h
F: hw/remote/iohub.c
F: include/hw/remote/iohub.h
+F: subprojects/libvfio-user
EBPF:
M: Jason Wang <jasowang@redhat.com>
diff --git a/hw/remote/Kconfig b/hw/remote/Kconfig
index 08c16e235f..f9e512d44a 100644
--- a/hw/remote/Kconfig
+++ b/hw/remote/Kconfig
@@ -1,4 +1,9 @@
+config VFIO_USER_SERVER
+ bool
+ default n
+
config MULTIPROCESS
bool
depends on PCI && PCI_EXPRESS && KVM
select REMOTE_PCIHOST
+ select VFIO_USER_SERVER
diff --git a/hw/remote/meson.build b/hw/remote/meson.build
index e6a5574242..dfea6b533b 100644
--- a/hw/remote/meson.build
+++ b/hw/remote/meson.build
@@ -7,6 +7,8 @@ remote_ss.add(when: 'CONFIG_MULTIPROCESS', if_true: files('remote-obj.c'))
remote_ss.add(when: 'CONFIG_MULTIPROCESS', if_true: files('proxy.c'))
remote_ss.add(when: 'CONFIG_MULTIPROCESS', if_true: files('iohub.c'))
+remote_ss.add(when: 'CONFIG_VFIO_USER_SERVER', if_true: vfiouser)
+
specific_ss.add(when: 'CONFIG_MULTIPROCESS', if_true: files('memory.c'))
specific_ss.add(when: 'CONFIG_MULTIPROCESS', if_true: files('proxy-memory-listener.c'))
diff --git a/subprojects/libvfio-user b/subprojects/libvfio-user
new file mode 160000
index 0000000000..647c9341d2
--- /dev/null
+++ b/subprojects/libvfio-user
@@ -0,0 +1 @@
+Subproject commit 647c9341d2e06266a710ddd075f69c95dd3b8446
diff --git a/tests/acceptance/multiprocess.py b/tests/acceptance/multiprocess.py
index 96627f022a..7383c6eb58 100644
--- a/tests/acceptance/multiprocess.py
+++ b/tests/acceptance/multiprocess.py
@@ -67,6 +67,7 @@ def do_test(self, kernel_url, initrd_url, kernel_command_line,
def test_multiprocess_x86_64(self):
"""
:avocado: tags=arch:x86_64
+ :avocado: tags=distro:centos
"""
kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
'/linux/releases/31/Everything/x86_64/os/images'
@@ -82,6 +83,7 @@ def test_multiprocess_x86_64(self):
def test_multiprocess_aarch64(self):
"""
:avocado: tags=arch:aarch64
+ :avocado: tags=distro:ubuntu
"""
kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
'/linux/releases/31/Everything/aarch64/os/images'
diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker
index 46398c61ee..646abcda1f 100644
--- a/tests/docker/dockerfiles/centos8.docker
+++ b/tests/docker/dockerfiles/centos8.docker
@@ -12,6 +12,7 @@ ENV PACKAGES \
capstone-devel \
ccache \
clang \
+ cmake \
ctags \
cyrus-sasl-devel \
daxctl-devel \
@@ -32,6 +33,7 @@ ENV PACKAGES \
gtk3-devel \
hostname \
jemalloc-devel \
+ json-c-devel \
libaio-devel \
libasan \
libattr-devel \
diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker
index 39de63d012..ca4dff0e6b 100644
--- a/tests/docker/dockerfiles/ubuntu2004.docker
+++ b/tests/docker/dockerfiles/ubuntu2004.docker
@@ -6,6 +6,7 @@ ENV PACKAGES \
ca-certificates \
ccache \
clang \
+ cmake \
dbus \
debianutils \
diffutils \
@@ -44,6 +45,7 @@ ENV PACKAGES \
libiscsi-dev \
libjemalloc-dev \
libjpeg-turbo8-dev \
+ libjson-c-dev \
liblttng-ust-dev \
liblzo2-dev \
libncursesw5-dev \
--
2.20.1
next prev parent reply other threads:[~2021-10-11 5:33 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-11 5:31 [PATCH v3 00/12] vfio-user server in QEMU Jagannathan Raman
2021-10-11 5:31 ` [PATCH v3 01/12] configure, meson: override C compiler for cmake Jagannathan Raman
2021-10-12 10:44 ` Paolo Bonzini
2021-10-11 5:31 ` Jagannathan Raman [this message]
2021-10-27 15:17 ` [PATCH v3 02/12] vfio-user: build library Stefan Hajnoczi
2021-10-29 14:17 ` Jag Raman
2021-11-01 9:56 ` Stefan Hajnoczi
2021-10-11 5:31 ` [PATCH v3 03/12] vfio-user: define vfio-user-server object Jagannathan Raman
2021-10-27 15:40 ` Stefan Hajnoczi
2021-10-29 14:42 ` Jag Raman
2021-11-01 10:34 ` Stefan Hajnoczi
2021-11-04 12:13 ` Markus Armbruster
2021-11-04 14:39 ` Kevin Wolf
2021-11-05 10:08 ` Markus Armbruster
2021-11-05 13:19 ` Kevin Wolf
2021-11-05 13:54 ` Peter Krempa
2021-11-06 6:34 ` Markus Armbruster
2021-11-08 12:05 ` Kevin Wolf
2021-11-08 12:54 ` Peter Krempa
2021-11-04 16:48 ` Stefan Hajnoczi
2021-10-11 5:31 ` [PATCH v3 04/12] vfio-user: instantiate vfio-user context Jagannathan Raman
2021-10-27 15:59 ` Stefan Hajnoczi
2021-10-29 14:59 ` Jag Raman
2021-11-01 10:35 ` Stefan Hajnoczi
2021-10-11 5:31 ` [PATCH v3 05/12] vfio-user: find and init PCI device Jagannathan Raman
2021-10-27 16:05 ` Stefan Hajnoczi
2021-10-29 15:58 ` Jag Raman
2021-11-01 10:38 ` Stefan Hajnoczi
2021-10-11 5:31 ` [PATCH v3 06/12] vfio-user: run vfio-user context Jagannathan Raman
2021-10-27 16:21 ` Stefan Hajnoczi
2021-10-28 21:55 ` John Levon
2021-10-11 5:31 ` [PATCH v3 07/12] vfio-user: handle PCI config space accesses Jagannathan Raman
2021-10-27 16:35 ` Stefan Hajnoczi
2021-10-11 5:31 ` [PATCH v3 08/12] vfio-user: handle DMA mappings Jagannathan Raman
2021-10-11 5:31 ` [PATCH v3 09/12] vfio-user: handle PCI BAR accesses Jagannathan Raman
2021-10-27 16:38 ` Stefan Hajnoczi
2021-10-11 5:31 ` [PATCH v3 10/12] vfio-user: handle device interrupts Jagannathan Raman
2021-10-11 5:31 ` [PATCH v3 11/12] vfio-user: register handlers to facilitate migration Jagannathan Raman
2021-10-27 18:30 ` Stefan Hajnoczi
2021-12-15 15:49 ` Jag Raman
2021-10-11 5:31 ` [PATCH v3 12/12] vfio-user: acceptance test Jagannathan Raman
2021-10-11 22:26 ` Philippe Mathieu-Daudé
2021-10-27 16:42 ` Stefan Hajnoczi
2021-10-27 18:33 ` [PATCH v3 00/12] vfio-user server in QEMU Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48b1ca2b5070f3655075e02966c40786028dbfd9.1633929457.git.jag.raman@oracle.com \
--to=jag.raman@oracle.com \
--cc=alex.bennee@linaro.org \
--cc=alex.williamson@redhat.com \
--cc=elena.ufimtseva@oracle.com \
--cc=john.g.johnson@oracle.com \
--cc=john.levon@nutanix.com \
--cc=marcandre.lureau@gmail.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=swapnil.ingle@nutanix.com \
--cc=thanos.makatos@nutanix.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).