Re: [PATCHv2 6/6] remote: remove special case for getting version

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

 



2011/5/18 Eric Blake <eblake@xxxxxxxxxx>:
> The on-the-wire protocol is identical; XDR guarantees that
> both 'hyper' and 'unsigned hyper' are transmitted as 8 bytes.
>
> * src/remote/remote_protocol.x (remote_get_version_ret)
> (remote_get_lib_version_ret): Match public API.
> * daemon/remote_generator.pl: Drop special case.
> * src/remote_protocol-structs: Reflect updated type.
> ---
>
> v2: fix src/remote_protocol-structs
> v1: reviewed but no ACK at:
> https://www.redhat.com/archives/libvir-list/2011-May/msg00718.html
>
> Âdaemon/remote_generator.pl  |  23 +++++++++--------------
> Âsrc/remote/remote_protocol.x | Â Â4 ++--
> Âsrc/remote_protocol-structs Â| Â Â4 ++--
> Â3 files changed, 13 insertions(+), 18 deletions(-)
>
> diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl
> index a3b8421..1fc3b17 100755
> --- a/daemon/remote_generator.pl
> +++ b/daemon/remote_generator.pl

> @@ -995,19 +988,21 @@ elsif ($opt_k) {
> Â Â Â Â Â Â Â Â Â Â $single_ret_type = "int";
> Â Â Â Â Â Â Â Â } elsif ($ret_member =~ m/^unsigned hyper (\S+);/) {
> Â Â Â Â Â Â Â Â Â Â my $arg_name = $1;
> - Â Â Â Â Â Â Â Â Â Âpush(@ret_list, "rv = ret.$arg_name;");
> - Â Â Â Â Â Â Â Â Â Â$single_ret_var = "unsigned long rv = 0";
> - Â Â Â Â Â Â Â Â Â Â$single_ret_type = "unsigned long";
> - Â Â Â Â Â Â Â Â} elsif ($ret_member =~ m/^hyper (\S+);/) {
> - Â Â Â Â Â Â Â Â Â Âmy $arg_name = $1;
> -
> Â Â Â Â Â Â Â Â Â Â if ($call->{ProcName} =~ m/Get(Lib)?Version/) {
> Â Â Â Â Â Â Â Â Â Â Â Â push(@args_list, "unsigned long *$arg_name");
> Â Â Â Â Â Â Â Â Â Â Â Â push(@ret_list, "if ($arg_name) *$arg_name = ret.$arg_name;");
> Â Â Â Â Â Â Â Â Â Â Â Â push(@ret_list, "rv = 0;");
> Â Â Â Â Â Â Â Â Â Â Â Â $single_ret_var = "int rv = -1";
> Â Â Â Â Â Â Â Â Â Â Â Â $single_ret_type = "int";
> - Â Â Â Â Â Â Â Â Â Â} elsif ($call->{ProcName} eq "NodeGetFreeMemory") {
> + Â Â Â Â Â Â Â Â Â Â} else {
> + Â Â Â Â Â Â Â Â Â Â Â Âpush(@ret_list, "rv = ret.$arg_name;");
> + Â Â Â Â Â Â Â Â Â Â Â Â$single_ret_var = "unsigned long rv = 0";
> + Â Â Â Â Â Â Â Â Â Â Â Â$single_ret_type = "unsigned long";
> + Â Â Â Â Â Â Â Â Â Â}
> + Â Â Â Â Â Â Â Â} elsif ($ret_member =~ m/^hyper (\S+);/) {
> + Â Â Â Â Â Â Â Â Â Âmy $arg_name = $1;
> +
> + Â Â Â Â Â Â Â Â Â Âif ($call->{ProcName} eq "NodeGetFreeMemory") {
> Â Â Â Â Â Â Â Â Â Â Â Â push(@ret_list, "rv = ret.$arg_name;");
> Â Â Â Â Â Â Â Â Â Â Â Â $single_ret_var = "unsigned long long rv = 0";
> Â Â Â Â Â Â Â Â Â Â Â Â $single_ret_type = "unsigned long long";

I tested that a new virsh connected to an old libvirtd still gives the
right version number.

ACK.

Matthias

--
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]