[libvirt] [PATCH] Fix remote_protocol header for Solaris

Richard W.M. Jones rjones at redhat.com
Mon Jan 12 18:29:38 UTC 2009


On Mon, Dec 15, 2008 at 09:55:19PM +0000, Daniel P. Berrange wrote:
> On Mon, Dec 15, 2008 at 11:05:10AM -0800, john.levon at sun.com wrote:
> > ++
> > ++#if defined(__sun)
> > ++#include <rpc/xdr.h>
> > ++#define u_quad_t uint64_t
> > ++#define quad_t int64_t
> > ++#define xdr_u_quad_t xdr_uint64_t
> > ++#define xdr_quad_t xdr_int64_t
> > ++#define IXDR_GET_LONG IXDR_GET_INT32
> 
> The Linux xdr.h seems to have both sets of definitions in all these
> cases, so I think we can just make rpcgen_fix.pl do this subsitution
> for us. Interestingly, it is already doing s/PUT_LONG/PUT_INT32/ because
> of broken PUT_LONG on Linux.

FYI PortableXDR's output doesn't need these macros at all.

Sun's rpcgen was making some strange micro-optimization based (it
appears) on the size of the structure.  If the size of the struct was
over some watermark, it would attempt to inline lots of code.  You can
see what I mean by comparing the output of these two commands:

  echo 'struct foo { int i0; int i1; int i2; };' | rpcgen -c -

  echo 'struct foo { int i0; int i1; int i2; int i3; };' | rpcgen -c -

In PortableXDR I decided to leave inlining decisions to gcc.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top




More information about the libvir-list mailing list