qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH] isa: configure serial+parallel by index.
Date: Tue, 17 Nov 2009 11:28:41 +0100	[thread overview]
Message-ID: <1258453721-4530-1-git-send-email-kraxel@redhat.com> (raw)

This patch adds a 'index' property to the isa-parallel and isa-serial
devices.  This can be used to create devices with the default isa irqs
and ioports by simply specifying the index, i.e.

   -device isa-serial,index=1

instead of

   -device isa-serial,iobase=0x2f8,irq=3

for ttyS1 aka com2.  Likewise for parallel ports.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/parallel.c |    2 +-
 hw/serial.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/parallel.c b/hw/parallel.c
index 5ae8348..12693d4 100644
--- a/hw/parallel.c
+++ b/hw/parallel.c
@@ -587,7 +587,7 @@ static ISADeviceInfo parallel_isa_info = {
     .qdev.size  = sizeof(ISAParallelState),
     .init       = parallel_isa_initfn,
     .qdev.props = (Property[]) {
-        DEFINE_PROP_HEX32("index",  ISAParallelState, index,   -1),
+        DEFINE_PROP_UINT32("index", ISAParallelState, index,   -1),
         DEFINE_PROP_HEX32("iobase", ISAParallelState, iobase,  -1),
         DEFINE_PROP_UINT32("irq",   ISAParallelState, isairq,  7),
         DEFINE_PROP_CHR("chardev",  ISAParallelState, state.chr),
diff --git a/hw/serial.c b/hw/serial.c
index 0063260..e7538ac 100644
--- a/hw/serial.c
+++ b/hw/serial.c
@@ -900,7 +900,7 @@ static ISADeviceInfo serial_isa_info = {
     .qdev.size  = sizeof(ISASerialState),
     .init       = serial_isa_initfn,
     .qdev.props = (Property[]) {
-        DEFINE_PROP_HEX32("index",  ISASerialState, index,   -1),
+        DEFINE_PROP_UINT32("index", ISASerialState, index,   -1),
         DEFINE_PROP_HEX32("iobase", ISASerialState, iobase,  -1),
         DEFINE_PROP_UINT32("irq",   ISASerialState, isairq,  -1),
         DEFINE_PROP_CHR("chardev",  ISASerialState, state.chr),
-- 
1.6.2.5

             reply	other threads:[~2009-11-17 10:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 10:28 Gerd Hoffmann [this message]
2009-11-20 15:01 ` [Qemu-devel] [PATCH] isa: configure serial+parallel by index Markus Armbruster
2009-12-02 14:59   ` Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2009-10-26 11:19 Gerd Hoffmann
2009-10-13 11:38 Gerd Hoffmann
2009-10-13 19:08 ` Markus Armbruster
2009-10-26  8:56   ` Markus Armbruster
2009-10-26  9:13     ` Gerd Hoffmann

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=1258453721-4530-1-git-send-email-kraxel@redhat.com \
    --to=kraxel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).