From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfVUw-0002kb-64 for qemu-devel@nongnu.org; Mon, 24 Aug 2009 05:05:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfVUr-0002io-Bm for qemu-devel@nongnu.org; Mon, 24 Aug 2009 05:05:53 -0400 Received: from [199.232.76.173] (port=48247 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfVUr-0002iS-6Y for qemu-devel@nongnu.org; Mon, 24 Aug 2009 05:05:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33726) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfVUq-00042i-Js for qemu-devel@nongnu.org; Mon, 24 Aug 2009 05:05:48 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7O95kmn005783 for ; Mon, 24 Aug 2009 05:05:47 -0400 Subject: Immutable qdev properties (was: [Qemu-devel] [PATCH 3/3] qdev: convert watchdogs) References: <1250843494-28326-1-git-send-email-armbru@redhat.com> <1250843494-28326-4-git-send-email-armbru@redhat.com> <4A8E9C03.1030907@redhat.com> From: Markus Armbruster Date: Mon, 24 Aug 2009 11:05:45 +0200 In-Reply-To: <4A8E9C03.1030907@redhat.com> (Gerd Hoffmann's message of "Fri\, 21 Aug 2009 15\:07\:15 +0200") Message-ID: <87tyzxtwd2.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: qemu-devel@nongnu.org Cc: Gerd Hoffmann Gerd Hoffmann writes: >> +static void wdt_ib700_init(ISADevice *dev) >> { >> + timer = qemu_new_timer(vm_clock, ib700_timer_expired, NULL); >> register_savevm("ib700_wdt", -1, 0, ib700_save, ib700_load, NULL); >> - >> register_ioport_write(0x441, 2, 1, ib700_write_disable_reg, NULL); >> register_ioport_write(0x443, 2, 1, ib700_write_enable_reg, NULL); >> } > > One minor nit: Setting dev->iobase[] to { 0x441, 0x443 } here would > be nice as 'info qtree' will show the ports actually used by the > device then. Can do. iobase[] will start as whatever the user specifies in -device, defaulting to { -1, -1 }, then revert to { 0x441, 0x443 } when the device is initialized. Not sure whether this is a problem. Taking a step back, the general problem is "immutable" qdev properties, i.e. properties that aren't configurable. I think it would be good to agree on a common method there, and document it. Your suggestion for this particular case is to have device initialization overwrite whatever was configured. Good enough for the general case? > Otherwise the patch series looks good. Thanks for the review!