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

Eric Blake eblake at redhat.com
Thu Jul 31 03:35:47 UTC 2014


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?

> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 539 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140730/2def8a0d/attachment-0001.sig>


More information about the libvir-list mailing list