[libvirt PATCH 10/15] rpc: replace VIR_FREE with g_free in all *Dispose() functions

Daniel Henrique Barboza danielhb413 at gmail.com
Thu Feb 4 21:20:55 UTC 2021


This patch does not apply cleanly. The reason:


On 2/4/21 1:38 AM, Laine Stump wrote:
> Signed-off-by: Laine Stump <laine at redhat.com>
> ---
>   src/rpc/virnetclient.c        |  4 ++--
>   src/rpc/virnetdaemon.c        |  6 +++---
>   src/rpc/virnetlibsshsession.c | 18 +++++++++---------
>   src/rpc/virnetsaslcontext.c   |  2 +-
>   src/rpc/virnetserver.c        |  8 ++++----
>   src/rpc/virnetserverservice.c |  2 +-
>   src/rpc/virnetsocket.c        |  6 +++---
>   src/rpc/virnetsshsession.c    |  8 ++++----
>   src/rpc/virnettlscontext.c    |  6 +++---
>   9 files changed, 30 insertions(+), 30 deletions(-)
> 
> diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
> index 2eabacd6e8..edd65941ac 100644
> --- a/src/rpc/virnetclient.c
> +++ b/src/rpc/virnetclient.c
> @@ -747,12 +747,12 @@ void virNetClientDispose(void *obj)
>   


[...]


>   
>   
> diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c
> index 5bfe311544..f42aed3f62 100644
> --- a/src/rpc/virnetsshsession.c
> +++ b/src/rpc/virnetsshsession.c
> @@ -151,10 +151,10 @@ virNetSSHSessionDispose(void *obj)
>   
>       virNetSSHSessionAuthMethodsClear(sess);
>   
> -    VIR_FREE(sess->channelCommand);
> -    VIR_FREE(sess->hostname);
> -    VIR_FREE(sess->knownHostsFile);
> -    VIR_FREE(sess->authPath);
> +    g_free(sess->channelCommand);
> +    g_free(sess->hostname);
> +    g_free(sess->knownHostsFile);
> +    g_free(sess->authPath);
>   }
>   


This chunk here is referencing virNetSSHSessionAuthMethodsClear(). The name of the
function in the master branch is virNetSSHSessionAuthMethodsFree().

It seems to me that you had patch 24 of the previous series applied in the tree
when doing this series, and this is why the patch is considering the renamed
function.

This patch itself looks fine to me otherwise. You can either fix it to be
applicable based on master, or you can push the other series that has

"[libvirt PATCH v2 24/24] rpc: rename virNetSessionAuthMethodsFree to
virNetSessionAuthMethodsClear"

before pushing this one.


Thanks,


DHB





>   static virClassPtr virNetSSHSessionClass;
> diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c
> index 84f7e63e4d..2936b8ba57 100644
> --- a/src/rpc/virnettlscontext.c
> +++ b/src/rpc/virnettlscontext.c
> @@ -1146,7 +1146,7 @@ void virNetTLSContextDispose(void *obj)
>       PROBE(RPC_TLS_CONTEXT_DISPOSE,
>             "ctxt=%p", ctxt);
>   
> -    VIR_FREE(ctxt->priority);
> +    g_free(ctxt->priority);
>       gnutls_dh_params_deinit(ctxt->dhParams);
>       gnutls_certificate_free_credentials(ctxt->x509cred);
>   }
> @@ -1415,8 +1415,8 @@ void virNetTLSSessionDispose(void *obj)
>       PROBE(RPC_TLS_SESSION_DISPOSE,
>             "sess=%p", sess);
>   
> -    VIR_FREE(sess->x509dname);
> -    VIR_FREE(sess->hostname);
> +    g_free(sess->x509dname);
> +    g_free(sess->hostname);
>       gnutls_deinit(sess->session);
>   }
>   
> 




More information about the libvir-list mailing list