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

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

 



On Tue, Jun 07, 2011 at 05:11:11PM +0800, Lai Jiangshan wrote:
> Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
> ---
>  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");

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]