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

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

 



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.

I will incorporate the rest of your suggestions in a v2.

Thanks,
Markus

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