From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=54520 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJ6WF-0004AC-4m for qemu-devel@nongnu.org; Thu, 18 Nov 2010 10:35:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJ6WD-0003wz-L4 for qemu-devel@nongnu.org; Thu, 18 Nov 2010 10:35:26 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:39784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJ6WD-0003wj-HM for qemu-devel@nongnu.org; Thu, 18 Nov 2010 10:35:25 -0500 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by e7.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id oAIFIVKV011068 for ; Thu, 18 Nov 2010 10:18:31 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oAIFZNUb386764 for ; Thu, 18 Nov 2010 10:35:23 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oAIFZMgT015660 for ; Thu, 18 Nov 2010 10:35:23 -0500 Message-ID: <4CE547B8.7000309@linux.vnet.ibm.com> Date: Thu, 18 Nov 2010 09:35:20 -0600 From: Michael Roth MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC][PATCH v3 01/21] virtproxy: base data structures and constants References: <1289870175-14880-1-git-send-email-mdroth@linux.vnet.ibm.com> <1289870175-14880-2-git-send-email-mdroth@linux.vnet.ibm.com> <4CE508AA.7000405@redhat.com> In-Reply-To: <4CE508AA.7000405@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes Sorensen Cc: agl@linux.vnet.ibm.com, abeekhof@redhat.com, qemu-devel@nongnu.org, aliguori@linux.vnet.ibm.com, ryanh@us.ibm.com, amit.shah@redhat.com On 11/18/2010 05:06 AM, Jes Sorensen wrote: > On 11/16/10 02:15, Michael Roth wrote: >> Signed-off-by: Michael Roth >> --- >> virtproxy.c | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> virtproxy.h | 34 +++++++++++++++ >> 2 files changed, 170 insertions(+), 0 deletions(-) >> create mode 100644 virtproxy.c >> create mode 100644 virtproxy.h >> >> diff --git a/virtproxy.c b/virtproxy.c >> new file mode 100644 >> index 0000000..8f18d83 >> --- /dev/null >> +++ b/virtproxy.c >> @@ -0,0 +1,136 @@ >> +/* >> + * virt-proxy - host/guest communication layer >> + * >> + * Copyright IBM Corp. 2010 >> + * >> + * Authors: >> + * Michael Roth >> + * >> + * This work is licensed under the terms of the GNU GPL, version 2 or later. >> + * See the COPYING file in the top-level directory. >> + * >> + */ >> + >> +#include "virtproxy.h" >> + >> +#define VP_SERVICE_ID_LEN 32 /* max length of service id string */ >> +#define VP_PKT_DATA_LEN 1024 /* max proxied bytes per VPPacket */ >> +#define VP_CONN_DATA_LEN 1024 /* max bytes conns can send at a time */ >> +#define VP_MAGIC 0x1F374059 >> + >> +/* listening fd, one for each service we're forwarding to remote end */ >> +typedef struct VPOForward { >> + VPDriver *drv; >> + int listen_fd; >> + char service_id[VP_SERVICE_ID_LEN]; >> + QLIST_ENTRY(VPOForward) next; >> +} VPOForward; > > I am really not a fan of the typedefmeharder approach you are taking in > here, but others may disagree with me. Isn't typedef'ing structured types part of the qemu coding style guidelines? Or is there something beyond that I'm doing that isn't agreeable? The named struct + typedef approach seems to be widely used, I think to maintain compatibility with utility macros like these while still adhering to coding style in using typedefs wherever possible: qemu-queue.h: #define QLIST_HEAD(name, type) \ struct name { \ struct type *lh_first; /* first element */ \ } > > Cheers, > Jes >