mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-01 05:04:26 +00:00
dragonball: fix a bug when generating kernel boot args
We should refuse to generate boot args when hotplugging, not cold starting. Signed-off-by: Zizheng Bian <zizheng.bian@linux.alibaba.com>
This commit is contained in:
parent
2aedd4d12a
commit
8bb00a3dc8
@ -251,15 +251,16 @@ impl DeviceOpContext {
|
|||||||
&self.logger
|
&self.logger
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
fn generate_kernel_boot_args(&mut self, kernel_config: &mut KernelConfigInfo) -> Result<()> {
|
fn generate_kernel_boot_args(&mut self, kernel_config: &mut KernelConfigInfo) -> Result<()> {
|
||||||
if !self.is_hotplug {
|
if self.is_hotplug {
|
||||||
return Err(DeviceMgrError::InvalidOperation);
|
return Err(DeviceMgrError::InvalidOperation);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "dbs-virtio-devices")]
|
#[cfg(feature = "dbs-virtio-devices")]
|
||||||
|
{
|
||||||
let cmdline = kernel_config.kernel_cmdline_mut();
|
let cmdline = kernel_config.kernel_cmdline_mut();
|
||||||
|
|
||||||
#[cfg(feature = "dbs-virtio-devices")]
|
|
||||||
for device in self.virtio_devices.iter() {
|
for device in self.virtio_devices.iter() {
|
||||||
let (mmio_base, mmio_size, irq) = DeviceManager::get_virtio_device_info(device)?;
|
let (mmio_base, mmio_size, irq) = DeviceManager::get_virtio_device_info(device)?;
|
||||||
|
|
||||||
@ -275,6 +276,7 @@ impl DeviceOpContext {
|
|||||||
)
|
)
|
||||||
.map_err(DeviceMgrError::Cmdline)?;
|
.map_err(DeviceMgrError::Cmdline)?;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user