From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 1196C1FF0AF for ; Thu, 08 Oct 2026 08:52:53 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9DA9E214DD; Thu, 08 Oct 2026 08:52:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jing.rocks; h=cc :cc:content-transfer-encoding:date:from:from:message-id :mime-version:reply-to:subject:subject:to:to; s=mail-gw; bh=3AoU 1HAjqnh1RooNvJ6vSdaIOuxxAFHUlbXzXCLwEQg=; b=XU7/YQsKV/d8DVCr8DUo bdNGl+zYp+aYDoH/nfLUstUPktd8BtKyC/mCCC+WB3uk4lS/TtpCxza9Y+SMuXsz mkYQ7QFVcsGHzObukKAC206a8PZlaP16ApGC3vLfttMtP2pOzFC3EmH7fjY9LU3k E/uWefxZ5tSaYMLak/NDnmSDk1yuY7I2+PXKwN3cQPBRf5Jvr5AdOle4clSwZ5AM aEmh7gd3Qu1ss11pcnpLZX+TYE2i1O27LdJn2ybLJR79OO3R9jB5LZSGHPQ/D4fV T/gFPPRW8eoDsd3lwxEbUwShjKyXTEM0dkvMdkXneMKNVta4OGUDzm5tatv7rISY BQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=jing.rocks; s=default; t=1791442334; bh=DKgk23bhPjFf6SF1nRl8jlN0efGPIqO+BKweNLGt4oE=; h=From:To:Cc:Subject:Date:From; b=mVLTa/JjCeISU5Jcrlh2WArv1xQwy1ACQ3qBKJGNb8YRouCQ9ZRW0PThdu3XTFTqL 7+S12OJ9xM3+3YU9s75KOBBC0jLyh14zhw3TQ58vwSBYz6EDlbstxQJJBushM/eR9A faz/xt+YYMpXEwcltgHrVVGzs49fdv+3Im2WwCk5rAs1pN1HuQDAz0iSVpFk8FXpC4 xCQIYionug+Hr7Fjxlc7gzE8pAmsLfTdN940AegGQsjeXh07XqKFm9CHr79JxjqRZ4 P1ygR9A2HX125AtXP5CI53A6yWAsFz4VRjtXZQiO4B+iIVl2/57pJumYgOa7NOefXF wXyWcoVDAT8iQ== From: Luke Yasuda To: pve-devel@lists.proxmox.com Subject: [PATCH 1/3 proxmox-rrd-migration-tool] use libc::c_char instead of i8 to fix mismatched type Date: Thu, 8 Oct 2026 15:48:43 +0900 Message-ID: <20261008065200.1686526-1-jing@jing.rocks> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy KAM_INFOUSMEBIZ 0.75 Prevalent use of .info|.us|.me|.me.uk|.biz|xyz|id|rocks|life domains in spam/malware KAM_OTHER_BAD_TLD 0.75 Other untrustworthy TLDs SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: GUC3R5REVH3KKYFNHOEBM7NSOGR2X5GL X-Message-ID-Hash: GUC3R5REVH3KKYFNHOEBM7NSOGR2X5GL X-MailFrom: jing@jing.rocks X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Luke Yasuda X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Otherwise this fails on non-amd64 arches: error[E0308]: mismatched types --> src/main.rs:374:17 | 374 | source[0] = file.0.as_ptr(); | --------- ^^^^^^^^^^^^^^^ expected `*const i8`, found `*const u8` | | | expected due to the type of this binding | = note: expected raw pointer `*const i8` found raw pointer `*const u8` error[E0308]: mismatched types --> src/main.rs:386:13 | 381 | let res = rrd_create_r2( | ------------- arguments to this function are incorrect ... 386 | source.as_mut_ptr(), | ^^^^^^^^^^^^^^^^^^^ expected `*mut *const u8`, found `*mut *const i8` | = note: expected raw pointer `*mut *const u8` found raw pointer `*mut *const i8` Signed-off-by: Luke Yasuda --- Cargo.toml | 1 + src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4574e32..a637278 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ anyhow = "1" pico-args = "0.5" proxmox-async = "0.5" crossbeam-channel = "0.5" +libc = "0.2" [build-dependencies] bindgen = "0.71" diff --git a/src/main.rs b/src/main.rs index 799cde8..b2b9bbe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,7 @@ use std::{ }; use anyhow::{bail, Context, Error, Result}; +use libc::c_char; use proxmox_rrd_migration_tool::{rrd_clear_error, rrd_create_r2, rrd_get_context, rrd_get_error}; @@ -370,7 +371,7 @@ fn do_rrd_migration( bail!("refusing to migrate metrics for {resource:?} - target already exists and 'force' not set!"); } - let mut source: [*const i8; 2] = [std::ptr::null(); 2]; + let mut source: [*const libc::c_char; 2] = [std::ptr::null(); 2]; source[0] = file.0.as_ptr(); let target_path = CString::new(target_path.to_str().unwrap()).unwrap(); -- 2.56.0