Re: [PATCH 3/8] Add vcpu functions to libxl driver

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

 



Markus Groß wrote:
> Am Mittwoch 23 März 2011 17:59:11 schrieb Jim Fehlig:
>   
>> Markus Groß wrote:
>>     
>>> +    maplen = (unsigned int) ceil((double) nvcpus / 8);
>>> +    if (VIR_ALLOC_N(bitmask, maplen) < 0) {
>>> +        virReportOOMError();
>>> +        goto cleanup;
>>> +    }
>>> +
>>> +    memset(bitmask, 0, maplen);
>>> +    for (i = 0; i < nvcpus; ++i) {
>>> +        pos = (unsigned int) floor((double) i / 8);
>>> +        bitmask[pos] |= 1 << (i % 8);
>>> +    }
>>> +
>>> +    map.size = maplen;
>>> +    map.map = bitmask;
>>>   
>>>       
>> Hmm, could this be simplified to
>>
>>     if (libxl_cpumap_alloc(&priv->ctx, &map)) {
>>         virReportOOMError()
>>         goto cleanup;
>>     }
>>     for (i = 0; i < nvcpus; i++)
>>         libxl_cpumap_set(&map, i);
>>
>>     
>
> This would be convenient, however these functions are part of libxl_utils.c/h and are not installed by xen.
> At least I found them nowhere when installing xen.
>   

Yeah, I realized this after making that comment.  There are several
useful functions in libxl_utils so I asked Ian Jackson to provide it and
he obliged

http://lists.xensource.com/archives/html/xen-devel/2011-03/msg01631.html

Doesn't help us much for now though.

Regards,
Jim

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