Re: [PATCH 22/23] tests: Add virnumamock

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

 



[...]

> +int
> +virNumaGetNodeCPUs(int node, virBitmapPtr *cpus)
> +{
> +    int ret = -1;
> +    char *cpulist = NULL;
> +
> +    if (virSysfsGetNodeValueString(node, "cpulist", &cpulist) < 0)
> +        return -1;
> +
> +    *cpus = virBitmapParseUnlimited(cpulist);
> +    if (!cpus)

I think you meant "if (!*cpus)" (Coverity complained about checking for
NULL cpus before assigning to it).


John
> +        goto cleanup;
> +
> +    ret = virBitmapCountBits(*cpus);
> + cleanup:
> +    VIR_FREE(cpulist);
> +    return ret;
> +}
> 

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