• N
    vz: cleanup loading domain code · cfc68155
    Nikolay Shirokovskiy 提交于
      9c14a9ab introduced vzNewDomain function to enlist libvirt domain
    object before actually creating vz sdk domain. Fix should fix
    race on same vz sdk domain added event where libvirt domain object is
    enlisted too. But later eb5e9c1e added locked checks for
    adding livirtd domain object to list on vz sdk domain added event.
    Thus now approach of 9c14a9ab is unnecessary complicated.
    
      See we have otherwise unuseful prlsdkGetDomainIds function only
    to create minimal domain definition to create libvirt domain object.
    Also vzNewDomain is difficult to use as it creates partially
    constructed domain object.
    
      Let's move back to original approach where prlsdkLoadDomain do
    all the necessary job. Another benefit is that we can now
    take driver lock for bare minimum and in single place. Reducing
    locking time have small disadvatage of double parsing on race
    conditions which is typical if domain is added thru vz driver.
    Well we have this double parse inevitably with current vz sdk api
    on any domain updates so i would not take it here seriously.
    
      Performance events subscribtion is done before locked check and
    therefore could be done twice on races but this is not the problem.
    Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
    cfc68155
vz_sdk.h 3.8 KB