Merge pull request #1180 from egernst/qemu-cleanup-check

qemu: no state to save if QEMU isn't running
This commit is contained in:
Eric Ernst 2021-01-06 11:17:54 -08:00 committed by GitHub
commit 542e93d987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2316,6 +2316,12 @@ func (q *qemu) toGrpc() ([]byte, error) {
}
func (q *qemu) save() (s persistapi.HypervisorState) {
// If QEMU isn't even running, there isn't any state to save
if q.stopped {
return
}
pids := q.getPids()
if len(pids) != 0 {
s.Pid = pids[0]