[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 03/11] rust: Add some block layer bindings
From: |
Kevin Wolf |
Subject: |
[PATCH v2 03/11] rust: Add some block layer bindings |
Date: |
Tue, 18 Feb 2025 19:20:11 +0100 |
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 --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);
--
2.48.1