Re: [PATCH] Add overrides for network port UUID getter/lookup methods

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

 



[snip]

> +static PyObject *
> +libvirt_virNetworkPortLookupByUUID(PyObject *self ATTRIBUTE_UNUSED,
> +                                   PyObject *args)
> +{
> +    virNetworkPortPtr c_retval;
> +    virNetworkPtr net;
> +    PyObject *pyobj_net;
> +    unsigned char *uuid;
> +    int len;
> +
> +    if (!PyArg_ParseTuple(args, (char *)"Oz#:virNetworkPortLookupByUUID",
> +                          &pyobj_net, &uuid, &len))
> +        return NULL;
> +    net = (virNetworkPtr) PyvirNetwork_Get(pyobj_net);
> +

Shouldn't we also check whether net is NULL here?

> +    if ((uuid == NULL) || (len != VIR_UUID_BUFLEN))
> +        return VIR_PY_NONE;
> +
> +    LIBVIRT_BEGIN_ALLOW_THREADS;
> +    c_retval = virNetworkPortLookupByUUID(net, uuid);
> +    LIBVIRT_END_ALLOW_THREADS;
> +
> +    return libvirt_virNetworkPortPtrWrap((virNetworkPortPtr) c_retval);
> +}
> +

[snip]

With that fixed, Reviewed-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>


--
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