From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCpIX-0006nE-LZ for qemu-devel@nongnu.org; Thu, 21 Apr 2011 04:31:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QCpIW-00043k-PM for qemu-devel@nongnu.org; Thu, 21 Apr 2011 04:31:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QCpIW-00043f-F7 for qemu-devel@nongnu.org; Thu, 21 Apr 2011 04:31:36 -0400 Message-ID: <4DAFEB3B.5070109@redhat.com> Date: Thu, 21 Apr 2011 10:30:51 +0200 From: Jes Sorensen MIME-Version: 1.0 References: <1303138953-1334-1-git-send-email-mdroth@linux.vnet.ibm.com> <1303138953-1334-10-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1303138953-1334-10-git-send-email-mdroth@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC][PATCH v2 09/17] qmp proxy: core code for proxying qmp requests to guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: aliguori@linux.vnet.ibm.com, agl@linux.vnet.ibm.com, qemu-devel@nongnu.org On 04/18/11 17:02, Michael Roth wrote: > diff --git a/qmp-core.c b/qmp-core.c > index 9f3d182..dab50a1 100644 > --- a/qmp-core.c > +++ b/qmp-core.c > @@ -937,7 +937,15 @@ void qmp_async_complete_command(QmpCommandState *cmd, QObject *retval, Error *er > qemu_free(cmd); > } > > +extern QmpProxy *qmp_proxy_default; Please put this in a header file. > +static void qmp_proxy_process_control_event(QmpProxy *p, const QDict *evt) > +{ > + const char *cmd; > + int host_sid, guest_sid; > + > + cmd = qdict_get_try_str(evt, "_control_event"); > + if (!cmd) { > + fprintf(stderr, "received NULL control event\n"); > + } else if (strcmp(cmd, "guest_ack") == 0) { > + host_sid = qdict_get_try_int(evt, "_control_arg_host_sid", 0); > + if (!host_sid) { > + fprintf(stderr, "invalid guest_ack: wrong host sid\n"); > + return; > + } > + /* guest responded to host_init, return a host_ack */ > + /* reset outstanding requests, then send an ack with the > + * session id they passed us > + */ > + guest_sid = qdict_get_try_int(evt, "_control_arg_guest_sid", 0); I am wondering if it would make sense to put these arguments in a header file as #define's to make sure you don't have to chase down a typo on one side at some point? Just an idea, dunno if it is worth it. Cheers, Jes