mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-30 01:02:33 +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
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
fn generate_kernel_boot_args(&mut self, kernel_config: &mut KernelConfigInfo) -> Result<()> {
|
||||
if !self.is_hotplug {
|
||||
if self.is_hotplug {
|
||||
return Err(DeviceMgrError::InvalidOperation);
|
||||
}
|
||||
|
||||
#[cfg(feature = "dbs-virtio-devices")]
|
||||
{
|
||||
let cmdline = kernel_config.kernel_cmdline_mut();
|
||||
|
||||
#[cfg(feature = "dbs-virtio-devices")]
|
||||
for device in self.virtio_devices.iter() {
|
||||
let (mmio_base, mmio_size, irq) = DeviceManager::get_virtio_device_info(device)?;
|
||||
|
||||
@ -275,6 +276,7 @@ impl DeviceOpContext {
|
||||
)
|
||||
.map_err(DeviceMgrError::Cmdline)?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user