@@ -777,7 +777,7 @@ func (ctx kvmContext) Start(domainName string) error {
777
777
return logError ("failed to start domain that is stopped %v" , err )
778
778
}
779
779
780
- if status , err := getQemuStatus (qmpFile ); err != nil || status != "running" {
780
+ if status , err := getQemuStatus (qmpFile ); err != nil || status != types . RUNNING {
781
781
return logError ("domain status is not running but %s after cont command returned %v" , status , err )
782
782
}
783
783
return nil
@@ -811,33 +811,13 @@ func (ctx kvmContext) Info(domainName string) (int, types.SwState, error) {
811
811
return effectiveDomainID , effectiveDomainState , err
812
812
}
813
813
814
- // if task us alive, we augment task status with finer grained details from qemu
815
- // lets parse the status according to https://github.com/qemu/qemu/blob/master/qapi/run-state.json#L8
816
- stateMap := map [string ]types.SwState {
817
- "finish-migrate" : types .PAUSED ,
818
- "inmigrate" : types .PAUSING ,
819
- "paused" : types .PAUSED ,
820
- "postmigrate" : types .PAUSED ,
821
- "prelaunch" : types .PAUSED ,
822
- "restore-vm" : types .PAUSED ,
823
- "running" : types .RUNNING ,
824
- "save-vm" : types .PAUSED ,
825
- "shutdown" : types .HALTING ,
826
- "suspended" : types .PAUSED ,
827
- "watchdog" : types .PAUSING ,
828
- "colo" : types .PAUSED ,
829
- "preconfig" : types .PAUSED ,
830
- }
831
- res , err := getQemuStatus (getQmpExecutorSocket (domainName ))
814
+ _ , err = getQemuStatus (getQmpExecutorSocket (domainName ))
832
815
if err != nil {
833
- return effectiveDomainID , types .BROKEN , logError ("couldn't retrieve status for domain %s: %v" , domainName , err )
816
+ return effectiveDomainID , types .BROKEN ,
817
+ logError ("couldn't retrieve status for domain %s: %v" , domainName , err )
834
818
}
835
819
836
- if effectiveDomainState , matched := stateMap [res ]; ! matched {
837
- return effectiveDomainID , types .BROKEN , logError ("domain %s reported to be in unexpected state %s" , domainName , res )
838
- } else {
839
- return effectiveDomainID , effectiveDomainState , nil
840
- }
820
+ return effectiveDomainID , effectiveDomainState , nil
841
821
}
842
822
843
823
func (ctx kvmContext ) Cleanup (domainName string ) error {
0 commit comments