From: Colin McCabe Subject: Re: [PATCHv2] cld: use XDR for all messages Date: Wed, 20 Jan 2010 18:38:52 -0800 Message-ID: <436f52801001201838l450fbe09i6f2f9d2b6ceebe6d@mail.gmail.com> References: <1263577788-2081-1-git-send-email-cmccabe@alumni.cmu.edu> <4B57B01F.5080903@garzik.org> 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=M/hPnhcxK55POSujPxwGA8RlnFY6WRwHpi4DOk6O+lU=; b=Wo/d4kYlXVaknRqFLPk7CqIXhF8pFV/SRpI46wviC+XIhkARu6Ua0Jg5jxKkNpYYVe EGf+lIKc/aZ81qDjeUJ4dFGn/k1T8aK491l9wzCn/4kF5wIVFAsFX5MfIlKNAqJRNVCR mUlWk0pZiTlA2GAZhgZCvKjmsuBLxEE9zYtIc= In-Reply-To: <4B57B01F.5080903@garzik.org> 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 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 X= DR >> (via >> rpcgen). Both the packet header and the message body are now seriali= zed >> and >> deserialized using XDR. This makes it easy to have a variable-length >> packet >> header, as well as a variable-length message body. >> >> This patch introduces a minor libcldc API change in struct cldc_call= _opts. >> >> v2 changes: >> * Added __cld prefix to functions in cld_fmt.c >> >> * When decoding CMT_GET messages, we should store the payload in the >> 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 mu= ch >> 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 th= at can >> be >> sent with GET or PUT. This is different (and smaller than!) the maxi= mum >> 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 such= as > "make distcheck" build breakage: I guess distcheck is pretty important to run when making a change like 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/c= ldc.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 o= r >> directory > > You will either need to move the header to $cld/include/ or update IN= CLUDES > 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 p= oint with > the testsuite, and minor point with compiler warnings, is that -- mor= e 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 is already pretty big. Colin