[PATCH] rpc: Use struct zero initializer for args

Michal Privoznik posted 1 patch 1 year, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/c98db758079822345b87fd07d064a9748cedf794.1674750123.git.mprivozn@redhat.com
src/rpc/gendispatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] rpc: Use struct zero initializer for args
Posted by Michal Privoznik 1 year, 3 months ago
In a recent commit of v9.0.0-104-g0211e430a8 I've turned all args
vars in src/remote/remote_driver.c to be initialized wit {0}.
What I've missed was the generated code.

Do what we've done in v9.0.0-13-g1c656836e3 and init also args,
not just ret.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/rpc/gendispatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index e9dc8e27d7..085e2a29d8 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -1330,7 +1330,7 @@ elsif ($mode eq "client") {
         if ($argtype eq "void") {
             $call_args = "NULL";
         } else {
-            push(@vars_list, "$argtype args");
+            push(@vars_list, "$argtype args = {0}");
 
             my $is_first_arg = 1;
             my $has_node_device = 0;
-- 
2.39.1
Re: [PATCH] rpc: Use struct zero initializer for args
Posted by Daniel P. Berrangé 1 year, 3 months ago
On Thu, Jan 26, 2023 at 05:22:03PM +0100, Michal Privoznik wrote:
> In a recent commit of v9.0.0-104-g0211e430a8 I've turned all args
> vars in src/remote/remote_driver.c to be initialized wit {0}.
> What I've missed was the generated code.
> 
> Do what we've done in v9.0.0-13-g1c656836e3 and init also args,
> not just ret.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/rpc/gendispatch.pl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With 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 :|