Use vm-memory v0.18.0 for QEMU.

Signed-off-by: Zhao Liu <[email protected]>
---
Changes since v1:
 * Upgrade vm-memory to v0.18.0 then we don't need extra patch for
   vm-memory subproject in QEMU.
---
 scripts/archive-source.sh                     |  1 +
 scripts/make-release                          |  3 ++-
 subprojects/.gitignore                        |  1 +
 .../vm-memory-0.18-rs/meson.build             | 27 +++++++++++++++++++
 subprojects/vm-memory-0.18-rs.wrap            | 10 +++++++
 5 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 subprojects/packagefiles/vm-memory-0.18-rs/meson.build
 create mode 100644 subprojects/vm-memory-0.18-rs.wrap

diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh
index 2f3987fc0fea..a876ec2d3480 100755
--- a/scripts/archive-source.sh
+++ b/scripts/archive-source.sh
@@ -49,6 +49,7 @@ subprojects=(
   syn-2-rs
   thiserror-1-rs
   thiserror-impl-1-rs
+  vm-memory-0.18-rs
   unicode-ident-1-rs
 )
 sub_deinit=""
diff --git a/scripts/make-release b/scripts/make-release
index a5488e226298..c0077aab3643 100755
--- a/scripts/make-release
+++ b/scripts/make-release
@@ -44,7 +44,8 @@ SUBPROJECTS="libvfio-user keycodemapdb berkeley-softfloat-3
   bilge-impl-0.2-rs either-1-rs foreign-0.3-rs itertools-0.11-rs
   libc-0.2-rs probe-0.5-rs proc-macro2-1-rs
   proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs
-  syn-2-rs thiserror-1-rs thiserror-impl-1-rs unicode-ident-1-rs"
+  syn-2-rs thiserror-1-rs thiserror-impl-1-rs unicode-ident-1-rs
+  vm-memory-0.18-rs"
 
 src="$1"
 version="$2"
diff --git a/subprojects/.gitignore b/subprojects/.gitignore
index d7cf421bff07..29d8e26960d5 100644
--- a/subprojects/.gitignore
+++ b/subprojects/.gitignore
@@ -25,6 +25,7 @@
 /thiserror-*
 /thiserror-impl-*
 /unicode-ident-*
+/vm-memory-*
 
 # Workaround for Meson v1.9.0 https://github.com/mesonbuild/meson/issues/14948
 /.wraplock
diff --git a/subprojects/packagefiles/vm-memory-0.18-rs/meson.build 
b/subprojects/packagefiles/vm-memory-0.18-rs/meson.build
new file mode 100644
index 000000000000..2e5d9c50f839
--- /dev/null
+++ b/subprojects/packagefiles/vm-memory-0.18-rs/meson.build
@@ -0,0 +1,27 @@
+project('vm-memory-0.18-rs', 'rust',
+  meson_version: '>=1.5.0',
+  version : '0.18.0',
+  license : 'Apache-2.0 or BSD-3-Clause',
+  default_options: [])
+
+all_deps = []
+
+subproject('thiserror-1-rs', required: true)
+all_deps += dependency('thiserror-1-rs')
+
+_vm_memory_rs = static_library(
+  'vm_memory',
+  files('src/lib.rs'),
+  gnu_symbol_visibility: 'hidden',
+  override_options : ['rust_std=2021', 'build.rust_std=2021'],
+  rust_abi : 'rust',
+  rust_args: ['--cap-lints', 'allow'],
+  dependencies: all_deps,
+  native: true,
+)
+
+dep = declare_dependency(
+  link_with : _vm_memory_rs,
+)
+
+meson.override_dependency('vm-memory-0.18-rs', dep, native: true)
diff --git a/subprojects/vm-memory-0.18-rs.wrap 
b/subprojects/vm-memory-0.18-rs.wrap
new file mode 100644
index 000000000000..299b54d8f799
--- /dev/null
+++ b/subprojects/vm-memory-0.18-rs.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+directory = vm-memory-0.18.0
+source_url = https://crates.io/api/v1/crates/vm-memory/0.18.0/download
+source_filename = vm-memory-0.18.0.tar.gz
+source_hash = 9b55e753c7725603745cb32b2287ef7ef3da05c03c7702cda3fa8abe25ae0465
+#method = cargo
+patch_directory = vm-memory-0.18-rs
+
+# bump this version number on every change to meson.build or the patches:
+# v2
-- 
2.34.1


Reply via email to