All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: Immutable qdev properties
Date: Mon, 24 Aug 2009 14:25:29 +0200	[thread overview]
Message-ID: <4A9286B9.2010202@redhat.com> (raw)
In-Reply-To: <87tyzxtwd2.fsf_-_@pike.pond.sub.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

  reply	other threads:[~2009-08-24 12:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-21  8:31 [Qemu-devel] [PATCH 0/3] qdev: clean up & convert watchdogs Markus Armbruster
2009-08-21  8:31 ` [Qemu-devel] [PATCH 1/3] Move watchdog, watchdog_action, give them internal linkage Markus Armbruster
2009-08-21  8:31 ` [Qemu-devel] [PATCH 2/3] Clean up upcast from PCIDevice to I6300State Markus Armbruster
     [not found]   ` <m3ws4xt7up.fsf@neno.mitica>
2009-08-24  8:49     ` [Qemu-devel] container_of() vs DO_UPCAST() (was: [PATCH 2/3] Clean up upcast from PCIDevice to I6300State) Markus Armbruster
2009-08-24 11:55       ` Paul Brook
2009-08-24 11:59   ` [Qemu-devel] [PATCH 2/3] Clean up upcast from PCIDevice to I6300State Paul Brook
2009-08-24 13:44     ` Markus Armbruster
2009-08-24 15:07       ` Gerd Hoffmann
2009-08-21  8:31 ` [Qemu-devel] [PATCH 3/3] qdev: convert watchdogs Markus Armbruster
2009-08-21 13:07   ` Gerd Hoffmann
2009-08-24  9:05     ` Immutable qdev properties (was: [Qemu-devel] [PATCH 3/3] qdev: convert watchdogs) Markus Armbruster
2009-08-24 12:25       ` Gerd Hoffmann [this message]
2009-08-24 13:04         ` [Qemu-devel] Re: Immutable qdev properties Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A9286B9.2010202@redhat.com \
    --to=kraxel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.