[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/11] rust: Add some block layer bindings
From: |
Kevin Wolf |
Subject: |
[PATCH 03/11] rust: Add some block layer bindings |
Date: |
Tue, 11 Feb 2025 22:43:20 +0100 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
rust/wrapper.h | 4 ++++
meson.build | 1 +
rust/qemu-api/src/zeroable.rs | 5 +++--
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/rust/wrapper.h b/rust/wrapper.h
index 41be87adcf..c3e1e6f9cf 100644
--- a/rust/wrapper.h
+++ b/rust/wrapper.h
@@ -53,3 +53,7 @@ typedef enum memory_order {
#include "chardev/char-fe.h"
#include "qapi/error.h"
#include "chardev/char-serial.h"
+#include "block/block.h"
+#include "block/block_int.h"
+#include "block/qdict.h"
+#include "qapi/qapi-visit-block-core.h"
diff --git a/meson.build b/meson.build
index 30aae6b3c3..154195bc80 100644
--- a/meson.build
+++ b/meson.build
@@ -4045,6 +4045,7 @@ if have_rust
'--with-derive-default',
'--no-layout-tests',
'--no-prepend-enum-name',
+ '--allowlist-item', 'EINVAL|EIO',
'--allowlist-file', meson.project_source_root() + '/include/.*',
'--allowlist-file', meson.project_source_root() + '/.*',
'--allowlist-file', meson.project_build_root() + '/.*'
diff --git a/rust/qemu-api/src/zeroable.rs b/rust/qemu-api/src/zeroable.rs
index b454e9e05e..60af681293 100644
--- a/rust/qemu-api/src/zeroable.rs
+++ b/rust/qemu-api/src/zeroable.rs
@@ -56,7 +56,6 @@ pub unsafe trait Zeroable: Default {
/// ## Differences with `core::mem::zeroed`
///
/// `const_zero` zeroes padding bits, while `core::mem::zeroed` doesn't
-#[allow(unused)]
macro_rules! const_zero {
// This macro to produce a type-generic zero constant is taken from the
// const_zero crate (v0.1.1):
@@ -78,7 +77,6 @@ union TypeAsBytes {
}
/// A wrapper to implement the `Zeroable` trait through the `const_zero` macro.
-#[allow(unused)]
macro_rules! impl_zeroable {
($type:ty) => {
unsafe impl Zeroable for $type {
@@ -110,3 +108,6 @@ fn default() -> Self {
impl_zeroable!(crate::bindings::MemoryRegionOps__bindgen_ty_1);
#[cfg(feature = "system")]
impl_zeroable!(crate::bindings::MemoryRegionOps__bindgen_ty_2);
+
+impl_zeroable!(crate::bindings::BlockDriver);
+impl_zeroable!(crate::bindings::BlockDriver__bindgen_ty_1);
--
2.48.1
- [PATCH 10/11] bochs-rs: Add bochs block driver reimplementation in Rust, (continued)
[PATCH 07/11] block: Add bdrv_open_blockdev_ref_file(), Kevin Wolf, 2025/02/11
[PATCH 03/11] rust: Add some block layer bindings,
Kevin Wolf <=
- Re: [PATCH 03/11] rust: Add some block layer bindings, Paolo Bonzini, 2025/02/12
- Re: [PATCH 03/11] rust: Add some block layer bindings, Kevin Wolf, 2025/02/12
- Re: [PATCH 03/11] rust: Add some block layer bindings, Paolo Bonzini, 2025/02/12
- Re: [PATCH 03/11] rust: Add some block layer bindings, Kevin Wolf, 2025/02/12
- Re: [PATCH 03/11] rust: Add some block layer bindings, Paolo Bonzini, 2025/02/12
- Re: [PATCH 03/11] rust: Add some block layer bindings, Kevin Wolf, 2025/02/12
- Re: [PATCH 03/11] rust: Add some block layer bindings, Paolo Bonzini, 2025/02/13
[PATCH 05/11] rust/block: Add empty crate, Kevin Wolf, 2025/02/11
[PATCH 11/11] rust/block: Add format probing, Kevin Wolf, 2025/02/11
[PATCH 04/11] rust/qemu-api: Add wrappers to run futures in QEMU, Kevin Wolf, 2025/02/11