Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfZDZ-0004kV-Tl for qemu-devel@nongnu.org; Mon, 24 Aug 2009 09:04:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfZDV-0004ed-5c for qemu-devel@nongnu.org; Mon, 24 Aug 2009 09:04:13 -0400 Received: from [199.232.76.173] (port=47564 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfZDU-0004eX-UC for qemu-devel@nongnu.org; Mon, 24 Aug 2009 09:04:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34291) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfZDT-0002Lf-PN for qemu-devel@nongnu.org; Mon, 24 Aug 2009 09:04:08 -0400 Received: from int-mx07.intmail.prod.int.phx2.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7OD46oD011667 for ; Mon, 24 Aug 2009 09:04:07 -0400 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> <4A9286B9.2010202@redhat.com> From: Markus Armbruster Date: Mon, 24 Aug 2009 15:04:05 +0200 In-Reply-To: <4A9286B9.2010202@redhat.com> (Gerd Hoffmann's message of "Mon\, 24 Aug 2009 14\:25\:29 +0200") Message-ID: <87tyzxqs6y.fsf@pike.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: [Qemu-devel] Re: Immutable qdev properties 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 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 ... Works for me. >> 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? Good point. > 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, Agree. > but that depends on the > init()-callback-can-fail patches ... Yes.