Re: [PATCH 2/8] Basic framework for lock manager plugins

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]