mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-04 06:27:25 +00:00
Dragonball: update linux_loader to 0.6.0
Since linux-loader 0.4.0 and 0.5.0 is yanked due to null terminator bug, we need to update linux-loader to 0.6.0. And as_str() function should also be changed. fixes: #5253 Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
This commit is contained in:
parent
8a2df6b31c
commit
90ecc015e0
@ -26,7 +26,7 @@ kvm-bindings = "0.5.0"
|
||||
kvm-ioctls = "0.11.0"
|
||||
lazy_static = "1.2"
|
||||
libc = "0.2.39"
|
||||
linux-loader = "0.5.0"
|
||||
linux-loader = "0.6.0"
|
||||
log = "0.4.14"
|
||||
nix = "0.24.2"
|
||||
seccompiler = "0.2.0"
|
||||
|
@ -577,7 +577,13 @@ impl BlockDeviceMgr {
|
||||
) -> std::result::Result<(), DeviceMgrError> {
|
||||
// Respect user configuration if kernel_cmdline contains "root=",
|
||||
// special attention for the case when kernel command line starting with "root=xxx"
|
||||
let old_kernel_cmdline = format!(" {}", kernel_config.kernel_cmdline().as_str());
|
||||
let old_kernel_cmdline = format!(
|
||||
" {:?}",
|
||||
kernel_config
|
||||
.kernel_cmdline()
|
||||
.as_cstring()
|
||||
.map_err(DeviceMgrError::Cmdline)?
|
||||
);
|
||||
if !old_kernel_cmdline.contains(" root=") && self.has_root_block {
|
||||
let cmdline = kernel_config.kernel_cmdline_mut();
|
||||
if let Some(ref uuid) = self.part_uuid {
|
||||
|
@ -127,6 +127,10 @@ pub enum StartMicroVmError {
|
||||
#[error("failure while configuring guest kernel commandline: {0}")]
|
||||
LoadCommandline(#[source] linux_loader::loader::Error),
|
||||
|
||||
/// Cannot process command line string.
|
||||
#[error("failure while processing guest kernel commandline: {0}.")]
|
||||
ProcessCommandlne(#[source] linux_loader::cmdline::Error),
|
||||
|
||||
/// The device manager was not configured.
|
||||
#[error("the device manager failed to manage devices: {0}")]
|
||||
DeviceManager(#[source] device_manager::DeviceMgrError),
|
||||
|
@ -217,11 +217,17 @@ impl Vm {
|
||||
linux_loader::loader::load_cmdline(vm_memory, cmdline_addr, cmdline)
|
||||
.map_err(StartMicroVmError::LoadCommandline)?;
|
||||
|
||||
let cmdline_size = cmdline
|
||||
.as_cstring()
|
||||
.map_err(StartMicroVmError::ProcessCommandlne)?
|
||||
.as_bytes_with_nul()
|
||||
.len();
|
||||
|
||||
configure_system(
|
||||
vm_memory,
|
||||
self.address_space.address_space(),
|
||||
cmdline_addr,
|
||||
cmdline.as_str().len() + 1,
|
||||
cmdline_size,
|
||||
&initrd,
|
||||
self.vm_config.vcpu_count,
|
||||
self.vm_config.max_vcpu_count,
|
||||
|
Loading…
Reference in New Issue
Block a user