Re: [PATCH v3 11/31] virNetClientStreamNew: Track origin stream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/17/2017 01:13 PM, John Ferlan wrote:
> 
> 
> On 05/16/2017 10:03 AM, Michal Privoznik wrote:
>> Add a virStreamPtr pointer to the _virNetClientStream
>> in order to reverse track the parent stream.
>>
>> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
>> ---
>>  src/remote/remote_driver.c   | 6 ++++--
>>  src/rpc/gendispatch.pl       | 2 +-
>>  src/rpc/virnetclientstream.c | 6 +++++-
>>  src/rpc/virnetclientstream.h | 3 ++-
>>  4 files changed, 12 insertions(+), 5 deletions(-)
>>
> 
> [...]
> 
>> diff --git a/src/rpc/virnetclientstream.c b/src/rpc/virnetclientstream.c
>> index 2105bd0a9..01761cf8d 100644
>> --- a/src/rpc/virnetclientstream.c
>> +++ b/src/rpc/virnetclientstream.c
>> @@ -36,6 +36,8 @@ VIR_LOG_INIT("rpc.netclientstream");
>>  struct _virNetClientStream {
>>      virObjectLockable parent;
>>  
>> +    virStreamPtr stream; /* Reverse pointer to parent stream */
>> +
>>      virNetClientProgramPtr prog;
>>      int proc;
>>      unsigned serial;
>> @@ -133,7 +135,8 @@ virNetClientStreamEventTimer(int timer ATTRIBUTE_UNUSED, void *opaque)
>>  }
>>  
>>  
>> -virNetClientStreamPtr virNetClientStreamNew(virNetClientProgramPtr prog,
>> +virNetClientStreamPtr virNetClientStreamNew(virStreamPtr stream,
>> +                                            virNetClientProgramPtr prog,
>>                                              int proc,
>>                                              unsigned serial)
>>  {
>> @@ -145,6 +148,7 @@ virNetClientStreamPtr virNetClientStreamNew(virNetClientProgramPtr prog,
>>      if (!(st = virObjectLockableNew(virNetClientStreamClass)))
>>          return NULL;
>>  
>> +    st->stream = stream;
> 
> Should this be a virObjectRef(stream); ?

If so, then virNetClientStreamDispose needs to call unref() to match it.
I can do that. Consider done.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux