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 06/12] qdev: add isa_create() function
Date: Wed,  9 Sep 2009 16:45:41 +0200	[thread overview]
Message-ID: <1252507547-11398-7-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1252507547-11398-1-git-send-email-kraxel@redhat.com>

Like isa_create_simple, but doesn't call qdev_init, so one can set
properties after creating and before initializing the device.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/isa-bus.c |   15 +++++++++++++--
 hw/isa.h     |    1 +
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 3cc17b2..4ecc0f8 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -109,7 +109,7 @@ void isa_qdev_register(ISADeviceInfo *info)
     qdev_register(&info->qdev);
 }
 
-ISADevice *isa_create_simple(const char *name)
+ISADevice *isa_create(const char *name)
 {
     DeviceState *dev;
 
@@ -118,10 +118,21 @@ ISADevice *isa_create_simple(const char *name)
         return NULL;
     }
     dev = qdev_create(&isabus->qbus, name);
-    qdev_init(dev);
     return DO_UPCAST(ISADevice, qdev, dev);
 }
 
+ISADevice *isa_create_simple(const char *name)
+{
+    ISADevice *dev;
+
+    dev = isa_create(name);
+    if (qdev_init(&dev->qdev) != 0) {
+        qdev_free(&dev->qdev);
+        return NULL;
+    }
+    return dev;
+}
+
 static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent)
 {
     ISADevice *d = DO_UPCAST(ISADevice, qdev, dev);
diff --git a/hw/isa.h b/hw/isa.h
index 4582ff9..655ad62 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -27,6 +27,7 @@ void isa_bus_irqs(qemu_irq *irqs);
 qemu_irq isa_reserve_irq(int isairq);
 void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
 void isa_qdev_register(ISADeviceInfo *info);
+ISADevice *isa_create(const char *name);
 ISADevice *isa_create_simple(const char *name);
 
 extern target_phys_addr_t isa_mem_base;
-- 
1.6.2.5

  parent reply	other threads:[~2009-09-09 14:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-09 14:45 [Qemu-devel] [PATCH 00/12] qdev isa patches Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 01/12] isapc: Fix irq routing Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 02/12] isapc: pick a more sane default cpu for such old hardware Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 03/12] qdev: drop iobase properties from isa bus Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 04/12] qdev: simplify isa irq assignments Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 05/12] qdev: tag isabus-bridge as no-user Gerd Hoffmann
2009-09-09 14:45 ` Gerd Hoffmann [this message]
2009-09-09 14:45 ` [Qemu-devel] [PATCH 07/12] qdev/isa: convert soundblaster Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 08/12] qdev/isa: convert cs4231a sound card Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 09/12] qdev/isa: convert gravis ultrasound Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 10/12] qdev/isa: convert ne2000 Gerd Hoffmann
2009-09-09 17:29   ` Markus Armbruster
2009-09-09 17:50   ` Markus Armbruster
2009-09-09 19:58     ` Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 11/12] qdev/isa: finish pckbd conversion Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 12/12] qdev/isa: convert real time clock Gerd Hoffmann
2009-09-09 19:43   ` [Qemu-devel] " Gerd Hoffmann
2009-09-11  9:29     ` Jan Kiszka
2009-09-11  9:32       ` Jan Kiszka
2009-09-09 17:56 ` [Qemu-devel] [PATCH 00/12] qdev isa patches 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=1252507547-11398-7-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).