Re: [PATCH v9 05/11] qemu: Implement the driver backend for virNodeGetSEVInfo()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 08, 2018 at 09:40:55AM -0500, Brijesh Singh wrote:
> Signed-off-by: Brijesh Singh <<brijesh.singh@xxxxxxx>>
> ---
>  src/qemu/qemu_capabilities.c |  7 ++++
>  src/qemu/qemu_capabilities.h |  4 +++
>  src/qemu/qemu_driver.c       | 82 ++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 93 insertions(+)
>

...

> +
> +static int
> +qemuNodeGetSEVInfo(virConnectPtr conn,
> +                   virTypedParameterPtr *params,
> +                   int *nparams,
> +                   unsigned int flags)
> +{
> +    virQEMUDriverPtr driver = conn->privateData;
> +    virCapsPtr caps = NULL;
> +    virQEMUCapsPtr qemucaps = NULL;
> +    int ret = -1;
> +
> +    if (virNodeGetSevInfoEnsureACL(conn) < 0)
> +        return ret;
> +
> +    if (!(caps = virQEMUDriverGetCapabilities(driver, true)))

you don't need ^this, I'll remove it before merging...

> +        return ret;
> +
> +    qemucaps = virQEMUCapsCacheLookupByArch(driver->qemuCapsCache,
> +                                            virArchFromHost());
> +    if (!qemucaps)
> +        goto cleanup;
> +
> +    if (!virQEMUCapsGet(qemucaps, QEMU_CAPS_SEV_GUEST)) {
> +        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
> +                       _("QEMU does not support SEV guest"));
> +        goto cleanup;
> +    }
> +
> +    if (qemuGetSEVInfoToParams(qemucaps, params, nparams, flags) < 0)
> +        goto cleanup;
> +
> +    ret = 0;
> +
> + cleanup:
> +    virObjectUnref(qemucaps);
> +    virObjectUnref(caps);

...neither ^this single unref (and the variable itself for that matter)...

Erik

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux