[Libvir] Re: Proposal : add 3 functions to Libvirt API, for virtual CPUs

I don't understand. Libvirt users must of course compile API and application with the same libvirt.h, after updating the value of VIR_MAX_CPUS when necessary. And go from first info element to next one by (info+1), which adds sizeof(virVcpuInfo) to address, including correct length of cpumap according to: unsigned char cpumap[(VIR_MAX_CPUS + 7) / 8]; /* Bit map of usable real CPUs. For alignment constraints, compiler rounds up the sizeof(virVcpuInfo)when needed. Veuillez répondre à veillard@redhat.com Pour : michel.ponceau@bull.net cc : libvir-list@redhat.com Objet : Re: Proposal : add 3 functions to Libvirt API, for virtual CPUs On Tue, Jul 11, 2006 at 05:29:52PM +0200, michel.ponceau@bull.net wrote:
2) CPU map cut into standard + extension : It would be more simple to let each Libvirt user modify the value of VIR_MAX_CPUS in private libvirt.h.
It could be similar to the version number update, from libvirt.h.in to libvirt.h : #define LIBVIR_VERSION_NUMBER @LIBVIRT_VERSION_NUMBER@
No, I do think it is instead very hard. You start to get into very annoying problems from an API point of view. How do you go from the first element in the info array to the next one ? in the client it's already not nice, you must do pointer arithmetic (and I really don't want to push an API which forces that to most users), it expose potential serious problem like alignment and packing, problems between versions of compilers and tools. In a nutshell I don't want an API where one need to access an array of structure where the size of the structure is not defined by the API itself. What I suggested did that in both case, either low number of CPUs and fixed size records like you initial solutions, or high number of CPUs and you work on a two dimentional array of bytes. Daniel -- Daniel Veillard | Red Hat http://redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Thu, Jul 13, 2006 at 01:12:47PM +0200, michel.ponceau@bull.net wrote:
I don't understand. Libvirt users must of course compile API and application with the same libvirt.h, after updating the value of VIR_MAX_CPUS when necessary. And go from first info element to next one by (info+1), which adds sizeof(virVcpuInfo) to address, including correct length of cpumap according to: unsigned char cpumap[(VIR_MAX_CPUS + 7) / 8]; /* Bit map of usable real CPUs. For alignment constraints, compiler rounds up the sizeof(virVcpuInfo)when needed.
Well if you need to recompile the library to use a larger set of CPU you don't garantee API and ABI, by definition. And you will need to recompile the library because the structures passed between the app and the library change size, this will also likely affect the proxy since I expect vCPU informations to be provided (so communication between the library and proxy must change). There is certainly solutions to the scalability problem, but suggesting a change of header and recompilation of the whole software stack is really not one I would like to propose, it breaks basically all expectations an enterprise customer would have w.r.t. using the library. Unless I really misunderstood what you were suggesting, which is possible in that case reformulating it might be a good idea, because I really understood you want to make the MAX number of CPU a compile time setting. Daniel -- Daniel Veillard | Red Hat http://redhat.com/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (2)
-
Daniel Veillard
-
michel.ponceau@bull.net