Fix the exception of adding TPM devices via virt-manager by synchronizing upstream patches. Signed-off-by: lixianglai <lixianglai@loongson.cn> (cherry picked from commit 7e0d98bb1b1b0719ac595124afbd135781bb4115)