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

Daniel Veillard veillard at redhat.com
Tue Jul 11 21:11:05 UTC 2006


On Tue, Jul 11, 2006 at 05:29:52PM +0200, michel.ponceau at 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 at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




More information about the libvir-list mailing list