On Fri, Feb 06, 2009 at 11:09:31AM +0000, Daniel P. Berrange wrote:
On Fri, Feb 06, 2009 at 09:53:04AM +0000, Gihan Munasinghe wrote:
> Is there a specific reason for not having a "free_memory" with in the
> "virNodeInfo" structure.
All public structures are part of the public ABI and channot
be changed once added. virNodeInfo existed long before the
free memory API came about, hence its not present there.
Can I get a clarification about adding to the end of such structures?
Often APIs do this with an explicit warning not to embed structures,
take sizeof() etc. The other usual choice is to make the structure
really opaque and provide accessors behind functions.
If we don't do either, I'd be very worried by at least
virDomainInterfaceStatsStruct, virDomainBlockStatsStruct,
virNodeInfo, virVcpuInfo. We'll surely end up with a proliferation of
virFoo2() calls for virFoo2Structs.
regards,
john