From: Nick Chevsky Date: Mon, 13 Sep 2021 06:16:18 +0000 (-0500) Subject: qemu_tpm: Start swtpm(8) daemon with --terminate switch X-Git-Tag: v7.8.0-rc1~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbc605d8d91fac2f6e55b9fc86d0e61085a9ec71;p=thirdparty%2Flibvirt.git qemu_tpm: Start swtpm(8) daemon with --terminate switch Launch swtpm(8) with the --terminate switch, which guarantees that the daemon will shut itself down when QEMU dies (current behavior). We had so far been getting this "for free" (i.e. without --terminate) due to a defect in upstream's connection handling logic [1], on which libvirt should not rely since it will eventually be fixed. Adding --terminate preserves and guarantees the current behavior. [1] https://github.com/stefanberger/swtpm/pull/509 Signed-off-by: Nick Chevsky Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 477a26dc69..100481503c 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -576,6 +576,8 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDef *tpm, virCommandAddArg(cmd, "--log"); virCommandAddArgFormat(cmd, "file=%s", tpm->data.emulator.logfile); + virCommandAddArg(cmd, "--terminate"); + virCommandSetUID(cmd, swtpm_user); virCommandSetGID(cmd, swtpm_group);