[libvirt] [PATCH v4 1/2] rpc: When adding srv to dmn servers, need to add ref

Nikolay Shirokovskiy nshirokovskiy at virtuozzo.com
Fri Oct 27 11:40:58 UTC 2017

On 27.10.2017 14:20, John Ferlan wrote:
> On 10/27/2017 02:29 AM, Nikolay Shirokovskiy wrote:
>> On 27.10.2017 08:26, John Ferlan wrote:
>>> From: Nikolay Shirokovskiy <nshirokovskiy at virtuozzo.com>
>>> Commit id '252610f7d' modified net server management to use a
>>> hash table to store/manage the various servers; however, during
>>> virNetDaemonAddServerPostExec an @srv object is created, added
>>> to the dmn->servers hash table, but did not increment the object
>>> refcnt like was done during virNetDaemonAddServer as if @srv
>>> were being created for the first time.
>> I'm not agree that 252610f7d introduced the problem. Before this
>> commit the situation was the same as now. virNetDaemonAddServer
>> takes extra reference, virNetDaemonAddServerPostExec does not
>> take extra reference, virNetDaemonDispose unref every server
>> in array (just as hash table does). lock daemon does not store
>> object returned by virNetDaemonAddServerPostExec and log daemon
>> store the object and unref it in virLogDaemonFree.
> So I dug deeper and can alter the commit message to:
> Commit id 'fa1420736' introduced virNetDaemonAddServerPostExec
> and virNetDaemonAddServer; however, for the former when adding
> @srv to the dmn->servers list, there was no corresponding virObjectRef
> as there was in the latter.
> Commit id '252610f7d' modified net server management to use a
> hash table to store/manage the various servers and did not alter
> the code to add the object reference.

I still think 252610f7d is not related. Commit only change the way
servers list is stored not be way their reference are managed.

Particularly virNetDaemonAddServerPostExec does not make ref before
252610f7d so the commit supposes it ok.


More information about the libvir-list mailing list