[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 04/10 V2] remote generator: Handle (unsigned) int arrays



Signed-off-by: Lai Jiangshan <laijs cn fujitsu com>
---
 daemon/remote_generator.pl |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl
index 632972c..532fe63 100755
--- a/daemon/remote_generator.pl
+++ b/daemon/remote_generator.pl
@@ -407,6 +407,13 @@ elsif ($opt_b) {
                     }
 
                     push(@args_list, "args->$2.$2_len");
+                } elsif ($args_member =~ m/^(?:unsigned )?int (\S+)<\S+>;/) {
+                    if (! @args_list) {
+                        push(@args_list, "conn");
+                    }
+
+                    push(@args_list, "args->$1.$1_val");
+                    push(@args_list, "args->$1.$1_len");
                 } elsif ($args_member =~ m/^remote_typed_param (\S+)<(\S+)>;/) {
                     push(@vars_list, "virTypedParameterPtr $1 = NULL");
                     push(@vars_list, "int n$1");
@@ -985,6 +992,16 @@ elsif ($opt_k) {
                     push(@setters_list, "args.$arg_name.${arg_name}_val = (char *)$arg_name;");
                     push(@setters_list, "args.$arg_name.${arg_name}_len = ${arg_name}len;");
                     push(@args_check_list, { name => "\"$arg_name\"", arg => "${arg_name}len", limit => $limit });
+                } elsif ($args_member =~ m/^((?:unsigned )?int) (\S+)<(\S+)>;/) {
+                    my $type_name = $1;
+                    my $arg_name = $2;
+                    my $limit = $3;
+
+                    push(@args_list, "${type_name} *$arg_name");
+                    push(@args_list, "unsigned int ${arg_name}len");
+                    push(@setters_list, "args.$arg_name.${arg_name}_val = $arg_name;");
+                    push(@setters_list, "args.$arg_name.${arg_name}_len = ${arg_name}len;");
+                    push(@args_check_list, { name => "\"$arg_name\"", arg => "${arg_name}len", limit => $limit });
                 } elsif ($args_member =~ m/^remote_typed_param (\S+)<(\S+)>;/) {
                     push(@args_list, "virTypedParameterPtr $1");
                     push(@args_list, "int n$1");
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]