mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-05 06:57:26 +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"
|
kvm-ioctls = "0.11.0"
|
||||||
lazy_static = "1.2"
|
lazy_static = "1.2"
|
||||||
libc = "0.2.39"
|
libc = "0.2.39"
|
||||||
linux-loader = "0.5.0"
|
linux-loader = "0.6.0"
|
||||||
log = "0.4.14"
|
log = "0.4.14"
|
||||||
nix = "0.24.2"
|
nix = "0.24.2"
|
||||||
seccompiler = "0.2.0"
|
seccompiler = "0.2.0"
|
||||||
|
@ -577,7 +577,13 @@ impl BlockDeviceMgr {
|
|||||||
) -> std::result::Result<(), DeviceMgrError> {
|
) -> std::result::Result<(), DeviceMgrError> {
|
||||||
// Respect user configuration if kernel_cmdline contains "root=",
|
// Respect user configuration if kernel_cmdline contains "root=",
|
||||||
// special attention for the case when kernel command line starting with "root=xxx"
|
// 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 {
|
if !old_kernel_cmdline.contains(" root=") && self.has_root_block {
|
||||||
let cmdline = kernel_config.kernel_cmdline_mut();
|
let cmdline = kernel_config.kernel_cmdline_mut();
|
||||||
if let Some(ref uuid) = self.part_uuid {
|
if let Some(ref uuid) = self.part_uuid {
|
||||||
|
@ -127,6 +127,10 @@ pub enum StartMicroVmError {
|
|||||||
#[error("failure while configuring guest kernel commandline: {0}")]
|
#[error("failure while configuring guest kernel commandline: {0}")]
|
||||||
LoadCommandline(#[source] linux_loader::loader::Error),
|
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.
|
/// The device manager was not configured.
|
||||||
#[error("the device manager failed to manage devices: {0}")]
|
#[error("the device manager failed to manage devices: {0}")]
|
||||||
DeviceManager(#[source] device_manager::DeviceMgrError),
|
DeviceManager(#[source] device_manager::DeviceMgrError),
|
||||||
|
@ -217,11 +217,17 @@ impl Vm {
|
|||||||
linux_loader::loader::load_cmdline(vm_memory, cmdline_addr, cmdline)
|
linux_loader::loader::load_cmdline(vm_memory, cmdline_addr, cmdline)
|
||||||
.map_err(StartMicroVmError::LoadCommandline)?;
|
.map_err(StartMicroVmError::LoadCommandline)?;
|
||||||
|
|
||||||
|
let cmdline_size = cmdline
|
||||||
|
.as_cstring()
|
||||||
|
.map_err(StartMicroVmError::ProcessCommandlne)?
|
||||||
|
.as_bytes_with_nul()
|
||||||
|
.len();
|
||||||
|
|
||||||
configure_system(
|
configure_system(
|
||||||
vm_memory,
|
vm_memory,
|
||||||
self.address_space.address_space(),
|
self.address_space.address_space(),
|
||||||
cmdline_addr,
|
cmdline_addr,
|
||||||
cmdline.as_str().len() + 1,
|
cmdline_size,
|
||||||
&initrd,
|
&initrd,
|
||||||
self.vm_config.vcpu_count,
|
self.vm_config.vcpu_count,
|
||||||
self.vm_config.max_vcpu_count,
|
self.vm_config.max_vcpu_count,
|
||||||
|
Loading…
Reference in New Issue
Block a user