dragonball: fix a bug when generating kernel boot args
We should refuse to generate boot args when hotplugging, not cold starting.
@@ -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(())
}
