1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-14 12:58:33 +03:00

tpm: Set transationStarted to false if commit failed

Set the transactionStarted to false if the commit failed. If this is not
done, then the failure path will report 'no transaction is set' and hide
more useful error reports.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20190726210706.24440-2-stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2019-07-26 17:07:05 -04:00 committed by Eric Blake
parent 0dbfc3965c
commit 20b0fd6d21

View File

@ -476,7 +476,7 @@ qemuSecurityStartTPMEmulator(virQEMUDriverPtr driver,
if (virSecurityManagerTransactionCommit(driver->securityManager,
-1, priv->rememberOwner) < 0)
goto cleanup;
goto cleanup_abort;
transactionStarted = false;
if (virSecurityManagerSetChildProcessLabel(driver->securityManager,
@ -512,6 +512,7 @@ qemuSecurityStartTPMEmulator(virQEMUDriverPtr driver,
-1, priv->rememberOwner) < 0)
VIR_WARN("Unable to run security manager transaction");
cleanup_abort:
virSecurityManagerTransactionAbort(driver->securityManager);
return ret;
}