8f10c1e sanlock: Truncate domain names longer than SANLK_NAME_LEN

Authored and Committed by Jiri Denemark 10 years ago
    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.