Re: [PATCH v1 5/8] use virBitmap to store cpumask info.

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

 



On 08/30/2012 02:55 AM, Hu Tao wrote:
> ---

> +++ b/src/conf/domain_conf.c
> @@ -8303,14 +8303,12 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
>      if (def->placement_mode != VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) {
>          tmp = virXPathString("string(./vcpu[1]/@cpuset)", ctxt);
>          if (tmp) {
> -            char *set = tmp;
> -            def->cpumasklen = VIR_DOMAIN_CPUMASK_LEN;
> -            if (VIR_ALLOC_N(def->cpumask, def->cpumasklen) < 0) {
> -                goto no_memory;
> -            }
> -            if (virDomainCpuSetParse(set, 0, def->cpumask,
> -                                     def->cpumasklen) < 0)
> +            if (virBitmapParse(tmp, 0, &def->cpumask,
> +                               VIR_DOMAIN_CPUMASK_LEN) < 0) {
> +                virReportError(VIR_ERR_INTERNAL_ERROR,
> +                               "%s", _("topology cpuset syntax error"));

Internal error is the wrong category; this fits better as VIR_ERR_XML_ERROR.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
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]