]> git.ipfire.org Git - thirdparty/libvirt.git/commit
sanlock: Properly init io_timeout
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 15 Sep 2016 11:05:34 +0000 (13:05 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 29 Sep 2016 14:59:11 +0000 (16:59 +0200)
commit5fe66ea3bfdae386064f782b9128f45f2ac37f64
tree1fc806d18994e20d2751a90fcccfb4b58c0a6cd5
parent2bca7cec0ba9e861edb245f20d99d5b6fd22f760
sanlock: Properly init io_timeout

https://bugzilla.redhat.com/show_bug.cgi?id=1292984

Hold on to your hats, because this is gonna be wild.

In bd3e16a3 I've tried to expose sanlock io_timeout. What I had
not realized (because there is like no documentation for sanlock
at all) was very unusual way their APIs work. Basically, what we
do currently is:

    sanlock_add_lockspace_timeout(&ls, io_timeout);

which adds a lockspace to sanlock daemon. One would expect that
io_timeout sets the io_timeout for it. Nah! That's where you are
completely off the tracks. It sets timeout for next lockspace you
will probably add later. Therefore:

   sanlock_add_lockspace_timeout(&ls, io_timeout = 10);
   /* adds new lockspace with default io_timeout */

   sanlock_add_lockspace_timeout(&ls, io_timeout = 20);
   /* adds new lockspace with io_timeout = 10 */

   sanlock_add_lockspace_timeout(&ls, io_timeout = 40);
   /* adds new lockspace with io_timeout = 20 */

And so on. You get the picture.
Fortunately, we don't allow setting io_timeout per domain or per
domain disk. So we just need to set the default used in the very
first step and hope for the best (as all the io_timeout-s used
later will have the same value).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/locking/lock_driver_sanlock.c