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

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

 



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@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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