[libvirt] [PATCH] Invoke PortableXDR's rpcgen if available

We discovered over the new year that the XDR code in glibc, which was derived from some original Sun code, doesn't have an unambiguously free license[1]. Furthermore the rpcgen in glibc is unmaintained and produces such bad code that we have to run a Perl script over it in order to correct some egregious errors. Sun/glibc rpcgen code also contains all sorts of strange micro-optimizations that were probably good back in 1988, but don't make so much sense now. Also rpcgen was implemented directly in C, so we took this chance to use flex/bison for more accurate and faster parsing. For these reasons we are rewriting the XDR code and the rpcgen tool with a free license[2]. I'm pleased to say that as a result of this effort we've rewritten rpcgen already: http://git.et.redhat.com/?p=portablexdr.git;a=summary To avoid conflicts, the new rpcgen will be installed as 'portable-rpcgen'. The attached patch changes libvirt's configure so that if it finds 'portable-rpcgen' on the path, it uses it in preference to 'rpcgen'. Also attached are the updated remote_protocol.[ch] files (ie. the files which are generated from remote_protocol.x by portable-rpcgen). I'm not suggesting we use these quite yet, because (a) they still generate some warnings, and (b) they need a lot more testing. However I think the patch is safe enough. Rich. [1] For more about this, see this message and the reply: https://www.redhat.com/archives/fedora-legal-list/2008-December/msg00022.htm... [2] LGPLv2+ for the library parts and GPLv2+ for the rpcgen program. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v

On Mon, Jan 12, 2009 at 04:34:25PM +0000, Richard W.M. Jones wrote:
We discovered over the new year that the XDR code in glibc, which was derived from some original Sun code, doesn't have an unambiguously free license[1]. Furthermore the rpcgen in glibc is unmaintained and produces such bad code that we have to run a Perl script over it in order to correct some egregious errors. Sun/glibc rpcgen code also contains all sorts of strange micro-optimizations that were probably good back in 1988, but don't make so much sense now. Also rpcgen was implemented directly in C, so we took this chance to use flex/bison for more accurate and faster parsing.
For these reasons we are rewriting the XDR code and the rpcgen tool with a free license[2]. I'm pleased to say that as a result of this effort we've rewritten rpcgen already:
http://git.et.redhat.com/?p=portablexdr.git;a=summary
To avoid conflicts, the new rpcgen will be installed as 'portable-rpcgen'.
The attached patch changes libvirt's configure so that if it finds 'portable-rpcgen' on the path, it uses it in preference to 'rpcgen'.
ACK To the configure.ac bit of the patch.
if (!xdr_u_quad_t (xdrs, &objp->cpu_time)) return FALSE;
It'd be good to have portable-xdr not generate code with the 'quad' related methods, since thy don't exist on Solaris - it has int64 named ones instead. Linux should have both I believe. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Wed, Jan 14, 2009 at 10:50:30PM +0000, Daniel P. Berrange wrote:
On Mon, Jan 12, 2009 at 04:34:25PM +0000, Richard W.M. Jones wrote:
We discovered over the new year that the XDR code in glibc, which was derived from some original Sun code, doesn't have an unambiguously free license[1]. Furthermore the rpcgen in glibc is unmaintained and produces such bad code that we have to run a Perl script over it in order to correct some egregious errors. Sun/glibc rpcgen code also contains all sorts of strange micro-optimizations that were probably good back in 1988, but don't make so much sense now. Also rpcgen was implemented directly in C, so we took this chance to use flex/bison for more accurate and faster parsing.
For these reasons we are rewriting the XDR code and the rpcgen tool with a free license[2]. I'm pleased to say that as a result of this effort we've rewritten rpcgen already:
http://git.et.redhat.com/?p=portablexdr.git;a=summary
To avoid conflicts, the new rpcgen will be installed as 'portable-rpcgen'.
The attached patch changes libvirt's configure so that if it finds 'portable-rpcgen' on the path, it uses it in preference to 'rpcgen'.
ACK To the configure.ac bit of the patch.
if (!xdr_u_quad_t (xdrs, &objp->cpu_time)) return FALSE;
It'd be good to have portable-xdr not generate code with the 'quad' related methods, since thy don't exist on Solaris - it has int64 named ones instead. Linux should have both I believe.
I'm using xdr_uint64_t (etc) functions from glibc which were contributed separately and so not under Sun's license. However, there will be macros so that either form can be used in the end-user code. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
participants (2)
-
Daniel P. Berrange
-
Richard W.M. Jones