Skip to content

Commit

Permalink
fix: fscache and virtio fail to start
Browse files Browse the repository at this point in the history
State machine is turned on arriving 'RUNNING' via 'READY', instead from
'INIT' to 'RUNNING' directly. The virtio and fscache miss the trigger
from 'INIT' to 'READY', still trying to transfer from 'INIT' to
'RUNNING' which is old fashion. So this patch add additional
transformation.
  • Loading branch information
泰友 committed Jun 2, 2022
1 parent 61f0c3f commit 1f7756f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bin/nydusd/service_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ pub fn create_daemon(subargs: &SubCmdArgs, bti: BuildTimeInfo) -> Result<Arc<dyn
let daemon = Arc::new(service_controller);
let machine = DaemonStateMachineContext::new(daemon.clone(), from_client, to_client);
machine.kick_state_machine()?;
daemon
.on_event(DaemonStateMachineInput::Mount)
.map_err(|e| eother!(e))?;
daemon
.on_event(DaemonStateMachineInput::Start)
.map_err(|e| eother!(e))?;
Expand Down
3 changes: 3 additions & 0 deletions src/bin/nydusd/virtiofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ pub fn create_virtiofs_daemon(
if let Some(cmd) = mount_cmd {
daemon.service.mount(cmd)?;
}
daemon
.on_event(DaemonStateMachineInput::Mount)
.map_err(|e| eother!(e))?;
daemon
.on_event(DaemonStateMachineInput::Start)
.map_err(|e| eother!(e))?;
Expand Down

0 comments on commit 1f7756f

Please sign in to comment.