@@ -913,7 +913,7 @@ func (ctx KvmContext) Start(domainName string) error {
913
913
return logError ("failed to start domain that is stopped %v" , err )
914
914
}
915
915
916
- if status , err := getQemuStatus (qmpFile ); err != nil || status != "running" {
916
+ if status , err := getQemuStatus (qmpFile ); err != nil || status != types . RUNNING {
917
917
return logError ("domain status is not running but %s after cont command returned %v" , status , err )
918
918
}
919
919
return nil
@@ -950,33 +950,13 @@ func (ctx KvmContext) Info(domainName string) (int, types.SwState, error) {
950
950
return effectiveDomainID , effectiveDomainState , err
951
951
}
952
952
953
- // if task us alive, we augment task status with finer grained details from qemu
954
- // lets parse the status according to https://github.com/qemu/qemu/blob/master/qapi/run-state.json#L8
955
- stateMap := map [string ]types.SwState {
956
- "finish-migrate" : types .PAUSED ,
957
- "inmigrate" : types .PAUSING ,
958
- "paused" : types .PAUSED ,
959
- "postmigrate" : types .PAUSED ,
960
- "prelaunch" : types .PAUSED ,
961
- "restore-vm" : types .PAUSED ,
962
- "running" : types .RUNNING ,
963
- "save-vm" : types .PAUSED ,
964
- "shutdown" : types .HALTING ,
965
- "suspended" : types .PAUSED ,
966
- "watchdog" : types .PAUSING ,
967
- "colo" : types .PAUSED ,
968
- "preconfig" : types .PAUSED ,
969
- }
970
- res , err := getQemuStatus (GetQmpExecutorSocket (domainName ))
953
+ _ , err = getQemuStatus (GetQmpExecutorSocket (domainName ))
971
954
if err != nil {
972
- return effectiveDomainID , types .BROKEN , logError ("couldn't retrieve status for domain %s: %v" , domainName , err )
955
+ return effectiveDomainID , types .BROKEN ,
956
+ logError ("couldn't retrieve status for domain %s: %v" , domainName , err )
973
957
}
974
958
975
- if effectiveDomainState , matched := stateMap [res ]; ! matched {
976
- return effectiveDomainID , types .BROKEN , logError ("domain %s reported to be in unexpected state %s" , domainName , res )
977
- } else {
978
- return effectiveDomainID , effectiveDomainState , nil
979
- }
959
+ return effectiveDomainID , effectiveDomainState , nil
980
960
}
981
961
982
962
// Cleanup cleans up a domain
0 commit comments