From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIMQM-0001D4-LR for qemu-devel@nongnu.org; Mon, 24 Oct 2011 11:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIMQL-0002OD-Dt for qemu-devel@nongnu.org; Mon, 24 Oct 2011 11:26:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIMQL-0002O7-6A for qemu-devel@nongnu.org; Mon, 24 Oct 2011 11:26:49 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9OFQmi5024420 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Oct 2011 11:26:48 -0400 Message-ID: <4EA58393.1040901@redhat.com> Date: Mon, 24 Oct 2011 17:26:11 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1319457739-14562-1-git-send-email-alevy@redhat.com> <1319457739-14562-4-git-send-email-alevy@redhat.com> In-Reply-To: <1319457739-14562-4-git-send-email-alevy@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/5] qxl: support concurrent async commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: qemu-devel@nongnu.org, mlureau@redhat.com, armbru@redhat.com, lcapitulino@redhat.com Hi, > +SpiceAsyncCommand *push_spice_async_command(PCIQXLDevice *qxl, > + uint32_t async_io, int size) > +/* caller must call g_free */ > +static SpiceAsyncCommand *pop_spice_async_command(PCIQXLDevice *qxl, > + uint64_t cookie) > +{ push/pop naming implies stack-like operation, which isn't true though. pop will lookup by cookie. Also an explicit release function would be good (list unlink and g_free call can go there). Maybe have spice_async_cmd_{alloc,lookup,free} ? Have you considered passing down a SpiceAsyncCommand pointer instead of the cookie value everywhere? Seems to be a bit cleaner and more future-proof to me. Not sure it buys us much in practice though, so maybe it isn't worth the trouble. cheers, Gerd