freenas-proxmox/perl5/PVE/Storage
Kevin Adams 7a9d0072a2 Fix global state bugs: per-host product_name, dev_prefix, api_version, runaway counter
All of these were module-level scalars that the last freenas_api_check call
would overwrite. With two TrueNAS hosts in a Proxmox config (e.g., one CORE
and one SCALE), the second host's API check would clobber the first host's
product_name, dev_prefix, and api_version, causing wrong API paths and wrong
pool-name slash-vs-dash conversion on subsequent calls to the first host.

Changes:
- $freenas_server_list->{$host} now stores a hashref {client, product_name,
  api_version, dev_prefix, runaway_count} instead of a bare REST::Client
- freenas_api_connect: recursion counter is now per-host (runaway_count);
  $apiping made local so v1->v2 detection for one host does not affect others
- freenas_api_check: fixed broken init-guard (was testing $freenas_rest_connection->{$host}
  which always evaluates undef on a REST::Client object); saves detected
  product_name/api_version/dev_prefix back into the per-host hash after detection
- freenas_api_call: restores all module-level pointers (product_name, dev_prefix,
  api_methods, api_variables) from per-host storage on every call, so the
  correct host context is active regardless of which host was accessed last

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 23:23:11 -04:00
..
LunCmd Fix global state bugs: per-host product_name, dev_prefix, api_version, runaway counter 2026-05-15 23:23:11 -04:00
.gitignore Update the FreeNAS-API related files to the latest Proxmox VE 2019-05-11 11:13:54 -04:00
ZFSPlugin-5.0-30.pm.patch Fix 'Parameter verification failed' when editing 2018-10-28 21:37:06 -04:00
ZFSPlugin-5.0-33_1.pm.hotfix.patch Fix ZFS error: Unrecognized command "list_extent" 2018-12-15 09:50:44 -05:00
ZFSPlugin-5.0-33_1.pm.patch Fix ZFS error: Unrecognized command "list_extent" 2018-12-15 09:50:44 -05:00
ZFSPlugin-5.0-34_1.pm.patch Update Proxmox VE patches to 5.3-6 2018-12-24 07:36:33 -05:00
ZFSPlugin-5.0-38_1.pm.patch Update to latest Proxmox VE update 2019-02-26 21:28:15 -05:00
ZFSPlugin-5.0-42_1.pm.patch Update the FreeNAS-API related files to the latest Proxmox VE 2019-05-11 11:13:54 -04:00
ZFSPlugin-5.0-44_1.pm.patch Patches created for latest 5.4 branch of Proxmox VE 2019-08-05 18:02:01 -04:00
ZFSPlugin-6.0-6_1.pm.patch Updated patches for the latest Proxmox VE updates and added donation 2019-08-07 22:57:22 -04:00
ZFSPlugin-6.0-8_1.pm.patch Update patch sets 2019-10-13 13:03:43 -04:00
ZFSPlugin-6.0-9_1.pm.patch Update patch sets 2019-10-13 13:03:43 -04:00
ZFSPlugin-7.1-1_1.pm.patch Update patches and some fixes. 2022-04-03 09:18:31 -04:00
ZFSPlugin-8.1.3_1.pm.patch Update for Proxmox 8 and Bearer Token 2024-01-06 13:43:35 -05:00
ZFSPlugin.pm.patch Update for Proxmox 8 and Bearer Token 2024-01-06 13:43:35 -05:00