]> git.ipfire.org Git - thirdparty/libvirt.git/commit
sanlock: Truncate domain names longer than SANLK_NAME_LEN
authorJiri Denemark <jdenemar@redhat.com>
Thu, 27 Feb 2014 08:32:41 +0000 (09:32 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 27 Feb 2014 08:32:41 +0000 (09:32 +0100)
commit8f10c1e77fdbc165ff6d6b4a5a42ab7b31e30819
treecb130760e2057022a8b06bc43883c578032f6be6
parentb88606ec4f21aed9665dd0b9b3fb70793d50786a
sanlock: Truncate domain names longer than SANLK_NAME_LEN

Libvirt uses a domain name to fill in owner_name in sanlock_options in
virLockManagerSanlockAcquire. Unfortunately, owner_name is limited to
SANLK_NAME_LEN characters (including trailing '\0'), which means domains
with longer names fail to start when sanlock is enabled. However, we can
truncate the name when setting owner_name as explained by sanlock's
author:

Setting sanlk_options or the owner_name is unnecessary, and has very
little to no benefit.  If you do provide something in owner_name, it can
be anything, sanlock doesn't care or use it.

If you run the command "sanlock status", the output will display a list
of clients connected to the sanlock daemon.  This client list is
displayed as "pid owner_name" if the client has provided an owner_name
via sanlk_options. This debugging output is the only usage of
owner_name, so its only benefit is to potentially provide a more human
friendly output for debugging purposes.
src/locking/lock_driver_sanlock.c