From 4d4a4420e72dba0231c8ce5921eb75dddab88747 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 20 May 2019 18:30:54 +0200 Subject: pkg/report: add Type/Frame to Report In several places we do special handling for some crash types. Currently we compare report title with magic strings, which is error-prone. Add explicit Type to reports. --- pkg/instance/instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/instance/instance.go') diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 960272245..4bd483d61 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -226,7 +226,7 @@ func (inst *inst) test() error { if bootErr, ok := err.(vm.BootErrorer); ok { testErr.Title, testErr.Output = bootErr.BootError() rep := inst.reporter.Parse(testErr.Output) - if rep != nil && rep.Title == report.UnexpectedKernelReboot { + if rep != nil && rep.Type == report.UnexpectedReboot { // Avoid detecting any boot crash as "unexpected kernel reboot". output := testErr.Output[rep.EndPos:] if pos := bytes.IndexByte(testErr.Output[rep.StartPos:], '\n'); pos != -1 { -- cgit mrf-deployment