From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnrPD-0007Fg-N9 for qemu-devel@nongnu.org; Wed, 16 Sep 2009 06:06:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnrP6-0007CM-Qi for qemu-devel@nongnu.org; Wed, 16 Sep 2009 06:06:29 -0400 Received: from [199.232.76.173] (port=51769 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnrP6-0007C6-FN for qemu-devel@nongnu.org; Wed, 16 Sep 2009 06:06:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37628) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MnrP5-0007UV-Rb for qemu-devel@nongnu.org; Wed, 16 Sep 2009 06:06:24 -0400 Message-ID: <4AB0B875.2060507@redhat.com> Date: Wed, 16 Sep 2009 12:05:41 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <20090915143319.GB24708@redhat.com> <20090916093445.GA1404@redhat.com> In-Reply-To: <20090916093445.GA1404@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/2] qemu/qdev: type safety in reset handler List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Carsten Otte , markmc@redhat.com, Paul Brook , qemu-devel@nongnu.org, Christian Borntraeger , Avi Kivity , Juan Quintela Hi, >> Otherwise, I prefer the old version. We test if there exist >> dev->info->reset >> and just after that, we use >> dev->info->reset() > > Good point. I think I'll just move the if (dev->info->reset) > into qdev_reset. How about going one step further? Register *one* qdev_reset instance which then walks the qdev tree and calls ->reset() for every device? cheers, Gerd