[libvirt] [PATCH 1/7] rpc: refactor way connection object is generated for remote dispatch

Daniel P. Berrangé berrange at redhat.com
Thu Apr 5 10:19:55 UTC 2018


On Wed, Apr 04, 2018 at 01:41:54PM -0400, John Ferlan wrote:
> 
> 
> On 03/28/2018 11:18 AM, Daniel P. Berrangé wrote:
> > Calling a push_privconn method to directly push the connection object
> > name into the arg list is inconvenient. Refactor so that we acquire
> > the connection variable name upfront, and push it to the arg list
> > separately. This allows various hardcoded usage of "priv->conn" to
> > be parameterized.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> > ---
> >  src/rpc/gendispatch.pl | 48 ++++++++++++++++++++++--------------------------
> >  1 file changed, 22 insertions(+), 26 deletions(-)
> > 
> > diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
> > index fb15cc4849..e11921f3d9 100755
> > --- a/src/rpc/gendispatch.pl
> > +++ b/src/rpc/gendispatch.pl
> 
> [...]
> 
> > @@ -1002,7 +998,7 @@ elsif ($mode eq "server") {
> >          if ($structprefix eq "admin") {
> >              print "    if (!priv->dmn) {\n";
> >          } else {
> > -            print "    if (!priv->conn) {\n";
> > +            print "    if (!$conn) {\n";
> >          }
> 
> Shouldn't this just be "if (!$conn) {\n" for both halves of the if else?

Oh yes, we can simplify that because $conn already accounts for the 'dmn'
vs 'conn' difference.

> 
> w/ slight adjustment,
> 
> Reviewed-by: John Ferlan <jferlan at redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list