From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMcEX-0007tk-UJ for qemu-devel@nongnu.org; Wed, 18 May 2011 04:35:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMcEW-00075L-Rx for qemu-devel@nongnu.org; Wed, 18 May 2011 04:35:57 -0400 Received: from mail-yi0-f45.google.com ([209.85.218.45]:50536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMcEW-00075G-Mq for qemu-devel@nongnu.org; Wed, 18 May 2011 04:35:56 -0400 Received: by yib19 with SMTP id 19so526811yib.4 for ; Wed, 18 May 2011 01:35:56 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1305679930-4215-14-git-send-email-mdroth@linux.vnet.ibm.com> References: <1305679930-4215-1-git-send-email-mdroth@linux.vnet.ibm.com> <1305679930-4215-14-git-send-email-mdroth@linux.vnet.ibm.com> Date: Wed, 18 May 2011 09:35:55 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v1][ 13/23] qapi: add QMP input visiter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: aliguori@linux.vnet.ibm.com, qemu-devel@nongnu.org, lcapitulino@redhat.com On Wed, May 18, 2011 at 1:52 AM, Michael Roth w= rote: > A type of Visiter class that is used to walk a qobject's > structure and assign each entry to the corresponding native C type. > Command marshaling function will use this to pull out QMP command > parameters recieved over the wire and pass them as native arguments > to the corresponding C functions. > > Signed-off-by: Michael Roth > --- > =A0qapi/qmp-input-visiter.c | =A0239 ++++++++++++++++++++++++++++++++++++= ++++++++++ > =A0qapi/qmp-input-visiter.h | =A0 13 +++ > =A02 files changed, 252 insertions(+), 0 deletions(-) > =A0create mode 100644 qapi/qmp-input-visiter.c > =A0create mode 100644 qapi/qmp-input-visiter.h Pedantic note: the design pattern is commonly spelled "visitor": http://en.wikipedia.org/wiki/Visitor_pattern The fixed-size stack and hardcoded object size are unfortunate but I haven't read the code in enough detail to see if there is a feasible alternative. Stefan