Skip to content

Commit

Permalink
use libvirt getJobInfo for live migration tracking
Browse files Browse the repository at this point in the history
Signed-off-by: Vladik Romanovsky <[email protected]>
  • Loading branch information
vladikr committed Mar 1, 2019
1 parent 705fa3c commit 927f7a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions pkg/virt-launcher/virtwrap/cli/generated_mock_libvirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,17 @@ func (_mr *_MockVirDomainRecorder) GetJobStats(arg0 interface{}) *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "GetJobStats", arg0)
}

func (_m *MockVirDomain) GetJobInfo() (*libvirt_go.DomainJobInfo, error) {
ret := _m.ctrl.Call(_m, "GetJobInfo")
ret0, _ := ret[0].(*libvirt_go.DomainJobInfo)
ret1, _ := ret[1].(error)
return ret0, ret1
}

func (_mr *_MockVirDomainRecorder) GetJobInfo() *gomock.Call {
return _mr.mock.ctrl.RecordCall(_mr.mock, "GetJobInfo")
}

func (_m *MockVirDomain) AbortJob() error {
ret := _m.ctrl.Call(_m, "AbortJob")
ret0, _ := ret[0].(error)
Expand Down
1 change: 1 addition & 0 deletions pkg/virt-launcher/virtwrap/cli/libvirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ type VirDomain interface {
MigrateToURI3(string, *libvirt.DomainMigrateParameters, libvirt.DomainMigrateFlags) error
MemoryStats(nrStats uint32, flags uint32) ([]libvirt.DomainMemoryStat, error)
GetJobStats(flags libvirt.DomainGetJobStatsFlags) (*libvirt.DomainJobInfo, error)
GetJobInfo() (*libvirt.DomainJobInfo, error)
AbortJob() error
Free() error
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/virt-launcher/virtwrap/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func liveMigrationMonitor(vmi *v1.VirtualMachineInstance, dom cli.VirDomain) {
completionTimeoutPerGiB := int64(800)
acceptableCompletionTime := completionTimeoutPerGiB * getVMIMigrationDataSize(vmi)
for {
stats, err := dom.GetJobStats(0)
stats, err := dom.GetJobInfo()
if err != nil {
logger.Reason(err).Error("failed to get domain job info")
break
Expand Down

0 comments on commit 927f7a0

Please sign in to comment.