AMDEPYC / AMDEPYC/sev-certify

Clean up QEMU processes in sev_verify

Open
#266 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
3
Forks
7
Avg merge
1d 21h
Merged PRs (30d)
8

Description

Killing `sev_verify` (with CTRL-C for instance) while a VM is still up does NOT kill the qemu process, resulting in an orphan process that needs to get cleaned up, as well as blocking the next run from completing:

```
── 3.0.0-0 ──
attestation-test Launch an SEV-SNP guest and verify attestation report
Artifacts: artifacts/3.0/3.0.0-0/attestation_test
├─ Calculate measurement ······································· 117ms [PASS]
├─ Launch SEV-SNP guest ········································· 2.0s [ERR!]
│ QEMU exited immediately with code 1: qemu-system-x86_64: -device vhost-vsock-pci,guest-cid=3,id=vsock0: vhost-vsock: unable to set guest cid: Address already in use
│ [Hint] A previous VM may still be running. Try: sudo kill $(pgrep -f 'qemu.*guest-cid')
```

Implement a cleanup function + signal handler to call it. Brownie points to handle a crash or SIGKILL (where signal handlers cannot catch and trigger a cleanup), or if sev_verify can auto-handle `address already in use` when it pertains to an orphan process from a previous run.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.