From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57191 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPj5j-0003Lp-ER for qemu-devel@nongnu.org; Mon, 06 Dec 2010 16:59:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPj5f-0003Np-PJ for qemu-devel@nongnu.org; Mon, 06 Dec 2010 16:59:27 -0500 Received: from e5.ny.us.ibm.com ([32.97.182.145]:47174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPj5f-0003NW-Mk for qemu-devel@nongnu.org; Mon, 06 Dec 2010 16:59:23 -0500 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e5.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id oB6LadoE012066 for ; Mon, 6 Dec 2010 16:37:14 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 93529728149 for ; Mon, 6 Dec 2010 16:54:40 -0500 (EST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oB6LseWX483002 for ; Mon, 6 Dec 2010 16:54:40 -0500 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oB6LscTe012732 for ; Mon, 6 Dec 2010 14:54:39 -0700 From: Adam Litke In-Reply-To: <1291399402-20366-4-git-send-email-mdroth@linux.vnet.ibm.com> References: <1291399402-20366-1-git-send-email-mdroth@linux.vnet.ibm.com> <1291399402-20366-4-git-send-email-mdroth@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" Date: Mon, 06 Dec 2010 15:54:35 -0600 Message-ID: <1291672475.2213.1.camel@aglitke> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [RFC][PATCH v5 03/21] virtagent: common code for managing client/server rpc jobs List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: agl@linux.vnet.ibm.com, stefanha@linux.vnet.ibm.com, Jes.Sorensen@redhat.com, qemu-devel@nongnu.org, aliguori@linux.vnet.ibm.com, ryanh@us.ibm.com, abeekhof@redhat.com On Fri, 2010-12-03 at 12:03 -0600, Michael Roth wrote: > +/* create new client job and then put it on the queue. this can be > + * called externally from virtagent. Since there can only be one virtagent > + * instance we access state via an object-scoped global rather than pass > + * it around. > + * > + * if this is successful virtagent will handle cleanup of req_xml after > + * making the appropriate callbacks, otherwise callee should handle it > + */ Explain please. Do you mean caller should handle it? Are you trying to say that this function, when successful, "steals" the reference to req_xml? > +int va_client_job_add(xmlrpc_mem_block *req_xml, VAClientCallback *cb, > + MonitorCompletion *mon_cb, void *mon_data) > +{ > + int ret; > + VAClientJob *client_job; > + TRACE("called"); > + > + client_job = va_client_job_new(req_xml, cb, mon_cb, mon_data); > + if (client_job == NULL) { > + return -EINVAL; > + } > + > + ret = va_push_client_job(client_job); > + if (ret != 0) { > + LOG("error adding client to queue: %s", strerror(ret)); > + qemu_free(client_job); > + return ret; > + } > + > + return 0; > +} -- Thanks, Adam