<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Daniel,
<div class=""><br class="">
</div>
<div class="">We’ve created the following issue to update QEMU’s libvfio-user mirror</div>
<div class="">to the latest:</div>
<div class=""><a href="https://gitlab.com/qemu-project/libvfio-user/-/issues/1" class="">https://gitlab.com/qemu-project/libvfio-user/-/issues/1</a></div>
<div class=""><br class="">
</div>
<div class="">Will update QEMU’s submodule once this mirror is updated.</div>
<div class=""><br class="">
</div>
<div class="">Thank you!</div>
<div class="">--</div>
<div class="">Jag<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jul 21, 2022, at 6:25 AM, Daniel P. Berrangé <<a href="mailto:berrange@redhat.com" class="">berrange@redhat.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">Hi Jay / Stefan,<br class="">
<br class="">
We've got a non-determinsitic hang in QEMU CI since this series<br class="">
merged, which we tracked down to a libvfio-user test that is<br class="">
flakey:<br class="">
<br class="">
 <a href="https://gitlab.com/qemu-project/qemu/-/issues/1114" class="">https://gitlab.com/qemu-project/qemu/-/issues/1114</a><br class="">
<br class="">
John Levon has proposed a PR to libvfio-user to turn off the<br class="">
test, but we'll need one of you to update the git submodule<br class="">
for libvfio-user on the QEMU side, as I can't find a nice way<br class="">
to selectively skip the test from QEMU side alone.<br class="">
<br class="">
With regards<br class="">
Daniel<br class="">
<br class="">
On Wed, Jun 15, 2022 at 04:51:17PM +0100, Stefan Hajnoczi wrote:<br class="">
<blockquote type="cite" class="">From: Jagannathan Raman <<a href="mailto:jag.raman@oracle.com" class="">jag.raman@oracle.com</a>><br class="">
<br class="">
add the libvfio-user library as a submodule. build it as a meson<br class="">
subproject.<br class="">
<br class="">
libvfio-user is distributed with BSD 3-Clause license and<br class="">
json-c with MIT (Expat) license<br class="">
<br class="">
Signed-off-by: Elena Ufimtseva <<a href="mailto:elena.ufimtseva@oracle.com" class="">elena.ufimtseva@oracle.com</a>><br class="">
Signed-off-by: John G Johnson <<a href="mailto:john.g.johnson@oracle.com" class="">john.g.johnson@oracle.com</a>><br class="">
Signed-off-by: Jagannathan Raman <<a href="mailto:jag.raman@oracle.com" class="">jag.raman@oracle.com</a>><br class="">
Reviewed-by: Stefan Hajnoczi <<a href="mailto:stefanha@redhat.com" class="">stefanha@redhat.com</a>><br class="">
Message-id: <a href="mailto:c2adec87958b081d1dc8775d4aa05c897912f025.1655151679.git.jag.raman@oracle.com" class="">
c2adec87958b081d1dc8775d4aa05c897912f025.1655151679.git.jag.raman@oracle.com</a><br class="">
<br class="">
[Changed submodule URL to QEMU's libvfio-user mirror on GitLab. The QEMU<br class="">
project mirrors its dependencies so that it can provide full source code<br class="">
even in the event that its dependencies become unavailable. Note that<br class="">
the mirror repo is manually updated, so please contact me to make newer<br class="">
libvfio-user commits available. If I become a bottleneck we can set up a<br class="">
cronjob.<br class="">
<br class="">
Updated scripts/meson-buildoptions.sh to match the meson_options.txt<br class="">
change. Failure to do so can result in scripts/meson-buildoptions.sh<br class="">
being modified by the build system later on and you end up with a dirty<br class="">
working tree.<br class="">
--Stefan]<br class="">
<br class="">
Signed-off-by: Stefan Hajnoczi <<a href="mailto:stefanha@redhat.com" class="">stefanha@redhat.com</a>><br class="">
---<br class="">
MAINTAINERS                             |  1 +<br class="">
meson_options.txt                       |  2 ++<br class="">
configure                               | 17 +++++++++++++++++<br class="">
meson.build                             | 23 ++++++++++++++++++++++-<br class="">
.gitlab-ci.d/buildtest.yml              |  1 +<br class="">
.gitmodules                             |  3 +++<br class="">
Kconfig.host                            |  4 ++++<br class="">
hw/remote/Kconfig                       |  4 ++++<br class="">
hw/remote/meson.build                   |  2 ++<br class="">
scripts/meson-buildoptions.sh           |  4 ++++<br class="">
subprojects/libvfio-user                |  1 +<br class="">
tests/docker/dockerfiles/centos8.docker |  2 ++<br class="">
12 files changed, 63 insertions(+), 1 deletion(-)<br class="">
create mode 160000 subprojects/libvfio-user<br class="">
<br class="">
diff --git a/MAINTAINERS b/MAINTAINERS<br class="">
index 5ba93348aa..d0fcaf0edb 100644<br class="">
--- a/MAINTAINERS<br class="">
+++ b/MAINTAINERS<br class="">
@@ -3642,6 +3642,7 @@ F: hw/remote/proxy-memory-listener.c<br class="">
F: include/hw/remote/proxy-memory-listener.h<br class="">
F: hw/remote/iohub.c<br class="">
F: include/hw/remote/iohub.h<br class="">
+F: subprojects/libvfio-user<br class="">
<br class="">
EBPF:<br class="">
M: Jason Wang <<a href="mailto:jasowang@redhat.com" class="">jasowang@redhat.com</a>><br class="">
diff --git a/meson_options.txt b/meson_options.txt<br class="">
index 0e8197386b..f3e2f22c1e 100644<br class="">
--- a/meson_options.txt<br class="">
+++ b/meson_options.txt<br class="">
@@ -88,6 +88,8 @@ option('cfi_debug', type: 'boolean', value: 'false',<br class="">
       description: 'Verbose errors in case of CFI violation')<br class="">
option('multiprocess', type: 'feature', value: 'auto',<br class="">
       description: 'Out of process device emulation support')<br class="">
+option('vfio_user_server', type: 'feature', value: 'disabled',<br class="">
+       description: 'vfio-user server support')<br class="">
option('dbus_display', type: 'feature', value: 'auto',<br class="">
       description: '-display dbus support')<br class="">
option('tpm', type : 'feature', value : 'auto',<br class="">
diff --git a/configure b/configure<br class="">
index 4b12a8094c..c14e7f590a 100755<br class="">
--- a/configure<br class="">
+++ b/configure<br class="">
@@ -315,6 +315,7 @@ meson_args=""<br class="">
ninja=""<br class="">
bindir="bin"<br class="">
skip_meson=no<br class="">
+vfio_user_server="disabled"<br class="">
<br class="">
# The following Meson options are handled manually (still they<br class="">
# are included in the automatically generated help message)<br class="">
@@ -909,6 +910,10 @@ for opt do<br class="">
  ;;<br class="">
  --disable-blobs) meson_option_parse --disable-install-blobs ""<br class="">
  ;;<br class="">
+  --enable-vfio-user-server) vfio_user_server="enabled"<br class="">
+  ;;<br class="">
+  --disable-vfio-user-server) vfio_user_server="disabled"<br class="">
+  ;;<br class="">
  --enable-tcmalloc) meson_option_parse --enable-malloc=tcmalloc tcmalloc<br class="">
  ;;<br class="">
  --enable-jemalloc) meson_option_parse --enable-malloc=jemalloc jemalloc<br class="">
@@ -2132,6 +2137,17 @@ write_container_target_makefile() {<br class="">
<br class="">
<br class="">
<br class="">
+##########################################<br class="">
+# check for vfio_user_server<br class="">
+<br class="">
+case "$vfio_user_server" in<br class="">
+  enabled )<br class="">
+    if test "$git_submodules_action" != "ignore"; then<br class="">
+      git_submodules="${git_submodules} subprojects/libvfio-user"<br class="">
+    fi<br class="">
+    ;;<br class="">
+esac<br class="">
+<br class="">
##########################################<br class="">
# End of CC checks<br class="">
# After here, no more $cc or $ld runs<br class="">
@@ -2672,6 +2688,7 @@ if test "$skip_meson" = no; then<br class="">
  test "$slirp" != auto && meson_option_add "-Dslirp=$slirp"<br class="">
  test "$smbd" != '' && meson_option_add "-Dsmbd=$smbd"<br class="">
  test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"<br class="">
+  test "$vfio_user_server" != auto && meson_option_add "-Dvfio_user_server=$vfio_user_server"<br class="">
  run_meson() {<br class="">
    NINJA=$ninja $meson setup --prefix "$prefix" "$@" $cross_arg "$PWD" "$source_path"<br class="">
  }<br class="">
diff --git a/meson.build b/meson.build<br class="">
index 9e65cc5367..ca19ddc30c 100644<br class="">
--- a/meson.build<br class="">
+++ b/meson.build<br class="">
@@ -308,6 +308,10 @@ multiprocess_allowed = get_option('multiprocess') \<br class="">
  .require(targetos == 'linux', error_message: 'Multiprocess QEMU is supported only on Linux') \<br class="">
  .allowed()<br class="">
<br class="">
+vfio_user_server_allowed = get_option('vfio_user_server') \<br class="">
+  .require(targetos == 'linux', error_message: 'vfio-user server is supported only on Linux') \<br class="">
+  .allowed()<br class="">
+<br class="">
have_tpm = get_option('tpm') \<br class="">
  .require(targetos != 'windows', error_message: 'TPM emulation only available on POSIX systems') \<br class="">
  .allowed()<br class="">
@@ -2380,7 +2384,8 @@ host_kconfig = \<br class="">
  (have_virtfs ? ['CONFIG_VIRTFS=y'] : []) + \<br class="">
  ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \<br class="">
  (have_pvrdma ? ['CONFIG_PVRDMA=y'] : []) + \<br class="">
-  (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : [])<br class="">
+  (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=y'] : []) + \<br class="">
+  (vfio_user_server_allowed ? ['CONFIG_VFIO_USER_SERVER_ALLOWED=y'] : [])<br class="">
<br class="">
ignored = [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ]<br class="">
<br class="">
@@ -2672,6 +2677,21 @@ if have_system<br class="">
  endif<br class="">
endif<br class="">
<br class="">
+libvfio_user_dep = not_found<br class="">
+if have_system and vfio_user_server_allowed<br class="">
+  have_internal = fs.exists(meson.current_source_dir() / 'subprojects/libvfio-user/meson.build')<br class="">
+<br class="">
+  if not have_internal<br class="">
+    error('libvfio-user source not found - please pull git submodule')<br class="">
+  endif<br class="">
+<br class="">
+  libvfio_user_proj = subproject('libvfio-user')<br class="">
+<br class="">
+  libvfio_user_lib = libvfio_user_proj.get_variable('libvfio_user_dep')<br class="">
+<br class="">
+  libvfio_user_dep = declare_dependency(dependencies: [libvfio_user_lib])<br class="">
+endif<br class="">
+<br class="">
fdt = not_found<br class="">
if have_system<br class="">
  fdt_opt = get_option('fdt')<br class="">
@@ -3790,6 +3810,7 @@ summary_info += {'target list':       ' '.join(target_dirs)}<br class="">
if have_system<br class="">
  summary_info += {'default devices':   get_option('default_devices')}<br class="">
  summary_info += {'out of process emulation': multiprocess_allowed}<br class="">
+  summary_info += {'vfio-user server': vfio_user_server_allowed}<br class="">
endif<br class="">
summary(summary_info, bool_yn: true, section: 'Targets and accelerators')<br class="">
<br class="">
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml<br class="">
index cb7cad44b5..8a4353ef93 100644<br class="">
--- a/.gitlab-ci.d/buildtest.yml<br class="">
+++ b/.gitlab-ci.d/buildtest.yml<br class="">
@@ -168,6 +168,7 @@ build-system-centos:<br class="">
    IMAGE: centos8<br class="">
    CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system<br class="">
      --enable-modules --enable-trace-backends=dtrace --enable-docs<br class="">
+      --enable-vfio-user-server<br class="">
    TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu<br class="">
      x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu<br class="">
    MAKE_CHECK_ARGS: check-build<br class="">
diff --git a/.gitmodules b/.gitmodules<br class="">
index b8bff47df8..aedd9a03d4 100644<br class="">
--- a/.gitmodules<br class="">
+++ b/.gitmodules<br class="">
@@ -64,3 +64,6 @@<br class="">
[submodule "tests/lcitool/libvirt-ci"]<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>path = tests/lcitool/libvirt-ci<br class="">
<span class="Apple-tab-span" style="white-space:pre"></span>url = <a href="https://gitlab.com/libvirt/libvirt-ci.git" class="">
https://gitlab.com/libvirt/libvirt-ci.git</a><br class="">
+[submodule "subprojects/libvfio-user"]<br class="">
+<span class="Apple-tab-span" style="white-space:pre"> </span>path = subprojects/libvfio-user<br class="">
+<span class="Apple-tab-span" style="white-space:pre"> </span>url = <a href="https://gitlab.com/qemu-project/libvfio-user.git" class="">
https://gitlab.com/qemu-project/libvfio-user.git</a><br class="">
diff --git a/Kconfig.host b/Kconfig.host<br class="">
index 1165c4eacd..d763d89269 100644<br class="">
--- a/Kconfig.host<br class="">
+++ b/Kconfig.host<br class="">
@@ -42,3 +42,7 @@ config MULTIPROCESS_ALLOWED<br class="">
config FUZZ<br class="">
    bool<br class="">
    select SPARSE_MEM<br class="">
+<br class="">
+config VFIO_USER_SERVER_ALLOWED<br class="">
+    bool<br class="">
+    imply VFIO_USER_SERVER<br class="">
diff --git a/hw/remote/Kconfig b/hw/remote/Kconfig<br class="">
index 08c16e235f..2d6b4f4cf4 100644<br class="">
--- a/hw/remote/Kconfig<br class="">
+++ b/hw/remote/Kconfig<br class="">
@@ -2,3 +2,7 @@ config MULTIPROCESS<br class="">
    bool<br class="">
    depends on PCI && PCI_EXPRESS && KVM<br class="">
    select REMOTE_PCIHOST<br class="">
+<br class="">
+config VFIO_USER_SERVER<br class="">
+    bool<br class="">
+    depends on MULTIPROCESS<br class="">
diff --git a/hw/remote/meson.build b/hw/remote/meson.build<br class="">
index e6a5574242..7da83350c8 100644<br class="">
--- a/hw/remote/meson.build<br class="">
+++ b/hw/remote/meson.build<br class="">
@@ -7,6 +7,8 @@ remote_ss.add(when: 'CONFIG_MULTIPROCESS', if_true: files('remote-obj.c'))<br class="">
remote_ss.add(when: 'CONFIG_MULTIPROCESS', if_true: files('proxy.c'))<br class="">
remote_ss.add(when: 'CONFIG_MULTIPROCESS', if_true: files('iohub.c'))<br class="">
<br class="">
+remote_ss.add(when: 'CONFIG_VFIO_USER_SERVER', if_true: libvfio_user_dep)<br class="">
+<br class="">
specific_ss.add(when: 'CONFIG_MULTIPROCESS', if_true: files('memory.c'))<br class="">
specific_ss.add(when: 'CONFIG_MULTIPROCESS', if_true: files('proxy-memory-listener.c'))<br class="">
<br class="">
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh<br class="">
index 1fc1d2e2c3..24eb5f35ea 100644<br class="">
--- a/scripts/meson-buildoptions.sh<br class="">
+++ b/scripts/meson-buildoptions.sh<br class="">
@@ -153,6 +153,8 @@ meson_options_help() {<br class="">
  printf "%s\n" '  usb-redir       libusbredir support'<br class="">
  printf "%s\n" '  vde             vde network backend support'<br class="">
  printf "%s\n" '  vdi             vdi image format support'<br class="">
+  printf "%s\n" '  vfio-user-server'<br class="">
+  printf "%s\n" '                  vfio-user server support'<br class="">
  printf "%s\n" '  vhost-crypto    vhost-user crypto backend support'<br class="">
  printf "%s\n" '  vhost-kernel    vhost kernel backend support'<br class="">
  printf "%s\n" '  vhost-net       vhost-net kernel acceleration support'<br class="">
@@ -415,6 +417,8 @@ _meson_option_parse() {<br class="">
    --disable-vde) printf "%s" -Dvde=disabled ;;<br class="">
    --enable-vdi) printf "%s" -Dvdi=enabled ;;<br class="">
    --disable-vdi) printf "%s" -Dvdi=disabled ;;<br class="">
+    --enable-vfio-user-server) printf "%s" -Dvfio_user_server=enabled ;;<br class="">
+    --disable-vfio-user-server) printf "%s" -Dvfio_user_server=disabled ;;<br class="">
    --enable-vhost-crypto) printf "%s" -Dvhost_crypto=enabled ;;<br class="">
    --disable-vhost-crypto) printf "%s" -Dvhost_crypto=disabled ;;<br class="">
    --enable-vhost-kernel) printf "%s" -Dvhost_kernel=enabled ;;<br class="">
diff --git a/subprojects/libvfio-user b/subprojects/libvfio-user<br class="">
new file mode 160000<br class="">
index 0000000000..0b28d20557<br class="">
--- /dev/null<br class="">
+++ b/subprojects/libvfio-user<br class="">
@@ -0,0 +1 @@<br class="">
+Subproject commit 0b28d205572c80b568a1003db2c8f37ca333e4d7<br class="">
diff --git a/tests/docker/dockerfiles/centos8.docker b/tests/docker/dockerfiles/centos8.docker<br class="">
index 4b20925bbf..10618bfa83 100644<br class="">
--- a/tests/docker/dockerfiles/centos8.docker<br class="">
+++ b/tests/docker/dockerfiles/centos8.docker<br class="">
@@ -51,6 +51,7 @@ RUN dnf update -y && \<br class="">
        libbpf-devel \<br class="">
        libcacard-devel \<br class="">
        libcap-ng-devel \<br class="">
+        libcmocka-devel \<br class="">
        libcurl-devel \<br class="">
        libdrm-devel \<br class="">
        libepoxy-devel \<br class="">
@@ -59,6 +60,7 @@ RUN dnf update -y && \<br class="">
        libgcrypt-devel \<br class="">
        libiscsi-devel \<br class="">
        libjpeg-devel \<br class="">
+        json-c-devel \<br class="">
        libnfs-devel \<br class="">
        libpmem-devel \<br class="">
        libpng-devel \<br class="">
-- <br class="">
2.36.1<br class="">
<br class="">
</blockquote>
<br class="">
With regards,<br class="">
Daniel<br class="">
-- <br class="">
|: <a href="https://berrange.com" class="">https://berrange.com</a>      -o-    <a href="https://www.flickr.com/photos/dberrange" class="">https://www.flickr.com/photos/dberrange</a> :|<br class="">
|: <a href="https://libvirt.org" class="">https://libvirt.org</a>         -o-            <a href="https://fstop138.berrange.com" class="">https://fstop138.berrange.com</a> :|<br class="">
|: <a href="https://entangle-photo.org" class="">https://entangle-photo.org</a>    -o-    <a href="https://www.instagram.com/dberrange" class="">https://www.instagram.com/dberrange</a> :|<br class="">
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>