[libvirt PATCH] qemu: qemuDomainSetLaunchSecurityState: do not lookup qemuCaps in cache

Ján Tomko jtomko at redhat.com
Mon Jan 31 14:46:43 UTC 2022


On a Monday in 2022, Peter Krempa wrote:
>On Mon, Jan 31, 2022 at 13:40:34 +0100, Ján Tomko wrote:
>> Any active domain has a copy in the privateData, filled in
>> qemuProcessInit.
>>
>> Move the qemu capability check below the activeness check and remove
>> the extra lookup.
>
>What's worse is that you can get caps for a different emulator binary
>since the code didn't even bother passing the path to the lookup
>function.
>
>>
>> Signed-off-by: Ján Tomko <jtomko at redhat.com>
>> ---
>>  src/qemu/qemu_driver.c | 21 +++++++++------------
>>  1 file changed, 9 insertions(+), 12 deletions(-)
>
>Reviewed-by: Peter Krempa <pkrempa at redhat.com>
>

Thanks, I will squash this in before pushing:

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 57f286b343..698f57f00e 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20044,7 +20044,7 @@ qemuDomainSetLaunchSecurityState(virDomainPtr domain,
      if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SEV_INJECT_LAUNCH_SECRET)) {
          virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                         _("QEMU does not support setting a launch secret"));
-        goto cleanup;
+        goto endjob;
      }

      qemuDomainObjEnterMonitor(driver, vm);

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20220131/161808b6/attachment-0001.sig>


More information about the libvir-list mailing list