[libvirt] [PATCH 5/7] remote: use a separate connection for nwfilter APIs

Daniel P. Berrangé posted 7 patches 7 years, 8 months ago
There is a newer version of this series
[libvirt] [PATCH 5/7] remote: use a separate connection for nwfilter APIs
Posted by Daniel P. Berrangé 7 years, 8 months ago
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/remote/remote_daemon.h          | 1 +
 src/remote/remote_daemon_dispatch.c | 3 +++
 src/rpc/gendispatch.pl              | 6 ++++++
 3 files changed, 10 insertions(+)

diff --git a/src/remote/remote_daemon.h b/src/remote/remote_daemon.h
index 517eec1fc2..1b906401d3 100644
--- a/src/remote/remote_daemon.h
+++ b/src/remote/remote_daemon.h
@@ -77,6 +77,7 @@ struct daemonClientPrivate {
     virConnectPtr interfaceConn;
     virConnectPtr networkConn;
     virConnectPtr nodedevConn;
+    virConnectPtr nwfilterConn;
 
     daemonClientStreamPtr streams;
 };
diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
index baa4f1eadc..dcfc0abf46 100644
--- a/src/remote/remote_daemon_dispatch.c
+++ b/src/remote/remote_daemon_dispatch.c
@@ -1746,6 +1746,8 @@ void remoteClientFree(void *data)
         virConnectClose(priv->networkConn);
     if (priv->nodedevConn)
         virConnectClose(priv->nodedevConn);
+    if (priv->nwfilterConn)
+        virConnectClose(priv->nwfilterConn);
 
     VIR_FREE(priv);
 }
@@ -1823,6 +1825,7 @@ remoteDispatchConnectOpen(virNetServerPtr server ATTRIBUTE_UNUSED,
     priv->interfaceConn = virObjectRef(priv->conn);
     priv->networkConn = virObjectRef(priv->conn);
     priv->nodedevConn = virObjectRef(priv->conn);
+    priv->nwfilterConn = virObjectRef(priv->conn);
 
     /* force update the @readonly attribute which was inherited from the
      * virNetServerService object - this is important for sockets that are RW
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index 0e7567fbde..d8ab8b17dd 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -134,6 +134,9 @@ sub get_conn_arg {
         if ($type =~ /remote_nonnull_node_device/) {
             return "priv->nodedevConn";
         }
+        if ($type =~ /remote_nonnull_nwfilter/) {
+            return "priv->nwfilterConn";
+        }
     }
 
     # This is for the few virConnect APIs that
@@ -148,6 +151,9 @@ sub get_conn_arg {
     if ($proc =~ /Node.*Device/) {
         return "priv->nodedevConn";
     }
+    if ($proc =~ /Connect.*NWFilter/) {
+        return "priv->nodedevConn";
+    }
 
     return "priv->conn";
 }
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 5/7] remote: use a separate connection for nwfilter APIs
Posted by John Ferlan 7 years, 8 months ago

On 03/28/2018 11:18 AM, Daniel P. Berrangé wrote:
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  src/remote/remote_daemon.h          | 1 +
>  src/remote/remote_daemon_dispatch.c | 3 +++
>  src/rpc/gendispatch.pl              | 6 ++++++
>  3 files changed, 10 insertions(+)
> 

[...]

> diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
> index 0e7567fbde..d8ab8b17dd 100755
> --- a/src/rpc/gendispatch.pl
> +++ b/src/rpc/gendispatch.pl
> @@ -134,6 +134,9 @@ sub get_conn_arg {
>          if ($type =~ /remote_nonnull_node_device/) {
>              return "priv->nodedevConn";
>          }
> +        if ($type =~ /remote_nonnull_nwfilter/) {
> +            return "priv->nwfilterConn";
> +        }
>      }
>  
>      # This is for the few virConnect APIs that
> @@ -148,6 +151,9 @@ sub get_conn_arg {
>      if ($proc =~ /Node.*Device/) {
>          return "priv->nodedevConn";
>      }
> +    if ($proc =~ /Connect.*NWFilter/) {
> +        return "priv->nodedevConn";

s/nodedev/nwfilter

w/ the adjustment...

Reviewed-by: John Ferlan <jferlan@redhat.com>

John
> +    }
>  
>      return "priv->conn";
>  }
> 

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