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

Martin Kletzander mkletzan at redhat.com
Thu Mar 10 14:32:27 UTC 2016


On Thu, Mar 10, 2016 at 03:26:04PM +0100, Ján Tomko wrote:
>On Thu, Mar 10, 2016 at 05:54:09AM +0100, Martin Kletzander wrote:
>> Signed-off-by: Martin Kletzander <mkletzan at 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.
>

Looking at other similar lines we just don't care about the line
lengths.  Having said that, I'm OK with splitting them, but in the whole
file at once, if anyone wants to tackle that.

>> @@ -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.
>

Yes, fixed, thanks.

>ACK minus the hunk error_msg hunk.
>
>Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160310/c1483061/attachment-0001.sig>


More information about the libvir-list mailing list