diff mbox series

[v2,03/11] rust: Add some block layer bindings

Message ID 20250218182019.111467-4-kwolf@redhat.com (mailing list archive)
State New
Headers show
Series rust/block: Add minimal block driver bindings | expand

Commit Message

Kevin Wolf Feb. 18, 2025, 6:20 p.m. UTC
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 rust/wrapper.h                | 4 ++++
 rust/qemu-api/src/zeroable.rs | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/rust/wrapper.h b/rust/wrapper.h
index f203fd13ac..303d7bba7f 100644
--- a/rust/wrapper.h
+++ b/rust/wrapper.h
@@ -54,3 +54,7 @@  typedef enum memory_order {
 #include "qapi/error.h"
 #include "chardev/char-serial.h"
 #include "qemu/timer.h"
+#include "block/block.h"
+#include "block/block_int.h"
+#include "block/qdict.h"
+#include "qapi/qapi-visit-block-core.h"
diff --git a/rust/qemu-api/src/zeroable.rs b/rust/qemu-api/src/zeroable.rs
index bec5093366..4e1e54cf57 100644
--- a/rust/qemu-api/src/zeroable.rs
+++ b/rust/qemu-api/src/zeroable.rs
@@ -58,7 +58,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_export]
 macro_rules! const_zero {
     // This macro to produce a type-generic zero constant is taken from the
@@ -81,7 +80,6 @@  union TypeAsBytes {
 }
 
 /// A wrapper to implement the `Zeroable` trait through the `const_zero` macro.
-#[allow(unused)]
 #[macro_export]
 macro_rules! impl_zeroable {
     ($type:ty) => {
@@ -111,3 +109,6 @@  fn default() -> Self {
     impl_zeroable!(crate::bindings::MemoryRegionOps);
     impl_zeroable!(crate::bindings::MemTxAttrs);
 }
+
+impl_zeroable!(crate::bindings::BlockDriver);
+impl_zeroable!(crate::bindings::BlockDriver__bindgen_ty_1);