From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfYcH-00070k-7e for qemu-devel@nongnu.org; Mon, 24 Aug 2009 08:25:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfYcC-0006uo-4k for qemu-devel@nongnu.org; Mon, 24 Aug 2009 08:25:40 -0400 Received: from [199.232.76.173] (port=36335 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfYcB-0006uZ-V6 for qemu-devel@nongnu.org; Mon, 24 Aug 2009 08:25:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64061) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfYcB-0004Uw-5g for qemu-devel@nongnu.org; Mon, 24 Aug 2009 08:25:35 -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.13.8/8.13.8) with ESMTP id n7OCPVqG007526 for ; Mon, 24 Aug 2009 08:25:31 -0400 Message-ID: <4A9286B9.2010202@redhat.com> Date: Mon, 24 Aug 2009 14:25:29 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1250843494-28326-1-git-send-email-armbru@redhat.com> <1250843494-28326-4-git-send-email-armbru@redhat.com> <4A8E9C03.1030907@redhat.com> <87tyzxtwd2.fsf_-_@pike.pond.sub.org> In-Reply-To: <87tyzxtwd2.fsf_-_@pike.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: Immutable qdev properties List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org On 08/24/09 11:05, Markus Armbruster wrote: > 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. The ioport properties should reflect the values actually used, even in case they can not be configured. So in case a ISA device finds '-1' aka 'not specified by the user', it should fill in (and use) the default value. See also below ... > 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. On a even broader view: how to handle invalid property values? Having a device support one fixed I/O port is just a special case of that. Other ISA devices usually can be configured to a few possible I/O bases using dip switches (sound cards for example). But the possible values are usually fairly limited. In case the user specifies a impossible iobase we can (1) ignore it and use defaults instead. (2) fix it (pick nearest possible value or so). (3) fail. #3 is probably the most sane, but that depends on the init()-callback-can-fail patches ... cheers, Gerd