[libvirt] [PATCH v2] locking: Add io_timeout to sanlock
Michal Privoznik
mprivozn at redhat.com
Wed Nov 18 10:08:07 UTC 2015
On 27.10.2015 17:53, Jiri Denemark wrote:
> On Tue, Oct 27, 2015 at 16:29:51 +0100, Michal Privoznik wrote:
>> https://bugzilla.redhat.com/show_bug.cgi?id=1251190
>>
>> So, if domain loses access to storage, sanlock tries to kill it
>> after some timeout. So far, the default is 80 seconds. But for
>> some scenarios this might not be enough. We should allow users to
>> adjust the timeout according to their needs.
>>
>> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>> ---
>>
>> diff to v2:
>> - Check if the new sanlock API is accessible. If not, forbid setting timeout in
>> the config file.
>>
>> m4/virt-sanlock.m4 | 7 +++++++
>> src/locking/libvirt_sanlock.aug | 1 +
>> src/locking/lock_driver_sanlock.c | 15 +++++++++++++++
>> src/locking/sanlock.conf | 7 +++++++
>> src/locking/test_libvirt_sanlock.aug.in | 1 +
>> 5 files changed, 31 insertions(+)
>>
> Ouch, please, don't mix #if and if blocks. The following would be much
> better:
>
> #ifdef HAVE_SANLOCK_ADD_LOCKSPACE_TIMEOUT
> rv = sanlock_add_lockspace_timeout(&ls, 0, driver->io_timeout);
> #else
> if (driver->io_timeout) {
> virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> _("unable to use io_timeout with this version of sanlock"));
> goto error;
> }
> rv = sanlock_add_lockspace(&ls, 0);
> #endif
>
> if (rv < 0) {
>
> Jirka
>
Fixed and pushed. Thanks.
Michal
More information about the libvir-list
mailing list