libvirt/src/locking
Michal Privoznik 96a02703da sanlock: Retry after EINPROGRESS
It may take some time for sanlock to add a lockspace. And if user
restart libvirtd service meanwhile, the fresh daemon can fail adding
the same lockspace with EINPROGRESS. Recent sanlock has
sanlock_inq_lockspace() function which should block until lockspace
changes state. If we are building against older sanlock we should
retry a few times before claiming an error. This issue can be easily
reproduced:

for i in {1..1000} ; do echo $i; service libvirtd restart; sleep 2; done
20
Stopping libvirtd daemon:                                  [FAILED]
Starting libvirtd daemon:                                  [  OK  ]
21
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
22
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]

 error : virLockManagerSanlockSetupLockspace:334 : Unable to add
 lockspace /var/lib/libvirt/sanlock/__LIBVIRT__DISKS__: Operation now in
 progress
2012-11-16 08:00:11 +01:00
..
domain_lock.c locking: Add support for lock failure action 2012-10-11 14:41:42 +02:00
domain_lock.h locking: Pass hypervisor driver name when acquiring locks 2012-10-11 14:41:42 +02:00
libvirt_sanlock.aug sanlock: Introduce 'user' and 'group' conf variables 2012-10-30 10:12:10 +01:00
lock_driver_nop.c locking: Add support for lock failure action 2012-10-11 14:41:42 +02:00
lock_driver_nop.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
lock_driver_sanlock.c sanlock: Retry after EINPROGRESS 2012-11-16 08:00:11 +01:00
lock_driver.h locking: Add support for lock failure action 2012-10-11 14:41:42 +02:00
lock_manager.c locking: Add support for lock failure action 2012-10-11 14:41:42 +02:00
lock_manager.h locking: Add support for lock failure action 2012-10-11 14:41:42 +02:00
sanlock_helper.c locking: Implement lock failure action in sanlock driver 2012-10-11 14:41:42 +02:00
sanlock.conf sanlock: Introduce 'user' and 'group' conf variables 2012-10-30 10:12:10 +01:00
test_libvirt_sanlock.aug.in sanlock: Introduce 'user' and 'group' conf variables 2012-10-30 10:12:10 +01:00