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

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




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 redhat com>
> ---
>  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); ?


Reviewed-by: John Ferlan <jferlan redhat com>


John

[...]


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