Re: [libvirt] [PATCHv4] libvirt: do not mix internal flags into public API

From: Eric Blake <eblake redhat com>

Cc: libvir-list redhat com

Subject: Re: [libvirt] [PATCHv4] libvirt: do not mix internal flags into public API

Date: Mon, 18 Jul 2011 14:39:17 -0600

On 07/18/2011 01:27 PM, Eric Blake wrote:

On 07/15/2011 05:12 PM, Eric Blake wrote:

There were two API in driver.c that were silently masking flags
bits prior to calling out to the drivers, and several others
that were explicitly masking flags bits. This is not
forward-compatible - if we ever have that many flags in the
future, then talking to an old server that masks out the
flags would be indistinguishable from talking to a new server
that can honor the flag. In general, libvirt.c should forward
_all_ flags on to drivers, and only the drivers should reject
unknown flags.
In the case of virDrvSecretGetValue, the solution is to separate
the internal driver callback function to have two parameters
instead of one, with only one parameter affected by the public
API.

On second thought, I don't like this. It's nicer to have all the driver
callbacks match the public API as much as possible, and to instead
create a new entry point in libvirt_private.syms that qemu can use for
the case where it needs to call the internal API instead of the public
virSecretGetValue. v5 coming up.