AMDEPYC / AMDEPYC/sev-certify

Clean up QEMU processes in sev_verify

Aperta
#266 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Python
Stelle
3
Fork
7
Merge medio
1g 21h
PR unite (30g)
8

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.