qemu: sev: Don't jump to endjob if SEV measurement retrieval fails

If measurement retrieval fails we'd forget to call ExitMonitor to unlock
the monitor.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reported-by: Luyao Huang <lhuang@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
This commit is contained in:
Erik Skultety 2018-06-18 09:20:13 +02:00
parent 54c54b56f4
commit 6d490ed0d8
1 changed files with 3 additions and 2 deletions

View File

@ -21520,12 +21520,13 @@ qemuDomainGetSEVMeasurement(virQEMUDriverPtr driver,
qemuDomainObjEnterMonitor(driver, vm);
tmp = qemuMonitorGetSEVMeasurement(QEMU_DOMAIN_PRIVATE(vm)->mon);
if (tmp == NULL)
goto endjob;
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto endjob;
if (!tmp)
goto endjob;
if (virTypedParamsAddString(params, nparams, &maxpar,
VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT,
tmp) < 0)