[libvirt] [PATCH v3] virsh: freecell --all getting wrong NUMA nodes count

Eric Blake eblake at redhat.com
Fri Feb 18 16:26:57 UTC 2011


On 02/18/2011 04:42 AM, Michal Privoznik wrote:
> Virsh freecell --all was not only getting wrong NUMA nodes count, but
> even the NUMA nodes IDs. They doesn't have to be continuous, as I've
> found out during testing this. Therefore a modification of
> nodeGetCellsFreeMemory() error message.
> ---
> Hope it's good this time :)
> 
> +        for (i = 0; i < nodes_cnt; i++) {
> +            unsigned long id;
> +            char *val = virXMLPropString(nodes[i], "id");
> +            if (virStrToLong_ul(val, NULL, 10, &id)) {
> +                vshError(ctl, "%s", _("conversion from string failed"));
> +                goto cleanup;
> +            }
> +            VIR_FREE(val);

Mem-leak - you leaked val on failure.

> +            nodes_id[i]=id;
> +            ret = virNodeGetCellsFreeMemory(ctl->conn, &(nodes_free[i]), id, 1);
> +            if (ret != 1) {
> +                vshError(ctl, _("failed to get free memory for NUMA node "
> +                                "nuber: %lu"), id);

s/nuber/number/

ACK with those nits fixed, so I pushed it.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110218/ff3272e1/attachment-0001.sig>


More information about the libvir-list mailing list