aboutsummaryrefslogtreecommitdiffstats
path: root/vm/vmimpl/vmimpl.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2018-12-21 07:58:27 -0800
committerDmitry Vyukov <dvyukov@google.com>2018-12-21 18:08:49 +0100
commit2fc01104d0081e0178522d3aa59938b7c3e0de57 (patch)
tree8180b0801987ffe7241c4b492740d1d2ed0c7da8 /vm/vmimpl/vmimpl.go
parent588075e659832f8685d0c9dc9c75c461e023e77f (diff)
vm: allow Diagnose to directly return diagnosis
Rather than writing the diagnosis to the kernel console, Diagnose can now directly return the extra debugging info, which will be appended ot the kernel console log.
Diffstat (limited to 'vm/vmimpl/vmimpl.go')
-rw-r--r--vm/vmimpl/vmimpl.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/vm/vmimpl/vmimpl.go b/vm/vmimpl/vmimpl.go
index 7831a0bef..e5efe19c2 100644
--- a/vm/vmimpl/vmimpl.go
+++ b/vm/vmimpl/vmimpl.go
@@ -43,10 +43,13 @@ type Instance interface {
// Command is terminated after timeout. Send on the stop chan can be used to terminate it earlier.
Run(timeout time.Duration, stop <-chan bool, command string) (outc <-chan []byte, errc <-chan error, err error)
- // Diagnose forces VM to dump additional debugging info
- // (e.g. sending some sys-rq's or SIGABORT'ing a Go program).
- // Returns true if it did anything.
- Diagnose() bool
+ // Diagnose retrieves additional debugging info from the VM (e.g. by
+ // sending some sys-rq's or SIGABORT'ing a Go program).
+ //
+ // Optionally returns (some or all) of the info directly. If wait ==
+ // true, the caller must wait for the VM to output info directly to its
+ // log.
+ Diagnose() (diagnosis []byte, wait bool)
// Close stops and destroys the VM.
Close()