mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-29 00:37:24 +00:00
Merge pull request #9571 from emanuellima1/fix-impl-rtc
runtime-rs: Fix constructing the RTC struct
This commit is contained in:
commit
e2117d3b71
@ -1212,7 +1212,6 @@ pub struct QemuCmdLine<'a> {
|
|||||||
smp: Smp,
|
smp: Smp,
|
||||||
machine: Machine,
|
machine: Machine,
|
||||||
cpu: Cpu,
|
cpu: Cpu,
|
||||||
rtc: Rtc,
|
|
||||||
|
|
||||||
knobs: Knobs,
|
knobs: Knobs,
|
||||||
|
|
||||||
@ -1229,7 +1228,6 @@ impl<'a> QemuCmdLine<'a> {
|
|||||||
smp: Smp::new(config),
|
smp: Smp::new(config),
|
||||||
machine: Machine::new(config),
|
machine: Machine::new(config),
|
||||||
cpu: Cpu::new(config),
|
cpu: Cpu::new(config),
|
||||||
rtc: Rtc::new(),
|
|
||||||
knobs: Knobs::new(config),
|
knobs: Knobs::new(config),
|
||||||
devices: Vec::new(),
|
devices: Vec::new(),
|
||||||
};
|
};
|
||||||
@ -1238,9 +1236,16 @@ impl<'a> QemuCmdLine<'a> {
|
|||||||
qemu_cmd_line.add_iommu();
|
qemu_cmd_line.add_iommu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qemu_cmd_line.add_rtc();
|
||||||
|
|
||||||
Ok(qemu_cmd_line)
|
Ok(qemu_cmd_line)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn add_rtc(&mut self) {
|
||||||
|
let rtc = Rtc::new();
|
||||||
|
self.devices.push(Box::new(rtc));
|
||||||
|
}
|
||||||
|
|
||||||
fn bus_type(&self) -> VirtioBusType {
|
fn bus_type(&self) -> VirtioBusType {
|
||||||
if self.config.machine_info.machine_type.contains("-ccw-") {
|
if self.config.machine_info.machine_type.contains("-ccw-") {
|
||||||
VirtioBusType::Ccw
|
VirtioBusType::Ccw
|
||||||
@ -1432,7 +1437,6 @@ impl<'a> QemuCmdLine<'a> {
|
|||||||
result.append(&mut self.machine.qemu_params().await?);
|
result.append(&mut self.machine.qemu_params().await?);
|
||||||
result.append(&mut self.cpu.qemu_params().await?);
|
result.append(&mut self.cpu.qemu_params().await?);
|
||||||
result.append(&mut self.memory.qemu_params().await?);
|
result.append(&mut self.memory.qemu_params().await?);
|
||||||
result.append(&mut self.rtc.qemu_params().await?);
|
|
||||||
|
|
||||||
for device in &self.devices {
|
for device in &self.devices {
|
||||||
result.append(&mut device.qemu_params().await?);
|
result.append(&mut device.qemu_params().await?);
|
||||||
|
Loading…
Reference in New Issue
Block a user