From: Colin McCabe Subject: Re: [PATCHv2] cld: use XDR for all messages Date: Tue, 26 Jan 2010 13:22:36 -0800 Message-ID: <436f52801001261322k4f6273ccl9f6a21f6ccb123df@mail.gmail.com> References: <1263577788-2081-1-git-send-email-cmccabe@alumni.cmu.edu> <4B57B01F.5080903@garzik.org> <436f52801001201838l450fbe09i6f2f9d2b6ceebe6d@mail.gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=eH4q+jBO6TUtHYwMiwqP5ACLtWB48EIgvw1NbOyGLRo=; b=IO9ptlXGAt1LFK4cQW/1SR1oLUO34KdfPEYyZqW7I76i2HUHw4fcfd9uvf215vXCVT 08Yr13OK+ljAnclIObRVdoKE6K4taBUgIJeYSF67b8U34ZrkA9onesHv7QB3EIEaIWJZ KAgYzB/jJnvdrBGC095pxictJL2xT4rSLBdTU= In-Reply-To: <436f52801001201838l450fbe09i6f2f9d2b6ceebe6d@mail.gmail.com> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="iso-8859-1" To: Jeff Garzik Cc: Project Hail List , Pete Zaitcev Hi all, I'm currently reworking this patch to address the concerns mentioned here (mostly autotools-related). I'm also going to separate it into multiple patches. A few questions: I would really like cld_msg_rpc.h to show up in "include," for consistency with the other headers. Is it possible for cld_msg_rpc.x to live in lib/ and export the header into the include/ directory? I've been reading everything I can about automake, but I still haven't been able to figure out if this kind of cross-directory dependency between two directories at the same depth is possible. I really don't want to put cld_msg_rpc_xdr.c in include/. But so far I can't figure out how to have the header there, without the .c file... Colin On Wed, Jan 20, 2010 at 6:38 PM, Colin McCabe = wrote: > On Wed, Jan 20, 2010 at 5:38 PM, Jeff Garzik wrote: >> On 01/15/2010 12:49 PM, Colin McCabe wrote: >>> >>> This patch moves CLD from using manual data serialization to using = XDR >>> (via >>> rpcgen). Both the packet header and the message body are now serial= ized >>> and >>> deserialized using XDR. This makes it easy to have a variable-lengt= h >>> packet >>> header, as well as a variable-length message body. >>> >>> This patch introduces a minor libcldc API change in struct cldc_cal= l_opts. >>> >>> v2 changes: >>> * Added __cld prefix to functions in cld_fmt.c >>> >>> * When decoding CMT_GET messages, we should store the payload in th= e >>> session structure, rather than in cldc_call_opts. >>> >>> * Got rid of pkt_is_first, pkt_is_last, in favor of a flags-based >>> approach. >>> >>> * Killed CLD_MAX_PKT_MSG. It's more efficient to only allocate as m= uch >>> space >>> as you need, rather than always allocating space for 128 packets in= a >>> message. >>> >>> * Created CLD_MAX_PAYLOAD_SZ to mean the maximum size of the data t= hat can >>> be >>> sent with GET or PUT. This is different (and smaller than!) the max= imum >>> message size. >>> >>> * automake: Add cld_msg_rpc.h to BUILT_SOURCES >>> >>> * automake: Add lib dir to INCLUDES >>> >>> * automake: "make clean" now deletes XDR build products >>> >>> Signed-off-by: Colin McCabe >>> --- >>> =A0.gitignore =A0 =A0 =A0 =A0 =A0 =A0 | =A0 =A04 + >>> =A0include/Makefile.am =A0 =A0| =A0 =A02 +- >>> =A0include/cld_common.h =A0 | =A0 10 + >>> =A0include/cld_fmt.h =A0 =A0 =A0| =A0 89 +++++ >>> =A0include/cld_msg.h =A0 =A0 =A0| =A0252 ------------- >>> =A0include/cldc.h =A0 =A0 =A0 =A0 | =A0 36 +- >>> =A0lib/Makefile.am =A0 =A0 =A0 =A0| =A0 19 +- >>> =A0lib/cld_fmt.c =A0 =A0 =A0 =A0 =A0| =A0193 ++++++++++ >>> =A0lib/cld_msg_rpc.x =A0 =A0 =A0| =A0218 +++++++++++ >>> =A0lib/cldc.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0966 >>> +++++++++++++++++++++--------------------------- >>> =A0lib/common.c =A0 =A0 =A0 =A0 =A0 | =A0 =A06 +- >>> =A0server/Makefile.am =A0 =A0 | =A0 =A09 +- >>> =A0server/cld.h =A0 =A0 =A0 =A0 =A0 | =A0 97 ++++-- >>> =A0server/cldb.h =A0 =A0 =A0 =A0 =A0| =A0 =A02 +- >>> =A0server/msg.c =A0 =A0 =A0 =A0 =A0 | =A0304 ++++++---------- >>> =A0server/server.c =A0 =A0 =A0 =A0| =A0743 ++++++++++++++++++++----= ------------- >>> =A0server/session.c =A0 =A0 =A0 | =A0396 ++++++++++----------- >>> =A0test/Makefile.am =A0 =A0 =A0 | =A0 =A05 +- >>> =A0test/load-file-event.c | =A0 14 +- >>> =A0test/save-file-event.c | =A0 =A02 - >>> =A0tools/cldcli.c =A0 =A0 =A0 =A0 | =A0 22 +- >>> =A021 files changed, 1777 insertions(+), 1612 deletions(-) >>> =A0create mode 100644 include/cld_fmt.h >>> =A0delete mode 100644 include/cld_msg.h >>> =A0create mode 100644 lib/cld_fmt.c >>> =A0create mode 100644 lib/cld_msg_rpc.x >> >> Looking good... =A0we are definitely getting closer. >> >> Currently, it still does not pass "make distcheck", which presages a= lot of >> installation problems. =A0Notably, >> =A0 =A0 =A0 =A0#include >> is not consistent with the rest of the headers, producing things suc= h as >> "make distcheck" build breakage: > > I guess distcheck is pretty important to run when making a change lik= e > this. For some reason I forgot to try that. :( > >> >>> libtool: compile: =A0gcc -DHAVE_CONFIG_H -I. -I../../lib -I.. >>> -I../../include -pthread -I/usr/include/glib-2.0 >>> -I/usr/lib64/glib-2.0/include -g -O2 -MT cldc.lo -MD -MP -MF .deps/= cldc.Tpo >>> -c ../../lib/cldc.c =A0-fPIC -DPIC -o .libs/cldc.o >>> In file included from ../../lib/cldc.c:37: >>> ../../include/cldc.h:26:29: error: lib/cld_msg_rpc.h: No such file = or >>> directory >> >> You will either need to move the header to $cld/include/ or update I= NCLUDES >> in various */Makefile.am files to reference $(top_srcdir)/lib (which= I see >> you actually did, in a few cases). >> >> Also, it would be nice if this did not introduce warnings. =A0A big = point with >> the testsuite, and minor point with compiler warnings, is that -- mo= re than >> anything else -- we do not want to introduce regressions. > > When I did "make all" with -Wall, the only warnings I saw were from > the generated xdr serialization files. I'd like to figure out how to > suppress those (we really should somehow tack -Wnone onto the CFLAGs > of machine-generated files), but I haven't figured out how to do that > yet. > > I was thinking of doing it in a follow-on change, since this change i= s > already pretty big. > > Colin >