[libvirt] [PATCH 1/7] rpc: refactor way connection object is generated for remote dispatch
John Ferlan
jferlan at redhat.com
Wed Apr 4 17:41:54 UTC 2018
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?
w/ slight adjustment,
Reviewed-by: John Ferlan <jferlan at redhat.com>
John
>
> print " virReportError(VIR_ERR_INTERNAL_ERROR, \"%s\", _(\"connection not open\"));\n";
> @@ -1034,7 +1030,7 @@ elsif ($mode eq "server") {
> }
>
[...]
More information about the libvir-list
mailing list