From 75871d88d3ddf310dd5ffb1d36c8476959692726 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 29 Sep 2025 17:49:35 +0200 Subject: log: change qemu_loglevel to unsigned MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bindgen makes the LOG_* constants unsigned, even if they are defined as (1 << 15): pub const LOG_TRACE: u32 = 32768; Make them unsigned in C as well through the BIT() macro, and also change the type of the variable that they are used with. Reviewed-by: Manos Pitsidianakis Reviewed-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini Message-ID: <20250929154938.594389-14-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi --- rust/util/src/log.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rust/util/src/log.rs') diff --git a/rust/util/src/log.rs b/rust/util/src/log.rs index af9a3e9123..0a4bc4249a 100644 --- a/rust/util/src/log.rs +++ b/rust/util/src/log.rs @@ -142,7 +142,7 @@ macro_rules! log_mask_ln { let _: $crate::log::Log = $mask; if unsafe { - ($crate::bindings::qemu_loglevel & ($mask as std::os::raw::c_int)) != 0 + ($crate::bindings::qemu_loglevel & ($mask as std::os::raw::c_uint)) != 0 } { _ = $crate::log::LogGuard::log_fmt( format_args!("{}\n", format_args!($fmt $($args)*))); -- cgit 1.4.1