On Mon, Nov 22, 2010 at 05:47:19PM -0500, David Teigland wrote:
On Mon, Nov 22, 2010 at 06:09:21PM +0000, Daniel P. Berrange wrote:
> +/*
> + * Flags to pass to 'load_drv' and also 'new_drv' method
> + * Plugins must support at least one of the modes. If a
> + * mode is unsupported, it must return an error
> + */
> +enum {
> + VIR_LOCK_MANAGER_MODE_CONTENT = (1 << 0),
> + VIR_LOCK_MANAGER_MODE_METADATA = (1 << 1),
> +} virLockManagerFlags;
If I want one plugin to provide both modes, but want to deal with each
mode differently, then wouldn't I need a separate _virLockDriver structure
for each, or a mode arg in each function?
The mode will get passed to the virLockDriverNew callback in
the flags field, whenever setting up any lock, so you wouldn't
need a separate virLockDriver table.
Regards,
Daniel