From: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
To: qemu-devel@nongnu.org
Cc: marcel@redhat.com, caoj.fnst@cn.fujitsu.com,
Wei Jiangang <weijg.fnst@cn.fujitsu.com>,
ehabkost@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH 2/3] pxb: convert to realize()
Date: Mon, 14 Mar 2016 18:35:03 +0800 [thread overview]
Message-ID: <1457951704-5217-3-git-send-email-weijg.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <1457951704-5217-1-git-send-email-weijg.fnst@cn.fujitsu.com>
Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
hw/pci-bridge/pci_expander_bridge.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index ce5baf8..cc5074d 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -267,22 +267,14 @@ err_register_bus:
object_unref(OBJECT(ds));
}
-static int pxb_dev_initfn(PCIDevice *dev)
+static void pxb_dev_realize(PCIDevice *dev, Error **errp)
{
- Error *err = NULL;
-
if (pci_bus_is_express(dev->bus)) {
- error_report("pxb devices cannot reside on a PCIe bus!");
- return -EINVAL;
- }
-
- pxb_dev_realize_common(dev, false, &err);
- if (err) {
- error_report_err(err);
- return -EINVAL;
+ error_setg(errp, "pxb devices cannot reside on a PCIe bus!");
+ return;
}
- return 0;
+ pxb_dev_realize_common(dev, false, errp);
}
static void pxb_dev_exitfn(PCIDevice *pci_dev)
@@ -304,7 +296,7 @@ static void pxb_dev_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
- k->init = pxb_dev_initfn;
+ k->realize = pxb_dev_realize;
k->exit = pxb_dev_exitfn;
k->vendor_id = PCI_VENDOR_ID_REDHAT;
k->device_id = PCI_DEVICE_ID_REDHAT_PXB;
--
1.9.3
next prev parent reply other threads:[~2016-03-14 10:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-14 10:35 [Qemu-devel] [PATCH 0/3] conversion to realize for pxb/pxb-pcie Wei Jiangang
2016-03-14 10:35 ` [Qemu-devel] [PATCH 1/3] hw/pci-bridge: modify pxb_dev_init_common Wei Jiangang
2016-03-22 14:38 ` Markus Armbruster
2016-03-14 10:35 ` Wei Jiangang [this message]
2016-03-22 14:40 ` [Qemu-devel] [PATCH 2/3] pxb: convert to realize() Markus Armbruster
2016-03-14 10:35 ` [Qemu-devel] [PATCH 3/3] pxb-pcie: " Wei Jiangang
2016-03-22 14:42 ` Markus Armbruster
2016-03-15 14:14 ` [Qemu-devel] [PATCH 0/3] conversion to realize for pxb/pxb-pcie Marcel Apfelbaum
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=1457951704-5217-3-git-send-email-weijg.fnst@cn.fujitsu.com \
--to=weijg.fnst@cn.fujitsu.com \
--cc=caoj.fnst@cn.fujitsu.com \
--cc=ehabkost@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@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.