On Mon, Jul 20, 2009 at 02:54:34PM +0100, Mark McLoughlin wrote:
On Mon, 2009-07-20 at 14:06 +0100, Daniel P. Berrange wrote:
> On Mon, Jul 20, 2009 at 02:18:38PM +0200, Daniel Veillard wrote:
>
> > Hum, that's very confusing. Why expose that flag at the API level
> > but forbid it's use from the API ?
> > Seems to me adding an extra parameter to the internal function
> > virDomainDefParseXML() is a far cleaner way to do things by looking at
> > this patch.
>
> It'd be nice to only have 1 flag parameter for the internal methods.
> Having 'flags' and 'privateFlags' to the same method is just going
> to lead to code errors, passing the wrong flag in and it silently
> failing
>
> We should not be adding this to the public API header file though.
>
> Since we only have 2 flags in use currently, lets just mask off
> the top 16 bits for internal use.
>
> So in domain_conf.h add a enum starting at the 16th bit
>
>
> typedef enum {
> VIR_DOMAIN_XML_INTERNAL_STATUS = (1<<16), /* dump internal domain status
information */
> } virDomainXMLInternalFlags;
>
>
> And to be sure no one abusing this from public API, in
> virDomainGetXMLDesc() scrub the incoming flags
>
> flags = flags & 0xffff;
How's this?
Ha ... yes that works for me !
thanks !
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/