qemu-rust
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 03/11] rust: Add some block layer bindings


From: Paolo Bonzini
Subject: Re: [PATCH 03/11] rust: Add some block layer bindings
Date: Wed, 12 Feb 2025 10:29:36 +0100
User-agent: Mozilla Thunderbird

On 2/11/25 22:43, Kevin Wolf wrote:
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',

I've got some errno bindings that I wrote for chardev, I'll send them shortly.

Paolo

      '--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);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]