From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIgJp-0001Gc-TS for qemu-devel@nongnu.org; Mon, 22 Jun 2009 06:00:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIgJl-0001Ep-PX for qemu-devel@nongnu.org; Mon, 22 Jun 2009 06:00:05 -0400 Received: from [199.232.76.173] (port=33757 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIgJk-0001EW-9I for qemu-devel@nongnu.org; Mon, 22 Jun 2009 06:00:00 -0400 Received: from mx2.redhat.com ([66.187.237.31]:36712) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MIgJj-00045J-F2 for qemu-devel@nongnu.org; Mon, 22 Jun 2009 05:59:59 -0400 Message-ID: <4A3F5583.90700@redhat.com> Date: Mon, 22 Jun 2009 11:57:23 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 0/10] qdev patches. References: <1245243565-24807-1-git-send-email-kraxel@redhat.com> <4A3A51B9.90207@redhat.com> <4A3BB5F2.9050701@redhat.com> <200906191851.21563.paul@codesourcery.com> <4A3F4BB9.6060604@redhat.com> <4A3F50BA.2030103@redhat.com> In-Reply-To: <4A3F50BA.2030103@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: Avi Kivity Cc: Paul Brook , qemu-devel@nongnu.org On 06/22/09 11:36, Avi Kivity wrote: > On 06/22/2009 12:15 PM, Gerd Hoffmann wrote: >> I can create pci_qdev_register_{single,array} macros to hide the >> length parameter. I can also just drop the length argument and just >> use multiple calls in the (few) places where multiple drivers are >> registered at once. What do you prefer? > > There's a third alternative, zero terminating the array. > > If most calls register one qdev, I'd prefer pci_qdev_register() and > pci_qdev_register_many(). Where register() takes a single instance and register_many() a zero-terminated array I guess? Sounds good. cheers, Gerd