[libvirt] genprotocol.pl generates unstable output

Martin Kletzander mkletzan at redhat.com
Wed Oct 14 10:51:37 UTC 2015

On Thu, Oct 01, 2015 at 08:44:55AM +0200, Olaf Hering wrote:
>If the same source gets built twice the resulting files may differ.
>One example is this:
>[  305s] /usr/bin/perl -w ./rpc/genprotocol.pl /usr/bin/rpcgen -c \
>[  305s]        remote/remote_protocol.x ./remote/remote_protocol.c
>[  577s] /usr/src/debug/libvirt-20150929T082652.68572de/src/remote/remote_protocol.c differs (C source, ASCII text)
>[  577s] --- old//usr/src/debug/libvirt-20150929T082652.68572de/src/remote/remote_protocol.c    2015-09-30 11:34:31.000000000 +0000
>[  577s] +++ new//usr/src/debug/libvirt-20150929T082652.68572de/src/remote/remote_protocol.c    2015-09-30 14:57:39.000000000 +0000
>[  577s] @@ -2084,8 +2084,8 @@
>[  577s]  bool_t
>[  577s]  xdr_remote_domain_get_vcpus_ret (XDR *xdrs, remote_domain_get_vcpus_ret *objp)
>[  577s]  {
>[  577s] -        char **objp_cpp1 = (char **) (void *) &objp->cpumaps.cpumaps_val;
>[  577s]          char **objp_cpp0 = (char **) (void *) &objp->info.info_val;
>[  577s] +        char **objp_cpp1 = (char **) (void *) &objp->cpumaps.cpumaps_val;
>[  577s]

I don't see the problem, these pointers are not depending on each
other.  Or are you saying that it leaves your tree dirty?  Because
that has not happened to me and I believe others did not have a
problem with it either, otherwise this would happen a LOT of times.

>[  577s]           if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->info.info_len, REMOTE_VCPUINFO_MAX,
>[  577s]                  sizeof (remote_vcpu_info), (xdrproc_t) xdr_remote_vcpu_info))
>The input is like:
>xdr_remote_domain_get_vcpus_ret (XDR *xdrs, remote_domain_get_vcpus_ret *objp)
>        register int32_t *buf;
>         if (!xdr_array (xdrs, (char **)&objp->info.info_val, (u_int *) &objp->info.info_len, REMOTE_VCPUINFO_MAX,
>                sizeof (remote_vcpu_info), (xdrproc_t) xdr_remote_vcpu_info))
>                 return FALSE;
>         if (!xdr_bytes (xdrs, (char **)&objp->cpumaps.cpumaps_val, (u_int *) &objp->cpumaps.cpumaps_len, REMOTE_CPUMAPS_MAX))
>                 return FALSE;
>        return TRUE;
>Looks like the perl script transforms the pointers, but it does not sort them
>to enforce an order. I think its the map() which does it, but dont know enough
>perl to be sure.  How can this be fixed?

I don't know that much about perl myself and I don't quite get it from
the genprotocol.pl, but you could sort the output before printing, for
sure.  But I'm still more curious about how come that causes you
something that's not happening for me.

>libvir-list mailing list
>libvir-list at redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151014/63516261/attachment-0001.sig>

More information about the libvir-list mailing list