From 1b4961c9db01d17a4d5b9682ab39bc9bd0a6540e Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Tue, 25 Feb 2025 09:57:43 +0800 Subject: [PATCH] libs: Change kv of get_agent_kernel_params to BTreeMap HashMap cannot guarantee the order. The command line is always changed. This commit change kv of get_agent_kernel_params to BTreeMap to make sure the command line is not changed. Fixes: #10977 Signed-off-by: Hui Zhu --- src/libs/kata-types/src/config/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/kata-types/src/config/mod.rs b/src/libs/kata-types/src/config/mod.rs index d893c212aa..24f3e617e5 100644 --- a/src/libs/kata-types/src/config/mod.rs +++ b/src/libs/kata-types/src/config/mod.rs @@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 // -use std::collections::HashMap; +use std::collections::{BTreeMap, HashMap}; use std::fs; use std::io::{self, Result}; use std::path::{Path, PathBuf}; @@ -192,8 +192,8 @@ impl TomlConfig { } /// Get agent-specfic kernel parameters for further Hypervisor config revision - pub fn get_agent_kernel_params(&self) -> Result> { - let mut kv = HashMap::new(); + pub fn get_agent_kernel_params(&self) -> Result> { + let mut kv = BTreeMap::new(); if let Some(cfg) = self.agent.get(&self.runtime.agent_name) { if cfg.debug { kv.insert(LOG_LEVEL_OPTION.to_string(), LOG_LEVEL_DEBUG.to_string());