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

David Teigland teigland at redhat.com
Tue Nov 30 18:53:36 UTC 2010


On Tue, Nov 30, 2010 at 10:20:38AM +0000, Daniel P. Berrange wrote:
> The AttachObject/DetachObject calls are made by libvirtd, whenever
> it is about todo something on behalf of the managed object holding
> the lock. eg when libvirtd does disk hotplug it will do
> 
>     $man = NewObject()
>     AttachObject($man, $QEMUPID);
>     AcquireResource($man, $newdiskpath);
>     DetachObject($man);
>     FreeObject($man)
> 
> So basically the AttachObject call is telling the lock manager
> plugin what $PID the following AcquireResource operation needs
> to be applied to. Chances are your DetachObject call will only
> need to be a no-op but I put the hook in just in case there's
> a need for it

OK, it seems a roundabout way of SetParameter($man, "pid", $QEMUPID),
but "just in case ..." seems to be the consistent approach here.

Dave




More information about the libvir-list mailing list