Re: [libvirt] Use flock() instead of fcntl()

2013-07-29 Thread Daniel P. Berrange
On Fri, Jul 26, 2013 at 11:35:32AM +0100, Daniel P. Berrange wrote: On Fri, Jul 26, 2013 at 12:31:35PM +0200, David Weber wrote: Am Freitag, 26. Juli 2013, 10:14:59 schrieb Daniel P. Berrange: On Fri, Jul 26, 2013 at 10:44:24AM +0200, David Weber wrote: Looking again at flock() I see it

Re: [libvirt] Use flock() instead of fcntl()

2013-07-29 Thread David Weber
Am Montag, 29. Juli 2013, 12:52:00 schrieb Daniel P. Berrange: On Fri, Jul 26, 2013 at 11:35:32AM +0100, Daniel P. Berrange wrote: On Fri, Jul 26, 2013 at 12:31:35PM +0200, David Weber wrote: Am Freitag, 26. Juli 2013, 10:14:59 schrieb Daniel P. Berrange: On Fri, Jul 26, 2013 at

Re: [libvirt] Use flock() instead of fcntl()

2013-07-26 Thread David Weber
flock() which is quite similar to fcntl(). I attached a patch which makes libvirt use flock() *instead* of fcntl() and it seems to work. NFS on the contrast only supports fcntl() so it should be configurable which lock type to use. I'm not very experienced with locking

Re: [libvirt] Use flock() instead of fcntl()

2013-07-26 Thread Daniel P. Berrange
On Fri, Jul 26, 2013 at 10:44:24AM +0200, David Weber wrote: Looking again at flock() I see it cannot support locking of ranges, only the entire file. This makes it unsuitable as a replacement for libvirt's use of fcntl() I'm afraid. I can only sugggest you configure OCFS2 so that it

Re: [libvirt] Use flock() instead of fcntl()

2013-07-26 Thread David Weber
Am Freitag, 26. Juli 2013, 10:14:59 schrieb Daniel P. Berrange: On Fri, Jul 26, 2013 at 10:44:24AM +0200, David Weber wrote: Looking again at flock() I see it cannot support locking of ranges, only the entire file. This makes it unsuitable as a replacement for libvirt's use of fcntl()

Re: [libvirt] Use flock() instead of fcntl()

2013-07-26 Thread Daniel P. Berrange
On Fri, Jul 26, 2013 at 12:31:35PM +0200, David Weber wrote: Am Freitag, 26. Juli 2013, 10:14:59 schrieb Daniel P. Berrange: On Fri, Jul 26, 2013 at 10:44:24AM +0200, David Weber wrote: Looking again at flock() I see it cannot support locking of ranges, only the entire file. This makes

Re: [libvirt] Use flock() instead of fcntl()

2013-07-26 Thread Jim Fehlig
Daniel P. Berrange wrote: On Thu, Jul 25, 2013 at 12:07:44PM +0200, David Weber wrote: SUSE advises to use indirect leases which we also want to avoid: https://www.suse.com/documentation//sled11/book_kvm/?page=/documentation//sled11/book_kvm/data/sec_libvirt_storage_locking.html

[libvirt] Use flock() instead of fcntl()

2013-07-25 Thread David Weber
to fcntl(). I attached a patch which makes libvirt use flock() *instead* of fcntl() and it seems to work. NFS on the contrast only supports fcntl() so it should be configurable which lock type to use. I'm not very experienced with locking, so would such a patch be acceptable or do you see

Re: [libvirt] Use flock() instead of fcntl()

2013-07-25 Thread Daniel P. Berrange
indirect leases. OCFS2 instead supports flock() which is quite similar to fcntl(). I attached a patch which makes libvirt use flock() *instead* of fcntl() and it seems to work. NFS on the contrast only supports fcntl() so it should be configurable which lock type to use. I'm not very

Re: [libvirt] Use flock() instead of fcntl()

2013-07-25 Thread David Weber
fcntl() locks which aren't supported by OCFS2 with the o2cb cluster stack and we want to avoid using indirect leases. OCFS2 instead supports flock() which is quite similar to fcntl(). I attached a patch which makes libvirt use flock() *instead* of fcntl() and it seems to work. NFS

Re: [libvirt] Use flock() instead of fcntl()

2013-07-25 Thread Daniel P. Berrange
libvirt use flock() *instead* of fcntl() and it seems to work. NFS on the contrast only supports fcntl() so it should be configurable which lock type to use. I'm not very experienced with locking, so would such a patch be acceptable or do you see possible problems