[pve-devel] activate_storage executed cyclically

Jasmin J. jasmin at anw.at
Sun Dec 11 00:24:28 CET 2016


Hi!

I am just analysing the Storage class and plugins and discovered that
activate_storage in Storage.pm and also activate_storage in the plugins is
executed cyclically.

The reason is, that "cache" is always a new hash and therefore
   "if $cache->{activated}->{$storeid};" in activate_storage(Storage.pm) will
be never true.

I printed a call stack and found this:
   pvestatd.pm::update_storage_status -> PVE::Storage::storage_info

PVE::Storage::storage_info uses always a fresh hash:
   my $info = {};
when calling
   PVE::Storage::activate_storage
And even PVE::Storage::activate_storage may use a fresh hash:
   $cache = {} if !$cache;

Is this an intended behaviour?
If yes, I can't rely in a storage plugin on the stored cache data.
   What is the intention of the cache, if it is always new?

BR,
    Jasmin



More information about the pve-devel mailing list