[libvirt] [Patch] Libvirt - Fix locking for readonly devices

Hi, I'm currently working on getting sanlock into Debian/Ubuntu. While testing, I noticed that I wasn't able to add a readonly or shared device: "internal error unsupported configuration: Readonly leases are not supported". After looking into the source, it seems to be the following situation: - Libvirt passes every device to the sanlock plugin, even if it is readonly - The sanlock plugin rejects to add a lease for the readonly device, returning an error so the machine starts to fail The attached patch rejects passing readonly and shared devices to the lock-plugin so they shouldn't be a problem anymore. Would this be an appropriated way to fix this problem? (I'm neither experienced in libvirt nor C) What seems odd to me is that Fedora either doesn't hit this or nobody has ever reported it. I'm not member of this list so please CC me. Thanks! Cheers, David

On 05/08/2012 03:41 AM, David Weber wrote:
Hi,
I'm currently working on getting sanlock into Debian/Ubuntu. While testing, I noticed that I wasn't able to add a readonly or shared device: "internal error unsupported configuration: Readonly leases are not supported".
After looking into the source, it seems to be the following situation: - Libvirt passes every device to the sanlock plugin, even if it is readonly - The sanlock plugin rejects to add a lease for the readonly device, returning an error so the machine starts to fail
The attached patch rejects passing readonly and shared devices to the lock-plugin so they shouldn't be a problem anymore.
Would this be an appropriated way to fix this problem? (I'm neither experienced in libvirt nor C)
I'm not sure what the best fix is. I think that the lock manager protocol is set up to allow for a shared lease, and that a readonly or shared disk should use a shared instead of an exclusive lease. Hopefully Dan Berrange can chime in.
What seems odd to me is that Fedora either doesn't hit this or nobody has ever reported it.
I'm not member of this list so please CC me.
Thankfully, list policy is to reply-to-all. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Tue, May 08, 2012 at 09:41:02AM +0000, David Weber wrote:
Hi,
I'm currently working on getting sanlock into Debian/Ubuntu. While testing, I noticed that I wasn't able to add a readonly or shared device: "internal error unsupported configuration: Readonly leases are not supported".
After looking into the source, it seems to be the following situation: - Libvirt passes every device to the sanlock plugin, even if it is readonly - The sanlock plugin rejects to add a lease for the readonly device, returning an error so the machine starts to fail
The attached patch rejects passing readonly and shared devices to the lock-plugin so they shouldn't be a problem anymore.
This isn't good - the lock manager implementation must be the one to decide what todo with readonly & shared disks. The sanlock plugin, however, does not currently support readonly/shared leases hence why it rejects them. We could probably add a config param to allow readonly/shared leases to be skipped by the sanlock plugin. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (3)
-
Daniel P. Berrange
-
David Weber
-
Eric Blake