[libvirt] [PATCH] blockcopy: check dst = identical device

Chun Yan Liu cyliu at suse.com
Thu Jul 31 04:18:45 UTC 2014



>>> On 7/31/2014 at 11:35 AM, in message <53D9B993.4040806 at redhat.com>, Eric Blake
<eblake at redhat.com> wrote: 
> On 07/30/2014 09:29 PM, Chun Yan Liu wrote: 
>  
> >> A better idea would be to rely on the volume lease manager - obtaining a  
> >> lease should be impossible for an image already in use (and should even  
> >> cover the case of copying 'base <- active' onto 'base', which your  
> >> equality test wouldn't catch). I'm not sure why the lease manager is not  
> >> already flagging this issue - are we still using the nop lease manager  
> >> by default, and would the fcntl or sanlock lease manager do a better job? 
> >  
> > Besides the default lock is 'nop', currently lock manager is only used in: 
> > VM start/stop and attach/detach disk, blockcopy not using it. 
>  
> But that's not true - the code IS trying to use it.  qemuDomainBlockCopy 
> calls qemuDomainPrepareDiskChainElement(), which calls 
> virDomainLockImageAttach(), and that should be the use of the lock 
> manager.  Can you debug why it is not working when using something other 
> than the 'nop' manager? 

Yeah. I'll have a look.

>  
> > To use it in blockcopy, maybe can refer to attach/detach disk: before doing 
> > blockcopy, try AcquireResource; after blockcopy finish, try  
> releaseResource. 
>  
> That should be what is already happening. 
>  
>  
> --  
> Eric Blake   eblake redhat com    +1-919-301-3266 
> Libvirt virtualization library http://libvirt.org 
>  
>  






More information about the libvir-list mailing list