Skip to content

Commit

Permalink
Show starting state when machine is starting
Browse files Browse the repository at this point in the history
Currently podman machine list never shows the starting state.

Fixes: containers#14738

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Jun 27, 2022
1 parent 1022ea3 commit 386ea49
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/machine/qemu/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,7 @@ func getVMInfos() ([]*machine.ListResponse, error) {
listEntry.RemoteUsername = vm.RemoteUsername
listEntry.IdentityPath = vm.IdentityPath
listEntry.CreatedAt = vm.Created
listEntry.Starting = vm.Starting

if listEntry.CreatedAt.IsZero() {
listEntry.CreatedAt = time.Now()
Expand All @@ -1087,6 +1088,7 @@ func getVMInfos() ([]*machine.ListResponse, error) {
if err != nil {
return err
}
listEntry.Running = state == machine.Running

if !vm.LastUp.IsZero() { // this means we have already written a time to the config
listEntry.LastUp = vm.LastUp
Expand All @@ -1097,12 +1099,6 @@ func getVMInfos() ([]*machine.ListResponse, error) {
return err
}
}
switch state {
case machine.Running:
listEntry.Running = true
case machine.Starting:
listEntry.Starting = true
}

listed = append(listed, listEntry)
}
Expand Down

0 comments on commit 386ea49

Please sign in to comment.