* [PATCH] rust: remove useless glib_sys bindings
@ 2025-10-16 14:56 Paolo Bonzini
2025-10-20 6:03 ` Zhao Liu
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2025-10-16 14:56 UTC (permalink / raw)
To: qemu-devel; +Cc: mkletzan, marcandre.lureau, qemu-rust
From: Martin Kletzander <mkletzan@redhat.com>
The definition of types needed for g_autolist(), g_autoslist(),
g_autoqueue() need the imports for GList, GSList and GQueue
to appear everything. Rust code is never going to see those,
since they are not used in structs. Block the types from
appearing in the bindings.
Co-authored-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 1 +
rust/bql/src/bindings.rs | 2 +-
rust/chardev/src/bindings.rs | 4 ++--
rust/hw/char/pl011/src/bindings.rs | 2 +-
rust/hw/core/src/bindings.rs | 2 +-
rust/migration/src/bindings.rs | 2 +-
rust/qom/src/bindings.rs | 2 +-
rust/system/src/bindings.rs | 2 +-
rust/util/src/bindings.rs | 2 +-
9 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/meson.build b/meson.build
index 25813490d22..6cb85b173d0 100644
--- a/meson.build
+++ b/meson.build
@@ -4255,6 +4255,7 @@ if have_rust
'--allowlist-file', meson.project_source_root() + '/include/.*',
'--allowlist-file', meson.project_build_root() + '/.*',
'--blocklist-file', glib_pc.get_variable('includedir') + '/glib-2.0/.*',
+ '--blocklist-type', '.*_([a-z]*autoptr)$',
]
if not rustfmt.found()
if bindgen.version().version_compare('<0.65.0')
diff --git a/rust/bql/src/bindings.rs b/rust/bql/src/bindings.rs
index 8c70f3a87ce..efd76790fb2 100644
--- a/rust/bql/src/bindings.rs
+++ b/rust/bql/src/bindings.rs
@@ -19,7 +19,7 @@
)]
use glib_sys::{
- guint, GArray, GHashTable, GHashTableIter, GList, GPollFD, GPtrArray, GQueue, GSList, GSource,
+ guint, GArray, GHashTable, GHashTableIter, GPollFD, GPtrArray, GSList, GSource,
};
#[cfg(MESON)]
diff --git a/rust/chardev/src/bindings.rs b/rust/chardev/src/bindings.rs
index c95dc89c56d..6447c72b7e3 100644
--- a/rust/chardev/src/bindings.rs
+++ b/rust/chardev/src/bindings.rs
@@ -20,8 +20,8 @@
use common::Zeroable;
use glib_sys::{
- gboolean, guint, GArray, GHashTable, GHashTableIter, GIOCondition, GList, GMainContext,
- GPollFD, GPtrArray, GQueue, GSList, GSource, GSourceFunc,
+ gboolean, guint, GArray, GHashTable, GHashTableIter, GIOCondition, GMainContext,
+ GPollFD, GPtrArray, GSList, GSource, GSourceFunc,
};
#[cfg(MESON)]
diff --git a/rust/hw/char/pl011/src/bindings.rs b/rust/hw/char/pl011/src/bindings.rs
index 52a76d0de5c..654be9185b1 100644
--- a/rust/hw/char/pl011/src/bindings.rs
+++ b/rust/hw/char/pl011/src/bindings.rs
@@ -22,7 +22,7 @@
use glib_sys::{
gboolean, guint, GArray, GByteArray, GHashTable, GHashTableIter, GIOCondition, GList,
- GMainContext, GPollFD, GPtrArray, GQueue, GSList, GSource, GSourceFunc, GString,
+ GMainContext, GPollFD, GPtrArray, GSList, GSource, GSourceFunc, GString,
};
#[cfg(MESON)]
diff --git a/rust/hw/core/src/bindings.rs b/rust/hw/core/src/bindings.rs
index 65b9aae7536..dd334944600 100644
--- a/rust/hw/core/src/bindings.rs
+++ b/rust/hw/core/src/bindings.rs
@@ -21,7 +21,7 @@
use chardev::bindings::Chardev;
use common::Zeroable;
use glib_sys::{
- GArray, GByteArray, GHashTable, GHashTableIter, GList, GPtrArray, GQueue, GSList, GString,
+ GArray, GByteArray, GHashTable, GHashTableIter, GList, GPtrArray, GSList, GString,
};
use migration::bindings::VMStateDescription;
use qom::bindings::ObjectClass;
diff --git a/rust/migration/src/bindings.rs b/rust/migration/src/bindings.rs
index 24503eb69bd..e9c058386c2 100644
--- a/rust/migration/src/bindings.rs
+++ b/rust/migration/src/bindings.rs
@@ -19,7 +19,7 @@
)]
use common::Zeroable;
-use glib_sys::{GHashTable, GHashTableIter, GList, GPtrArray, GQueue, GSList};
+use glib_sys::{GHashTable, GHashTableIter, GPtrArray, GSList};
#[cfg(MESON)]
include!("bindings.inc.rs");
diff --git a/rust/qom/src/bindings.rs b/rust/qom/src/bindings.rs
index 91de42f2426..e61259ec2ef 100644
--- a/rust/qom/src/bindings.rs
+++ b/rust/qom/src/bindings.rs
@@ -18,7 +18,7 @@
clippy::too_many_arguments
)]
-use glib_sys::{GHashTable, GHashTableIter, GList, GPtrArray, GQueue, GSList};
+use glib_sys::{GHashTable, GHashTableIter, GPtrArray, GSList};
#[cfg(MESON)]
include!("bindings.inc.rs");
diff --git a/rust/system/src/bindings.rs b/rust/system/src/bindings.rs
index 6cbb588de3d..2a5ba43c4f1 100644
--- a/rust/system/src/bindings.rs
+++ b/rust/system/src/bindings.rs
@@ -20,7 +20,7 @@
use common::Zeroable;
use glib_sys::{
- guint, GArray, GByteArray, GHashTable, GHashTableIter, GList, GPollFD, GPtrArray, GQueue,
+ guint, GArray, GByteArray, GHashTable, GHashTableIter, GList, GPollFD, GPtrArray,
GSList, GString,
};
diff --git a/rust/util/src/bindings.rs b/rust/util/src/bindings.rs
index c277a295add..3514a66f5fa 100644
--- a/rust/util/src/bindings.rs
+++ b/rust/util/src/bindings.rs
@@ -18,7 +18,7 @@
clippy::too_many_arguments
)]
-use glib_sys::{guint, GList, GPollFD, GQueue, GSList, GString};
+use glib_sys::{guint, GPollFD, GString};
#[cfg(MESON)]
include!("bindings.inc.rs");
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rust: remove useless glib_sys bindings
2025-10-16 14:56 [PATCH] rust: remove useless glib_sys bindings Paolo Bonzini
@ 2025-10-20 6:03 ` Zhao Liu
0 siblings, 0 replies; 2+ messages in thread
From: Zhao Liu @ 2025-10-20 6:03 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, mkletzan, marcandre.lureau, qemu-rust
On Thu, Oct 16, 2025 at 04:56:19PM +0200, Paolo Bonzini wrote:
> Date: Thu, 16 Oct 2025 16:56:19 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH] rust: remove useless glib_sys bindings
> X-Mailer: git-send-email 2.51.0
>
> From: Martin Kletzander <mkletzan@redhat.com>
>
> The definition of types needed for g_autolist(), g_autoslist(),
> g_autoqueue() need the imports for GList, GSList and GQueue
> to appear everything. Rust code is never going to see those,
> since they are not used in structs. Block the types from
> appearing in the bindings.
>
> Co-authored-by: Martin Kletzander <mkletzan@redhat.com>
> Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> meson.build | 1 +
> rust/bql/src/bindings.rs | 2 +-
> rust/chardev/src/bindings.rs | 4 ++--
> rust/hw/char/pl011/src/bindings.rs | 2 +-
> rust/hw/core/src/bindings.rs | 2 +-
> rust/migration/src/bindings.rs | 2 +-
> rust/qom/src/bindings.rs | 2 +-
> rust/system/src/bindings.rs | 2 +-
> rust/util/src/bindings.rs | 2 +-
> 9 files changed, 10 insertions(+), 9 deletions(-)
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-20 5:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-16 14:56 [PATCH] rust: remove useless glib_sys bindings Paolo Bonzini
2025-10-20 6:03 ` Zhao Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).