|
From: | Gerd Hoffmann |
Subject: | [Qemu-devel] Re: Immutable qdev properties |
Date: | Mon, 24 Aug 2009 14:25:29 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |