From 7a0edfbe7c3703a0bf48f01dd818173a68a8f747 Mon Sep 17 00:00:00 2001 From: Greg Steuck Date: Sun, 2 Dec 2018 05:22:10 -0800 Subject: vm/gce: use openbsd console diagnostic code for both vmm and gce * openbsd: use console diagnostic code for both vmm and gce. * gometalinter wants less indentation and more stuff in scope * Comment no longer applies --- vm/vmm/vmm.go | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'vm/vmm') diff --git a/vm/vmm/vmm.go b/vm/vmm/vmm.go index 72f47489c..4ba7d9a2f 100644 --- a/vm/vmm/vmm.go +++ b/vm/vmm/vmm.go @@ -311,23 +311,7 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin } func (inst *instance) Diagnose() bool { - // Note: this only works if kernel actually paniced and kernel shows panic console. - // If kernel just hanged, we've lost connection or detected some non-panic error, - // console still shows normal login prompt. - commands := []string{ - "", - "set $lines = 0", // disable pagination - "show panic", - "trace", - "show registers", - "show proc", - "ps", - } - for _, c := range commands { - inst.consolew.Write([]byte(c + "\n")) - time.Sleep(1 * time.Second) - } - return true + return vmimpl.DiagnoseOpenBSD(inst.consolew) } // Run the given vmctl(8) command and wait for it to finish. -- cgit mrf-deployment