From: <arei.gonglei@huawei.com>
To: qemu-devel@nongnu.org
Cc: Gonglei <arei.gonglei@huawei.com>,
peter.huangpeng@huawei.com, kraxel@redhat.com
Subject: [Qemu-devel] [PATCH 2/3] cirrus_vga: QOMify
Date: Tue, 12 May 2015 17:27:09 +0800 [thread overview]
Message-ID: <1431422830-10320-3-git-send-email-arei.gonglei@huawei.com> (raw)
In-Reply-To: <1431422830-10320-1-git-send-email-arei.gonglei@huawei.com>
From: Gonglei <arei.gonglei@huawei.com>
QOMify pci-cirrus-vga like isa-cirrus-vga device.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
hw/display/cirrus_vga.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index 8765a7e..5198037 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -235,6 +235,10 @@ typedef struct PCICirrusVGAState {
CirrusVGAState cirrus_vga;
} PCICirrusVGAState;
+#define TYPE_PCI_CIRRUS_VGA "cirrus-vga"
+#define PCI_CIRRUS_VGA(obj) \
+ OBJECT_CHECK(PCICirrusVGAState, (obj), TYPE_PCI_CIRRUS_VGA)
+
#define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga"
#define ISA_CIRRUS_VGA(obj) \
OBJECT_CHECK(ISACirrusVGAState, (obj), TYPE_ISA_CIRRUS_VGA)
@@ -3008,7 +3012,7 @@ static const TypeInfo isa_cirrus_vga_info = {
static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
{
- PCICirrusVGAState *d = DO_UPCAST(PCICirrusVGAState, dev, dev);
+ PCICirrusVGAState *d = PCI_CIRRUS_VGA(dev);
CirrusVGAState *s = &d->cirrus_vga;
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
int16_t device_id = pc->device_id;
@@ -3070,7 +3074,7 @@ static void cirrus_vga_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo cirrus_vga_info = {
- .name = "cirrus-vga",
+ .name = TYPE_PCI_CIRRUS_VGA,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PCICirrusVGAState),
.class_init = cirrus_vga_class_init,
--
1.7.12.4
next prev parent reply other threads:[~2015-05-12 9:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 9:27 [Qemu-devel] [PATCH 0/3] hw/display: QOMify arei.gonglei
2015-05-12 9:27 ` [Qemu-devel] [PATCH 1/3] vga-pci: QOMify arei.gonglei
2015-05-12 9:27 ` arei.gonglei [this message]
2015-05-12 9:27 ` [Qemu-devel] [PATCH 3/3] qxl: QOMify arei.gonglei
2015-05-19 7:48 ` [Qemu-devel] [PATCH 0/3] hw/display: QOMify Gonglei
2015-05-19 10:45 ` Gerd Hoffmann
2015-05-19 11:11 ` Gonglei
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=1431422830-10320-3-git-send-email-arei.gonglei@huawei.com \
--to=arei.gonglei@huawei.com \
--cc=kraxel@redhat.com \
--cc=peter.huangpeng@huawei.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).