aboutsummaryrefslogtreecommitdiffstats
path: root/vm/qemu
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-08-14 16:59:36 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-08-16 09:31:43 +0000
commit17b06ddde717d359217c78d03f322944b5e57a8a (patch)
tree14f6204cb6b967cf694eaade1f292cca1accdc6a /vm/qemu
parent1692d586aec75be5a88de78d7fa9c0729eec1486 (diff)
vm/qemu: extend error messages
Include VM output into snapshot error messages. Otherwise it's hard to understand what happened.
Diffstat (limited to 'vm/qemu')
-rw-r--r--vm/qemu/snapshot_linux.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/vm/qemu/snapshot_linux.go b/vm/qemu/snapshot_linux.go
index 5a30fa382..c1110ddf8 100644
--- a/vm/qemu/snapshot_linux.go
+++ b/vm/qemu/snapshot_linux.go
@@ -164,7 +164,7 @@ func (inst *instance) SetupSnapshot(input []byte) error {
// Tell executor that we are ready to snapshot and wait for an ack.
inst.header.UpdateState(flatrpc.SnapshotStateHandshake)
if !inst.waitSnapshotStateChange(flatrpc.SnapshotStateHandshake, 10*time.Minute) {
- return fmt.Errorf("executor does not start snapshot handshake")
+ return fmt.Errorf("executor does not start snapshot handshake\n%s", inst.readOutput())
}
if _, err := inst.hmp("migrate_set_capability x-ignore-shared on", 0); err != nil {
return err
@@ -177,7 +177,7 @@ func (inst *instance) SetupSnapshot(input []byte) error {
}
inst.header.UpdateState(flatrpc.SnapshotStateSnapshotted)
if !inst.waitSnapshotStateChange(flatrpc.SnapshotStateSnapshotted, time.Minute) {
- return fmt.Errorf("executor has not confirmed snapshot handshake")
+ return fmt.Errorf("executor has not confirmed snapshot handshake\n%s", inst.readOutput())
}
return nil
}
@@ -188,7 +188,7 @@ func (inst *instance) RunSnapshot(timeout time.Duration, input []byte) (result,
inst.header.OutputSize = 0
inst.header.UpdateState(flatrpc.SnapshotStateExecute)
if _, err := inst.hmp("loadvm syz", 0); err != nil {
- return nil, nil, err
+ return nil, nil, fmt.Errorf("%w\n%s", err, inst.readOutput())
}
inst.waitSnapshotStateChange(flatrpc.SnapshotStateExecute, timeout)
resStart := int(flatrpc.ConstMaxInputSize) + int(atomic.LoadUint32(&inst.header.OutputOffset))