Fix bugs in loading plugin set 01/314201/4
authorAdam Michalski <a.michalski2@partner.samsung.com>
Thu, 4 Jul 2024 09:47:59 +0000 (11:47 +0200)
committerAdam Michalski <a.michalski2@partner.samsung.com>
Thu, 11 Jul 2024 12:04:48 +0000 (14:04 +0200)
commit08331ae017c52a1d1ceef5f34f38a90b60b210c9
treeb4d74d952847ff96f26c8c227bcaed17fef7ae80
parent41614640be779ce133989bf733ba12e1efb5b040
Fix bugs in loading plugin set

Fixes in the LoadPluginSet() function:
- the naming scheme for backend libraries is "libTYPE.so", where TYPE
  is the backend type (e.g. for tpk it should load libtpk.so)
- elements of the global plugin_set_list array should be allocated
  every time a new backend library is loaded as this behaviour is
  expected by the backend api: pkg_plugin_on_load() function expects
  its input parameter to be an already allocated memory area, otherwise
  it returns -1 and the LoadPluginSet() reports a failure:

    extern "C" int pkg_plugin_on_load(pkg_plugin_set* set) {
      if (set == nullptr)
        return -1;
      set->plugin_on_unload = PluginOnUnload;
      ...
    }

Change-Id: I603030871a28f050f1d87ce572c102c3d0b5dc90
client/src/internal.cc