]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tpm: Move tpm_cleanup() to right place
authorAmarnath Valluri <amarnath.valluri@intel.com>
Fri, 29 Sep 2017 11:10:21 +0000 (14:10 +0300)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Fri, 13 Oct 2017 11:34:33 +0000 (07:34 -0400)
As Emulator TPM backend uses chardev, tpm cleanup should happen before chardev
similar to other vhost-users.

Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
tpm.c
vl.c

diff --git a/tpm.c b/tpm.c
index 3b8c7ed3b699f07eba2998ba26833ba5ffff8a52..31222271566eb395087d58e26ff548ea2fb23b13 100644 (file)
--- a/tpm.c
+++ b/tpm.c
@@ -172,7 +172,6 @@ int tpm_init(void)
         return -1;
     }
 
-    atexit(tpm_cleanup);
     return 0;
 }
 
diff --git a/vl.c b/vl.c
index d7c349233fed4a31a0c30cc308bd1d8ac7aa39c0..0723835bbfdcf81ebbd89b26f39355a98c883720 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -4905,6 +4905,7 @@ int main(int argc, char **argv, char **envp)
     res_free();
 
     /* vhost-user must be cleaned up before chardevs.  */
+    tpm_cleanup();
     net_cleanup();
     audio_cleanup();
     monitor_cleanup();