]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tpm_emulator: print error on error-ignore path
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Tue, 3 Feb 2026 15:58:41 +0000 (18:58 +0300)
committerStefan Berger <stefanb@linux.ibm.com>
Tue, 10 Feb 2026 15:35:26 +0000 (10:35 -0500)
Commit 3469a56fa3dc985 introduced errp passthrough for many
errors in the file. But in this specific case in
tpm_emulator_get_buffer_size(), it simply used errp=NULL, so we lose
printed error. Let's bring it back

Note also, that 3469a56fa3dc985 was fixing another commit,
42e556fa3f7a "backends/tpm: Propagate vTPM error on migration failure"
and didn't mention it.

Fixes: 3469a56fa3dc985 "tmp_emulator: improve and fix use of errp"
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
backends/tpm/tpm_emulator.c

index f52cb4d43547955ccda2f2866fc28b6d7af3b256..6d8529da3b7f9282dd9d6a025784808262a50d44 100644 (file)
@@ -557,8 +557,10 @@ static TPMVersion tpm_emulator_get_tpm_version(TPMBackend *tb)
 static size_t tpm_emulator_get_buffer_size(TPMBackend *tb)
 {
     size_t actual_size;
+    Error *local_err = NULL;
 
-    if (tpm_emulator_set_buffer_size(tb, 0, &actual_size, NULL) < 0) {
+    if (tpm_emulator_set_buffer_size(tb, 0, &actual_size, &local_err) < 0) {
+        error_report_err(local_err);
         return 4096;
     }