From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlmXU-00040O-UR for qemu-devel@nongnu.org; Thu, 10 Sep 2009 12:30:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlmXQ-0003yG-1j for qemu-devel@nongnu.org; Thu, 10 Sep 2009 12:30:28 -0400 Received: from [199.232.76.173] (port=34733 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlmXP-0003yB-U0 for qemu-devel@nongnu.org; Thu, 10 Sep 2009 12:30:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31742) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MlmXO-00042w-Kk for qemu-devel@nongnu.org; Thu, 10 Sep 2009 12:30:23 -0400 Subject: Re: [Qemu-devel] [PATCH 0/5] qdev: device capabilities References: <1251714459-2467-1-git-send-email-kraxel@redhat.com> <4AA12D59.6040208@codemonkey.ws> <4AA12F46.6000207@redhat.com> <4AA26A2D.4010605@codemonkey.ws> <4AA4E4B9.4020208@redhat.com> <4AA56ECD.3040400@codemonkey.ws> <4AA5FF3D.7010404@redhat.com> From: Markus Armbruster Date: Thu, 10 Sep 2009 18:30:17 +0200 In-Reply-To: <4AA5FF3D.7010404@redhat.com> (Gerd Hoffmann's message of "Tue\, 08 Sep 2009 08\:52\:45 +0200") Message-ID: <87eiqeiwyu.fsf@pike.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd Hoffmann writes: > On 09/07/09 22:36, Anthony Liguori wrote: >> Gerd Hoffmann wrote: >>> Patch #5 does just that. Almost. -watchdog continues to accept >>> watchdog devices only. And '-watchdog ?' lists watchdog devices only. >>> >>> watchdog_list is gone, the qdev list is used instead. To identify the >>> watchdog devices in the qdev device model list the capability bit is >>> used. The patch description says so, doesn't it? >> >> Instead of checking the capability bit, why not look for a property with >> a type that's unique to the watch dog timer. > > *There is no such property.* > > We are running in circles for months now. You are suggesting to look > for a unique property. I point out that it simply doesn't work for > certain devices due to lack of such a property. Repeat. > > Can we stop that please? > > Do you suggest to create some unused dummy property to tag devices? We could make it a set of well-known bits, say bit#0 audio, bit#1 ethernet, bit#2 display, bit#3 watchdog, ..., and call it "caps" ;) I think we all agree that we want watchdog_list replaced by filtering watchdog devices from the qdev list. I figure there will be more applications for that elsewhere (-net nic,model=? comes to mind). Filtering the qdev list requires a way to ask "what kind of device is this?", or at least "is this a FOO device?", for the various FOOs. Capabilities support that in a simple, general way. We can answer either question by detecting characteristic properties instead. But it'll require artificial characteristic properties, as the watchdog example demonstrates. And I doubt it'll be easier or cleaner in the end.