[libvirt] [PATCH 0/2] Enhance checking of supported flags in drivers

Daniel Veillard veillard at redhat.com
Mon Apr 12 13:00:18 UTC 2010

On Fri, Apr 09, 2010 at 04:40:59PM +0200, Jiri Denemark wrote:
> I think we need a simple and consistent way of checking whether flags passed
> to API entry points in drivers are valid/supported or not. So far some entry
> points don't check flags at all and some checks for 0 when no flags are
> expected/supported.
> The first patch introduces a macro which can be called with a whitelist of
> supported flags (more info about it inside the patch). I don't particularily
> like introducing a new header file but non of existing header files looked
> like a good place to stick this macro in. If you think such a place exist,
> I'll be very happy to adapt the patch.
> The second patch changes all API calls introduced since the last release to
> use the macro for checking valid flags.
> I'm not sure if we can change existing API calls to do the same as it could
> break some badly written apps which pass invalid flags. My opinion is that we
> may often do that as such apps don't use the API in a documented/valid way.
> But even if my thinking is correct, we don't want to change it before 0.8.0.

  In general I think it's a good idea, but instead of adding a new
header, I would put it in internals.h for general availability.
I agree it's a post-0.8.0 change :-)


Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

More information about the libvir-list mailing list