]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tpm: Set transationStarted to false if commit failed
authorStefan Berger <stefanb@linux.ibm.com>
Fri, 26 Jul 2019 21:07:05 +0000 (17:07 -0400)
committerEric Blake <eblake@redhat.com>
Fri, 26 Jul 2019 21:32:25 +0000 (16:32 -0500)
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>

src/qemu/qemu_security.c

index 87209d3781cdaf8dbd491182532525d33ff630ec..3cd6d9bd3d315b805009fa70d205973fb8e7583c 100644 (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;
 }