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

Re: [libvirt] [PATCH 20/21] gendispatch: Support modern listing of more types



On Thu, Mar 10, 2016 at 05:54:09AM +0100, Martin Kletzander wrote:
> Signed-off-by: Martin Kletzander <mkletzan redhat com>
> ---
>  src/rpc/gendispatch.pl | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
> index 21f16d19bbed..5e800ab05e41 100755
> --- a/src/rpc/gendispatch.pl
> +++ b/src/rpc/gendispatch.pl
> @@ -649,7 +649,7 @@ elsif ($mode eq "server") {
>                          if (!$modern_ret_as_list) {
>                              push(@ret_list, "ret->$3 = tmp.$3;");
>                          }
> -                    } elsif ($ret_member =~ m/admin_nonnull_(server) (\S+)<(\S+)>;/) {
> +                    } elsif ($ret_member =~ m/(?:admin|remote)_nonnull_(secret|nwfilter|node_device|interface|network|storage_vol|storage_pool|domain_snapshot|domain|server) (\S+)<(\S+)>;/) {
>                          $modern_ret_struct_name = $1;
>                          $single_ret_list_error_msg_type = $1;
>                          $single_ret_list_name = $2;
> @@ -1401,7 +1401,7 @@ elsif ($mode eq "client") {
>                          }
> 
>                          push(@ret_list, "memcpy(result->$3, ret.$3, sizeof(result->$3));");
> -                    } elsif ($ret_member =~ m/admin_nonnull_(server) (\S+)<(\S+)>;/) {
> +                    } elsif ($ret_member =~ m/(?:admin|remote)_nonnull_(secret|nwfilter|node_device|interface|network|storage_vol|storage_pool|domain_snapshot|domain|server) (\S+)<(\S+)>;/) {
>                          my $proc_name = name_to_TypeName($1);
> 
>                          if ($structprefix eq "admin") {

These lines are way too long. I don't know whether splitting the regex
over multiple lines with /x or putting parts of it in a separate
variable is the preferred way.

> @@ -1413,6 +1413,7 @@ elsif ($mode eq "client") {
>                          $modern_ret_struct_name = $1;
>                          $single_ret_list_name = $2;
>                          $single_ret_list_max_var = $3;
> +                        $single_ret_list_error_msg_type = $1;
> 
>                          $modern_ret_as_list = 1;
>                      } elsif ($ret_member =~ m/<\S+>;/ or $ret_member =~ m/\[\S+\];/) {

This hunk should be in the commit adding the other assignments.

ACK minus the hunk error_msg hunk.

Jan


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